Qt4 - список с флажками

Модератор: Модераторы разделов

frp
Сообщения: 1445
ОС: Debian Squeeze

Qt4 - список с флажками

Сообщение frp »

Как сделать в Qt 4 список с флажками?
Спасибо сказали:
NickLion
Сообщения: 3408
Статус: аватар-невидимка
ОС: openSUSE Tumbleweed x86_64

Re: Qt4 - список с флажками

Сообщение NickLion »

QListWidget - у итемов (как это по-русски сказать?) задать checkState.

UPD вот кусок из ui файла:

Код: Выделить всё

   <widget class="QListWidget" name="listWidget">
    <property name="geometry">
     <rect>
      <x>40</x>
      <y>40</y>
      <width>111</width>
      <height>91</height>
     </rect>
    </property>
    <item>
     <property name="text">
      <string>New Item 1</string>
     </property>
     <property name="checkState">
      <enum>Unchecked</enum>
     </property>
    </item>
    <item>
     <property name="text">
      <string>New Item 2</string>
     </property>
     <property name="checkState">
      <enum>Unchecked</enum>
     </property>
    </item>
    <item>
     <property name="text">
      <string>New Item 3</string>
     </property>
     <property name="checkState">
      <enum>Unchecked</enum>
     </property>
    </item>
   </widget>
Спасибо сказали: