pqSearchBox is a line edit and an advanced tool button in the same layout. More...
#include <pqSearchBox.h>
Inherits QWidget.
Public Types | |
typedef QWidget | Superclass |
Public Slots | |
void | setAdvancedSearchActive (bool use) |
Toggle the advanced search button. More... | |
void | setText (const QString &text) |
Set the search text. More... | |
QString | setSettingKey (const QString &key) |
Set the new setting key that will be used to restore/save the advanced button check state. More... | |
void | setAdvancedSearchEnabled (bool enable) |
Set whether the advanced button is visible/enabled. More... | |
Signals | |
void | advancedSearchActivated (bool) |
Sent when the advanced button is toggled. More... | |
void | textChanged (const QString &) |
Sent whenever the search text is changed. More... | |
void | settingKeyChanged (const QString &) |
Sent whenever the setting key was changed. More... | |
Public Member Functions | |
pqSearchBox (QWidget *parent=nullptr) | |
pqSearchBox (bool advancedSearchEnabled, const QString &settingKey="", QWidget *parent=nullptr) | |
~pqSearchBox () override | |
bool | isAdvancedSearchActive () const |
Returns whether the advanced button is activated. More... | |
QString | text () const |
Get the current search text. More... | |
QString | placeholderText () const |
Set/Get the current search text. More... | |
void | setPlaceholderText (const QString &text) |
QString | settingKey () const |
Get the current setting key used to save the advanced button check state. More... | |
QSettings * | settings () const |
Convenience method to access the settings. More... | |
bool | isAdvancedSearchEnabled () const |
Return whether the advanced search button is visible/enabled. More... | |
Protected Slots | |
void | onAdvancedButtonClicked (bool) |
void | updateSettings () |
void | updateFromSettings () |
Protected Member Functions | |
void | keyPressEvent (QKeyEvent *e) override |
Properties | |
QString | text |
The text property allow to access the text in the search box line edit. More... | |
QString | placeholderText |
The placeholderText property mirrors the line edit placeholderText property. More... | |
bool | advancedSearchActive |
The advancedSearchActive allows the user to access/control the advanced search button state depending on the current advancedSearchEnabled property. More... | |
bool | advancedSearchEnabled |
This property governs whether the advanced search button is enabled and visible (enabled == visible). More... | |
QString | settingKey |
When the advanced search is enabled, the button can save/restore its state from the settings using the settingKey property. More... | |
Friends | |
class | pqInternals |
pqSearchBox is a line edit and an advanced tool button in the same layout.
Most of the time, the text of the line edit is used to filter the properties of the panel. The pqSearchBox adds some functionnalities:
Definition at line 25 of file pqSearchBox.h.
typedef QWidget pqSearchBox::Superclass |
Definition at line 75 of file pqSearchBox.h.
pqSearchBox::pqSearchBox | ( | QWidget * | parent = nullptr | ) |
pqSearchBox::pqSearchBox | ( | bool | advancedSearchEnabled, |
const QString & | settingKey = "" , |
||
QWidget * | parent = nullptr |
||
) |
|
override |
bool pqSearchBox::isAdvancedSearchActive | ( | ) | const |
Returns whether the advanced button is activated.
advancedSearchActive property
QString pqSearchBox::text | ( | ) | const |
Get the current search text.
QString pqSearchBox::placeholderText | ( | ) | const |
Set/Get the current search text.
void pqSearchBox::setPlaceholderText | ( | const QString & | text | ) |
QString pqSearchBox::settingKey | ( | ) | const |
Get the current setting key used to save the advanced button check state.
QSettings* pqSearchBox::settings | ( | ) | const |
Convenience method to access the settings.
It should not be used to modify the advanced button state. Use setAdvancedSearchActive() instead.
bool pqSearchBox::isAdvancedSearchEnabled | ( | ) | const |
Return whether the advanced search button is visible/enabled.
|
signal |
Sent when the advanced button is toggled.
Note that no signal is sent when the configuration is None.
|
signal |
Sent whenever the search text is changed.
|
signal |
Sent whenever the setting key was changed.
|
slot |
Toggle the advanced search button.
This is a no-op when the configuration is None.
|
slot |
Set the search text.
|
slot |
Set the new setting key that will be used to restore/save the advanced button check state.
If the given key is valid (i.e. not empty), the button state will be restored from the key value. The old key is left unchanged in the setting to whatever its last value was. Although returned, removing (or not) the old key is up to the user.
|
slot |
Set whether the advanced button is visible/enabled.
|
overrideprotected |
|
protectedslot |
|
protectedslot |
|
protectedslot |
|
friend |
Definition at line 181 of file pqSearchBox.h.
|
readwrite |
The text property allow to access the text in the search box line edit.
Default is empty.
Definition at line 34 of file pqSearchBox.h.
|
readwrite |
The placeholderText property mirrors the line edit placeholderText property.
Default text is "Search... (use Esc to clear text)"
Definition at line 42 of file pqSearchBox.h.
|
readwrite |
The advancedSearchActive allows the user to access/control the advanced search button state depending on the current advancedSearchEnabled property.
Definition at line 51 of file pqSearchBox.h.
|
readwrite |
This property governs whether the advanced search button is enabled and visible (enabled == visible).
By default the advanced search button is disabled/hidden.
Definition at line 58 of file pqSearchBox.h.
|
readwrite |
When the advanced search is enabled, the button can save/restore its state from the settings using the settingKey property.
If the key is empty then the settings have no influence on the advanced button state. In the following cases, the widget will restore the advanced button state to the setting key value:
Definition at line 72 of file pqSearchBox.h.