125 Q_PROPERTY( QString separator READ separator WRITE setSeparator )
126 Q_PROPERTY( QString defaultText READ defaultText WRITE setDefaultText )
127 Q_PROPERTY( QStringList checkedItems READ checkedItems WRITE setCheckedItems )
140 QString separator() const;
147 void setSeparator( const QString &separator );
154 QString defaultText() const;
162 void setDefaultText( const QString &text );
170 void addItemWithCheckState( const QString &text, Qt::CheckState state, const QVariant &userData = QVariant() );
176 QStringList checkedItems() const;
183 QVariantList checkedItemsData() const;
191 Qt::CheckState itemCheckState(
int index ) const;
200 void setItemCheckState(
int index, Qt::CheckState state );
208 void toggleItemCheckState(
int index );
221 void hidePopup()
override;
226 bool eventFilter( QObject *
object, QEvent *event )
override;
242 void setCheckedItems(
const QStringList &items );
249 void resizeEvent( QResizeEvent *event )
override;
257 void showContextMenu( QPoint pos );
262 void selectAllOptions();
267 void deselectAllOptions();
273 void updateCheckedItems();
274 void updateDisplayText();
277 QString mDefaultText;
279 bool mSkipHide =
false;
281 QMenu *mContextMenu =
nullptr;
282 QAction *mSelectAllAction =
nullptr;
283 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.