128 Q_PROPERTY( QString separator READ separator WRITE setSeparator )
129 Q_PROPERTY( QString defaultText READ defaultText WRITE setDefaultText )
130 Q_PROPERTY( QStringList checkedItems READ checkedItems WRITE setCheckedItems )
143 QString separator() const;
150 void setSeparator( const QString &separator );
157 QString defaultText() const;
165 void setDefaultText( const QString &text );
173 void addItemWithCheckState( const QString &text, Qt::CheckState state, const QVariant &userData = QVariant() );
179 QStringList checkedItems() const;
186 QVariantList checkedItemsData() const;
194 Qt::CheckState itemCheckState(
int index ) const;
203 void setItemCheckState(
int index, Qt::CheckState state );
211 void toggleItemCheckState(
int index );
224 void hidePopup()
override;
229 bool eventFilter( QObject *
object, QEvent *event )
override;
245 void setCheckedItems(
const QStringList &items );
252 void resizeEvent( QResizeEvent *event )
override;
260 void showContextMenu( QPoint pos );
265 void selectAllOptions();
270 void deselectAllOptions();
276 void updateCheckedItems();
277 void updateDisplayText();
280 QString mDefaultText;
282 bool mSkipHide =
false;
284 QMenu *mContextMenu =
nullptr;
285 QAction *mSelectAllAction =
nullptr;
286 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.