Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
107 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,111 +1,151 @@ | ||
/** \class QgsCheckBoxDelegate | ||
* \ingroup gui | ||
* QComboBox subclass which allows selecting multiple items. | ||
* @note added in QGIS 3.0 | ||
**/ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/qgscheckablecombobox.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
class QgsCheckableComboBox : QComboBox | ||
{ | ||
|
||
%TypeHeaderCode | ||
#include <qgscheckablecombobox.h> | ||
#include "qgscheckablecombobox.h" | ||
%End | ||
|
||
|
||
public: | ||
|
||
/** Constructor for QgsCheckableComboBox. | ||
* @param parent parent object | ||
*/ | ||
QgsCheckableComboBox( QWidget *parent = nullptr ); | ||
QgsCheckableComboBox( QWidget *parent = 0 ); | ||
%Docstring | ||
Constructor for QgsCheckableComboBox. | ||
@param parent parent object | ||
%End | ||
|
||
/** Returns separator used to separate items in the display text. | ||
* @see setSeparator() | ||
*/ | ||
QString separator() const; | ||
%Docstring | ||
Returns separator used to separate items in the display text. | ||
@see setSeparator() | ||
%End | ||
|
||
/** Set separator used to separate items in the display text. | ||
* @param separator separator to use | ||
* @see separator() | ||
*/ | ||
void setSeparator( const QString &separator ); | ||
%Docstring | ||
Set separator used to separate items in the display text. | ||
@param separator separator to use | ||
@see separator() | ||
%End | ||
|
||
/** Returns default text which will be displayed in the widget | ||
* when no items selected. | ||
* @see setDefaultText() | ||
*/ | ||
QString defaultText() const; | ||
%Docstring | ||
Returns default text which will be displayed in the widget | ||
when no items selected. | ||
@see setDefaultText() | ||
%End | ||
|
||
/** Set default text which will be displayed in the widget when | ||
* no items selected. | ||
* @param text default text | ||
* @see defaultText() | ||
*/ | ||
void setDefaultText( const QString &text ); | ||
%Docstring | ||
Set default text which will be displayed in the widget when | ||
no items selected. | ||
@param text default text | ||
@see defaultText() | ||
%End | ||
|
||
/** Returns currently checked items. | ||
* @see setCheckedItems() | ||
*/ | ||
QStringList checkedItems() const; | ||
%Docstring | ||
Returns currently checked items. | ||
@see setCheckedItems() | ||
%End | ||
|
||
/** Returns the checked state of the item identified by index | ||
* @param index item index | ||
* @see setItemCheckState() | ||
* @see toggleItemCheckState() | ||
*/ | ||
Qt::CheckState itemCheckState( int index ) const; | ||
%Docstring | ||
Returns the checked state of the item identified by index | ||
@param index item index | ||
@see setItemCheckState() | ||
@see toggleItemCheckState() | ||
%End | ||
|
||
/** Sets the item check state to state | ||
* @param index item index | ||
* @param state check state | ||
* @see itemCheckState() | ||
* @see toggleItemCheckState() | ||
*/ | ||
void setItemCheckState( int index, Qt::CheckState state ); | ||
%Docstring | ||
Sets the item check state to state | ||
@param index item index | ||
@param state check state | ||
@see itemCheckState() | ||
@see toggleItemCheckState() | ||
%End | ||
|
||
/** Toggles the item check state | ||
* @param index item index | ||
* @see itemCheckState() | ||
* @see setItemCheckState() | ||
*/ | ||
void toggleItemCheckState( int index ); | ||
%Docstring | ||
Toggles the item check state | ||
@param index item index | ||
@see itemCheckState() | ||
@see setItemCheckState() | ||
%End | ||
|
||
/** Hides the list of items in the combobox if it is currently | ||
* visible and resets the internal state. | ||
*/ | ||
virtual void hidePopup(); | ||
%Docstring | ||
Hides the list of items in the combobox if it is currently | ||
visible and resets the internal state. | ||
%End | ||
|
||
/** Filters events to enable context menu | ||
*/ | ||
virtual bool eventFilter( QObject *object, QEvent *event ); | ||
%Docstring | ||
Filters events to enable context menu | ||
%End | ||
|
||
signals: | ||
|
||
/** This signal is emitted whenever the checked items list changed. | ||
*/ | ||
void checkedItemsChanged( const QStringList &items ); | ||
%Docstring | ||
This signal is emitted whenever the checked items list changed. | ||
%End | ||
|
||
public slots: | ||
|
||
/** Set items which should be checked/selected. | ||
* @param items items to select | ||
* @see checkedItems() | ||
*/ | ||
void setCheckedItems( const QStringList &items ); | ||
%Docstring | ||
Set items which should be checked/selected. | ||
@param items items to select | ||
@see checkedItems() | ||
%End | ||
|
||
protected: | ||
/** Handler for widget resizing | ||
*/ | ||
|
||
virtual void resizeEvent( QResizeEvent *event ); | ||
%Docstring | ||
Handler for widget resizing | ||
%End | ||
|
||
protected slots: | ||
/** Display context menu which allows to select/deselect | ||
* all items at once. | ||
*/ | ||
|
||
void showContextMenu( const QPoint &pos ); | ||
%Docstring | ||
Display context menu which allows to select/deselect | ||
all items at once. | ||
%End | ||
|
||
/** Selects all items. | ||
*/ | ||
void selectAllOptions(); | ||
%Docstring | ||
Selects all items. | ||
%End | ||
|
||
/** Removes selection from all items. | ||
*/ | ||
void deselectAllOptions(); | ||
%Docstring | ||
Removes selection from all items. | ||
%End | ||
|
||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/qgscheckablecombobox.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters