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

pqExpanderButton provides a frame with a toggle mode. More...

#include <pqExpanderButton.h>

Inherits QFrame.

Public Types

enum  HeadingLevel { H1 = 0, H2 }
 This enum specifies the level of the button in a hierarchy of expanders, similar to heading levels in a document. More...
 

Public Slots

void toggle ()
 Toggles the state of the checkable button. More...
 
void setChecked (bool)
 This property holds whether the button is checked (minus, collapse) which means the content is shown. More...
 
bool checked () const
 
void setText (const QString &text)
 This property holds the text shown on the button. More...
 
QString text () const
 
void setHeadingLevel (HeadingLevel level)
 This property holds the heading level of the button, which determines its look. More...
 
HeadingLevel headingLevel () const
 

Signals

void toggled (bool checked)
 This signal is emitted whenever a button changes its state. More...
 

Public Member Functions

 pqExpanderButton (QWidget *parent=nullptr)
 
 ~pqExpanderButton () override
 

Protected Member Functions

void mousePressEvent (QMouseEvent *evt) override
 
void mouseReleaseEvent (QMouseEvent *evt) override
 

Properties

QString text
 
bool checked
 
HeadingLevel headingLevel
 

Detailed Description

pqExpanderButton provides a frame with a toggle mode.

This can be used to simulate a toggle button used to expand frames in an accordion style, for example.

Definition at line 15 of file pqExpanderButton.h.

Member Enumeration Documentation

◆ HeadingLevel

This enum specifies the level of the button in a hierarchy of expanders, similar to heading levels in a document.

H1 (the default) is for top level sections such as Properties/Display/View (plus/minus icons, border), H2 is for nested groups such as property groups (subtler arrow icons, no border).

Enumerator
H1 
H2 

Definition at line 35 of file pqExpanderButton.h.

Constructor & Destructor Documentation

◆ pqExpanderButton()

pqExpanderButton::pqExpanderButton ( QWidget *  parent = nullptr)

◆ ~pqExpanderButton()

pqExpanderButton::~pqExpanderButton ( )
override

Member Function Documentation

◆ toggle

void pqExpanderButton::toggle ( )
slot

Toggles the state of the checkable button.

◆ setChecked

void pqExpanderButton::setChecked ( bool  )
slot

This property holds whether the button is checked (minus, collapse) which means the content is shown.

By default, the button is unchecked (plus, expand) which means the content is not shown.

◆ checked

bool pqExpanderButton::checked ( ) const
inlineslot

Definition at line 54 of file pqExpanderButton.h.

◆ setText

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

This property holds the text shown on the button.

◆ text

QString pqExpanderButton::text ( ) const
slot

◆ setHeadingLevel

void pqExpanderButton::setHeadingLevel ( HeadingLevel  level)
slot

This property holds the heading level of the button, which determines its look.

By default, the heading level is H1.

◆ headingLevel

HeadingLevel pqExpanderButton::headingLevel ( ) const
inlineslot

Definition at line 67 of file pqExpanderButton.h.

◆ toggled

void pqExpanderButton::toggled ( bool  checked)
signal

This signal is emitted whenever a button changes its state.

checked is true if the button is checked, or false if the button is unchecked.

◆ mousePressEvent()

void pqExpanderButton::mousePressEvent ( QMouseEvent *  evt)
overrideprotected

◆ mouseReleaseEvent()

void pqExpanderButton::mouseReleaseEvent ( QMouseEvent *  evt)
overrideprotected

Property Documentation

◆ text

QString pqExpanderButton::text
readwrite

Definition at line 20 of file pqExpanderButton.h.

◆ checked

bool pqExpanderButton::checked
readwrite

Definition at line 21 of file pqExpanderButton.h.

◆ headingLevel

HeadingLevel pqExpanderButton::headingLevel
readwrite

Definition at line 22 of file pqExpanderButton.h.


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