123 Q_PROPERTY( QString separator READ separator WRITE setSeparator )
124 Q_PROPERTY( QString defaultText READ defaultText WRITE setDefaultText )
125 Q_PROPERTY( QStringList checkedItems READ checkedItems WRITE setCheckedItems )
137 QString separator() const;
144 void setSeparator( const QString &separator );
151 QString defaultText() const;
159 void setDefaultText( const QString &text );
167 void addItemWithCheckState( const QString &text, Qt::CheckState state, const QVariant &userData = QVariant() );
173 QStringList checkedItems() const;
180 QVariantList checkedItemsData() const;
188 Qt::CheckState itemCheckState(
int index ) const;
197 void setItemCheckState(
int index, Qt::CheckState state );
205 void toggleItemCheckState(
int index );
221 void hidePopup()
override;
226 bool eventFilter( QObject *
object, QEvent *event )
override;
242 void setCheckedItems(
const QStringList &items );
248 void resizeEvent( QResizeEvent *event )
override;
256 void showContextMenu( QPoint pos );
261 void selectAllOptions();
266 void deselectAllOptions();
272 void updateCheckedItems();
273 void updateDisplayText();
276 QString mDefaultText;
278 bool mSkipHide =
false;
280 QMenu *mContextMenu =
nullptr;
281 QAction *mSelectAllAction =
nullptr;
282 QAction *mDeselectAllAction =
nullptr;
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Renders the delegate using the given painter and style option for the item specified by index.