Public Types | Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Properties | Friends | List of all members
pqSearchBox Class Reference

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
 

Detailed Description

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.

Member Typedef Documentation

◆ Superclass

typedef QWidget pqSearchBox::Superclass

Definition at line 75 of file pqSearchBox.h.

Constructor & Destructor Documentation

◆ pqSearchBox() [1/2]

pqSearchBox::pqSearchBox ( QWidget *  parent = nullptr)

◆ pqSearchBox() [2/2]

pqSearchBox::pqSearchBox ( bool  advancedSearchEnabled,
const QString &  settingKey = "",
QWidget *  parent = nullptr 
)

◆ ~pqSearchBox()

pqSearchBox::~pqSearchBox ( )
override

Member Function Documentation

◆ isAdvancedSearchActive()

bool pqSearchBox::isAdvancedSearchActive ( ) const

Returns whether the advanced button is activated.

advancedSearchActive property

◆ text()

QString pqSearchBox::text ( ) const

Get the current search text.

See also
text property, QLineEdit

◆ placeholderText()

QString pqSearchBox::placeholderText ( ) const

Set/Get the current search text.

See also
placeholderText property, QLineEdit

◆ setPlaceholderText()

void pqSearchBox::setPlaceholderText ( const QString &  text)

◆ settingKey()

QString pqSearchBox::settingKey ( ) const

Get the current setting key used to save the advanced button check state.

See also
settingKey property

◆ settings()

QSettings* pqSearchBox::settings ( ) const

Convenience method to access the settings.

It should not be used to modify the advanced button state. Use setAdvancedSearchActive() instead.

◆ isAdvancedSearchEnabled()

bool pqSearchBox::isAdvancedSearchEnabled ( ) const

Return whether the advanced search button is visible/enabled.

See also
advancedSearchEnabled property

◆ advancedSearchActivated

void pqSearchBox::advancedSearchActivated ( bool  )
signal

Sent when the advanced button is toggled.

Note that no signal is sent when the configuration is None.

See also
advancedSearchActive property

◆ textChanged

void pqSearchBox::textChanged ( const QString &  )
signal

Sent whenever the search text is changed.

See also
text property, QLineEdit

◆ settingKeyChanged

void pqSearchBox::settingKeyChanged ( const QString &  )
signal

Sent whenever the setting key was changed.

See also
settingKey property

◆ setAdvancedSearchActive

void pqSearchBox::setAdvancedSearchActive ( bool  use)
slot

Toggle the advanced search button.

This is a no-op when the configuration is None.

See also
advancedSearchActive property

◆ setText

void pqSearchBox::setText ( const QString &  text)
slot

Set the search text.

See also
text property, QLineEdit

◆ setSettingKey

QString pqSearchBox::setSettingKey ( const QString &  key)
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.

See also
settingKey property

◆ setAdvancedSearchEnabled

void pqSearchBox::setAdvancedSearchEnabled ( bool  enable)
slot

Set whether the advanced button is visible/enabled.

See also
advancedSearchEnabled property

◆ keyPressEvent()

void pqSearchBox::keyPressEvent ( QKeyEvent *  e)
overrideprotected

◆ onAdvancedButtonClicked

void pqSearchBox::onAdvancedButtonClicked ( bool  )
protectedslot

◆ updateSettings

void pqSearchBox::updateSettings ( )
protectedslot

◆ updateFromSettings

void pqSearchBox::updateFromSettings ( )
protectedslot

Friends And Related Function Documentation

◆ pqInternals

friend class pqInternals
friend

Definition at line 181 of file pqSearchBox.h.

Property Documentation

◆ text

QString pqSearchBox::text
readwrite

The text property allow to access the text in the search box line edit.

Default is empty.

See also
QLineEdit

Definition at line 34 of file pqSearchBox.h.

◆ placeholderText

QString pqSearchBox::placeholderText
readwrite

The placeholderText property mirrors the line edit placeholderText property.

Default text is "Search... (use Esc to clear text)"

See also
QLineEdit

Definition at line 42 of file pqSearchBox.h.

◆ advancedSearchActive

bool pqSearchBox::advancedSearchActive
readwrite

The advancedSearchActive allows the user to access/control the advanced search button state depending on the current advancedSearchEnabled property.

See also
advancedSearchEnabled property

Definition at line 51 of file pqSearchBox.h.

◆ advancedSearchEnabled

bool pqSearchBox::advancedSearchEnabled
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.

◆ settingKey

QString pqSearchBox::settingKey
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:

  • When changing the setting key to a new valid (i.e. non-empty) key
  • When enabling the advanced button with a valid key already present. By default the setting key is empty, meaning that the advanced button state isn't saved in the settings;

Definition at line 72 of file pqSearchBox.h.


The documentation for this class was generated from the following file: