Version: 9.12.0
QtxDialog Class Reference

Generic dialog box class. More...

#include <QtxDialog.h>

Inheritance diagram for QtxDialog:
Inheritance graph

Classes

class  Area
 Area containing dialog box buttons. More...
 
class  Border
 Special label used as border widget (separator between main frame and button frame). More...
 

Public Types

enum  PlacePolicy { Position , Expand , Uniform }
 Buttons alignment type. More...
 
enum  ButtonArea { TopArea , BottomArea , LeftArea , RightArea }
 Buttons area. More...
 
enum  ButtonPosition {
  Left , Right , Center , Top = Left ,
  Bottom = Right
}
 Button position. More...
 
enum  ButtonFlags {
  None = 0x00000000 , OK = 0x00000001 , Apply = 0x00000002 , Cancel = 0x00000004 ,
  Yes = 0x00000008 , No = 0x00000010 , Close = 0x00000020 , Help = 0x00000040 ,
  OKCancel = OK | Cancel , YesNo = Yes | No , Standard = OK | Cancel | Help , All = Standard | YesNo | Apply | Close
}
 Button ID flags. More...
 
enum  DialogFlags { Accept = 0x000001 , Reject = 0x000002 , AlignOnce = 0x000004 , SetFocus = 0x000008 }
 Dialog box flags. More...
 

Public Slots

void update ()
 Update dialog box. More...
 
virtual void setVisible (bool)
 Show/hide dialog box, set keyboard focus to the dialog. More...
 

Signals

void dlgButton (int)
 Emitted when the user button is clicked. More...
 
void dlgParamChanged ()
 This signal can be used in successor classes to signalize about some dialog parameter changing. More...
 
void dlgHelp ()
 Emitted when the "Help" button is clicked. More...
 
void dlgApply ()
 Emitted when the "Apply" button is clicked. More...
 
void dlgOk ()
 Emitted when the "OK" button is clicked. More...
 
void dlgNo ()
 Emitted when the "No" button is clicked. More...
 
void dlgYes ()
 Emitted when the "Yes" button is clicked. More...
 
void dlgClose ()
 Emitted when the "Close" button is clicked. More...
 
void dlgCancel ()
 Emitted when the "Cancel" button is clicked. More...
 

Public Member Functions

 QtxDialog (QWidget *=0, bool=false, bool=false, const int=Standard, Qt::WindowFlags=0)
 Constructor. More...
 
virtual ~QtxDialog ()
 Destructor. More...
 
void setDialogFlags (const int)
 Set specified dialog box flags. More...
 
void clearDialogFlags (const int)
 Clear specified the dialog flags. More...
 
bool testDialogFlags (const int) const
 Test specified dialog flags. More...
 
void setButtonFlags (const int)
 Add specified control button(s) to the dialog box. More...
 
void clearButtonFlags (const int)
 Remove specified control button(s) from the dialog box. More...
 
bool testButtonFlags (const int) const
 Test specified buttons. More...
 
int buttonPosition (const int) const
 Get specified control button position. More...
 
void setButtonPosition (const int, const int=-1)
 Set the specified control button(s) position. More...
 
void setPlacePosition (const int, const int)
 Set button position for all buttons in specified area. More...
 
int placePolicy (const int) const
 Get buttons layouting policy for the specified area. More...
 
void setPlacePolicy (const int, const int)
 set buttons layouting policy for the specified area. More...
 
void setButtonPlace (const int, const int)
 Move specified button(s) into specified area. More...
 
QString buttonText (const int)
 Get specified button's text. More...
 
void setButtonText (const int, const QString &text)
 Set specified button's text. More...
 
void setButtonFocus (const int)
 Sets the keyboard focus to the specified button. More...
 
bool hasButtonFocus (const int) const
 Check if specified button has keyboard focus. More...
 
bool isButtonEnabled (const int) const
 Get "enabled" status of the specified button(s). More...
 
void setButtonEnabled (const bool, const int)
 Enable/disable specified button(s). More...
 
bool isBorderEnabled (const int) const
 Check if border is enabled. More...
 
void setBorderEnabled (const bool, const int)
 Show/hide border for the specified button area. More...
 
void removeButton (const int)
 Remove user button. More...
 
int insertButton (const QString &, const int=BottomArea)
 Add user button to the dialog box. More...
 
QIntList userButtonIds () const
 Get all user button IDs. More...
 
QAbstractButtonuserButton (const int) const
 Get user button by the specified id. More...
 
uint setAlignment (uint align)
 Sets alignment policy. More...
 

Static Public Member Functions

static void setUnits (QLabel *, const QString &)
 Set measure units to the specified label. More...
 

Protected Types

typedef QMap< int, QAbstractButton * > ButtonMap
 button map More...
 

Protected Slots

virtual void accept ()
 Accept the dialog box. More...
 
virtual void reject ()
 Reject the dialog box. More...
 

Protected Member Functions

QFramemainFrame () const
 Get dialog box main frame widget. More...
 
virtual bool acceptData () const
 Check if data entered by the user is valid. More...
 
virtual bool rejectData () const
 Check if dialog box can be cancelled. More...
 
virtual QAbstractButtoncreateButton (QWidget *)
 Create new user button. More...
 
QAbstractButtonbutton (const int) const
 Get button by the specified ID. More...
 
ButtonMap buttons (const int=All) const
 Get buttons by the specified IDs. More...
 
int buttonId (const QAbstractButton *) const
 Get specified button's identifier. More...
 
int buttonPosition (QAbstractButton *) const
 Get position of specified button. More...
 
virtual void showEvent (QShowEvent *)
 Align this dialog according to the parent widget and alignment policy before the dialog box is shown. More...
 
virtual void hideEvent (QHideEvent *)
 Process all existing events when dialog box is hidden. More...
 
virtual void closeEvent (QCloseEvent *)
 Called when user closes dialog box. More...
 
virtual void childEvent (QChildEvent *)
 Update dialog box layout when the size grip is added. More...
 
virtual void keyPressEvent (QKeyEvent *)
 Process key pressing event. More...
 

Private Types

typedef QMap< int, Area * > AreaMap
 button area map More...
 
typedef QMap< int, int > PositionMap
 button position map More...
 

Private Slots

void onAccept ()
 This slot is called when user presses on of the buttons "OK", "Yes", etc. More...
 
void onReject ()
 This slot is called when user presses on of the buttons "Cancel", "No", "Close". More...
 
void onButton ()
 Process user button click event. More...
 
void onSizeGripDestroyed ()
 Update dialog box layout when the size grip is destroyed. More...
 
void onDestroyed (QObject *)
 Watch for the user button destroying. More...
 

Private Member Functions

void adjustButtons ()
 Adjust buttons (set equal size for all buttons). More...
 
void emitSignal ()
 Emit signal correspondingly to the control button. More...
 

Private Attributes

AreaMap myArea
 buttons areas map More...
 
ButtonMap myButton
 buttons map More...
 
PositionMap myPosition
 buttons position map More...
 
bool myInited
 dialog's "initialized" flag More...
 
const QObjectmySender
 signal sender More...
 
uint myAlignment
 dialog box alignment type More...
 
QFramemyMainFrame
 main frame More...
 
int myButtonFlags
 button flags More...
 
int myDialogFlags
 dialog flags More...
 

Friends

class Area
 

Detailed Description

Generic dialog box class.

Member Typedef Documentation

◆ AreaMap

typedef QMap<int, Area*> QtxDialog::AreaMap
private

button area map

◆ ButtonMap

typedef QMap<int, QAbstractButton*> QtxDialog::ButtonMap
protected

button map

◆ PositionMap

typedef QMap<int, int> QtxDialog::PositionMap
private

button position map

Member Enumeration Documentation

◆ ButtonArea

Buttons area.

Enumerator
TopArea 

horizontal area at the top side of the dialog box

BottomArea 

horizontal area at the bottom side of the dialog box

LeftArea 

vertical area at the left side of the dialog box

RightArea 

vertical area at the right side of the dialog box

◆ ButtonFlags

Button ID flags.

Enumerator
None 

no button used

OK 

OK button.

Apply 

Apply button.

Cancel 

Cancel button.

Yes 

Yes button.

No 

No button.

Close 

Close button.

Help 

Help button.

OKCancel 

OK & Cancel button.

YesNo 

Yes & No buttons.

Standard 

OK, Cancel & Help buttons.

All 

all buttons

◆ ButtonPosition

Button position.

Enumerator
Left 

set button left-most

Right 

set button right-most

Center 

place button in the center

Top 

set button top-most

Bottom 

set button bottom-most

◆ DialogFlags

Dialog box flags.

Enumerator
Accept 

allow dialog box accepting control

Reject 

allow dialog box rejecting control

AlignOnce 

align dialog box only when it is first time shown

SetFocus 

allow to set focus on dialog box when it is shown (user can use setFocusProxy() and specify own initial focus widget)

◆ PlacePolicy

Buttons alignment type.

Enumerator
Position 

buttons are placed according their position

Expand 

buttons occupy all available space

Uniform 

buttons are uniformly placed in the area

Constructor & Destructor Documentation

◆ QtxDialog()

QtxDialog::QtxDialog ( QWidget parent = 0,
bool  modal = false,
bool  allowResize = false,
const int  f = Standard,
Qt::WindowFlags  wf = 0 
)

Constructor.

Construct a dialog with specified parent and name. By default non-modal, non-resizable with the OK, Cancel and Help buttons dialog box is created.

Parameters
parentparent widget
modalif true dialog box is modal
allowResizeif true then dialog can be resized by user
fspecified control buttons for dialog box (QtxDialog::ButtonFlags)
wfdialog box flags (Qt::WindowFlags)

References All, Apply, Area, BottomArea, Cancel, Center, Close, dlgApply(), dlgHelp(), Help, Horizontal, Left, LeftArea, main(), myArea, myButton, myButtonFlags, myMainFrame, No, OK, onAccept(), onDestroyed(), onReject(), Right, RightArea, QtxDialog::Area::setBorderWidget(), setButtonPlace(), setButtonPosition(), TopArea, update(), Vertical, and Yes.

◆ ~QtxDialog()

QtxDialog::~QtxDialog ( )
virtual

Destructor.

Member Function Documentation

◆ accept

void QtxDialog::accept ( )
protectedvirtualslot

Accept the dialog box.

This method is used when any accept button is pressed (usually "OK", "Yes", etc).

If dialog flag QtxDialog::Accept is set, this function invokes acceptData() method, which should in this case return true to allow further processing.

If acceptData() returns false, this function just returns.

If acceptData() returns true, the Accepted result is set and signal according to the pressed control button is emitted. Then the default implementation of accept() method is called (which hides the dialog box and, depending on the dialog box flags, can close and destroy it).

See also
acceptData()

Reimplemented in Style_PrefDlg, and LightApp_PreferencesDlg.

References Accept, acceptData(), button(), Close, emitSignal(), mySender, OK, testButtonFlags(), testDialogFlags(), and Yes.

◆ acceptData()

bool QtxDialog::acceptData ( ) const
protectedvirtual

Check if data entered by the user is valid.

This method can be re-implemented in the successor class if it requires to check user input consistency. Default implementation returns true.

This method is called if dialog flag QtxDialog::Accept is set. If this method returns true, then dialog will be accepted and closed.

Returns
true if user input is valid
See also
accept()

Reimplemented in QtxPathDialog.

◆ adjustButtons()

void QtxDialog::adjustButtons ( )
private

Adjust buttons (set equal size for all buttons).

References myArea.

◆ button()

QAbstractButton * QtxDialog::button ( const int  f) const
protected

Get button by the specified ID.

Parameters
fcontrol button ID (QtxDialog::ButtonFlags)
Returns
button or 0 if id is invalid

References myButton.

◆ buttonId()

int QtxDialog::buttonId ( const QAbstractButton b) const
protected

Get specified button's identifier.

Parameters
bbutton
Returns
button ID

References myButton.

◆ buttonPosition() [1/2]

int QtxDialog::buttonPosition ( const int  id) const

Get specified control button position.

Parameters
idcontrol button ID (QtxDialog::ButtonFlags)
Returns
button's position (QtxDialog::ButtonPosition) or -1 if it is not set or invalid id is given
See also
setButtonPosition()

References myPosition.

◆ buttonPosition() [2/2]

int QtxDialog::buttonPosition ( QAbstractButton b) const
protected

Get position of specified button.

Parameters
bbutton
Returns
button position (QtxDialog::ButtonPosition)

References buttonId(), and buttonPosition().

◆ buttons()

QtxDialog::ButtonMap QtxDialog::buttons ( const int  f = All) const
protected

Get buttons by the specified IDs.

Parameters
fcontrol button(s) ID(s) (QtxDialog::ButtonFlags)
Returns
button map

References myButton.

◆ buttonText()

QString QtxDialog::buttonText ( const int  id)

Get specified button's text.

Parameters
idcontrol button ID (QtxDialog::ButtonFlags)
Returns
button's text
See also
setButtonText()

References button().

◆ childEvent()

void QtxDialog::childEvent ( QChildEvent *  e)
protectedvirtual

Update dialog box layout when the size grip is added.

Re-implemented from Qt.

Parameters
echild event

References onSizeGripDestroyed().

◆ clearButtonFlags()

void QtxDialog::clearButtonFlags ( const int  f)

Remove specified control button(s) from the dialog box.

Parameters
fORed buttons flags (Qtx::ButtonFlags)
See also
setButtonFlags(), testButtonFlags()

References myButtonFlags, and update().

◆ clearDialogFlags()

void QtxDialog::clearDialogFlags ( const int  f)

Clear specified the dialog flags.

Parameters
fdialog box flags (QtxDialog::DialogFlags)
See also
setDialogFlags(), testDialogFlags()

References myDialogFlags.

◆ closeEvent()

void QtxDialog::closeEvent ( QCloseEvent *  )
protectedvirtual

Called when user closes dialog box.

Call reject() method.

Parameters
eclose event (not used)

References reject().

◆ createButton()

QAbstractButton * QtxDialog::createButton ( QWidget parent)
protectedvirtual

Create new user button.

This method is invoked from method insertButton().

Parameters
parentparent widget
Returns
new user button

◆ dlgApply

void QtxDialog::dlgApply ( )
signal

Emitted when the "Apply" button is clicked.

◆ dlgButton

void QtxDialog::dlgButton ( int  id)
signal

Emitted when the user button is clicked.

Parameters
iduser button identificator

◆ dlgCancel

void QtxDialog::dlgCancel ( )
signal

Emitted when the "Cancel" button is clicked.

◆ dlgClose

void QtxDialog::dlgClose ( )
signal

Emitted when the "Close" button is clicked.

◆ dlgHelp

void QtxDialog::dlgHelp ( )
signal

Emitted when the "Help" button is clicked.

◆ dlgNo

void QtxDialog::dlgNo ( )
signal

Emitted when the "No" button is clicked.

◆ dlgOk

void QtxDialog::dlgOk ( )
signal

Emitted when the "OK" button is clicked.

◆ dlgParamChanged

void QtxDialog::dlgParamChanged ( )
signal

This signal can be used in successor classes to signalize about some dialog parameter changing.

◆ dlgYes

void QtxDialog::dlgYes ( )
signal

Emitted when the "Yes" button is clicked.

◆ emitSignal()

void QtxDialog::emitSignal ( )
private

Emit signal correspondingly to the control button.

References buttonId(), Cancel, Close, dlgCancel(), dlgClose(), dlgNo(), dlgOk(), dlgYes(), mySender, No, OK, and Yes.

◆ hasButtonFocus()

bool QtxDialog::hasButtonFocus ( const int  id) const

Check if specified button has keyboard focus.

Parameters
idcontrol button ID (QtxDialog::ButtonFlags)
Returns
true if specified button has keyboard focus
See also
setButtonFocus()

References button().

◆ hideEvent()

void QtxDialog::hideEvent ( QHideEvent *  e)
protectedvirtual

Process all existing events when dialog box is hidden.

Re-implemented from Qt.

Parameters
ehide event

◆ insertButton()

int QtxDialog::insertButton ( const QString &  text,
const int  area = BottomArea 
)

Add user button to the dialog box.

The button is inserted to the specified dialog box area. if the button is added successfully, the unique identificator of the added button is returned, otherwise -1 is returned.

Parameters
texttext of the added button
areabuttons area (QtxDialog::ButtonArea)
Returns
button ID
See also
removeButton(), userButton(), userButtonIds()

References createButton(), QtxDialog::Area::insertButton(), Left, myArea, myButton, myPosition, onButton(), onDestroyed(), and update().

◆ isBorderEnabled()

bool QtxDialog::isBorderEnabled ( const int  area) const

Check if border is enabled.

Parameters
areabuttons area (QtxDialog::ButtonArea)
Returns
true if border is enabled for specified button area.
See also
setBorderEnabled()

References myArea.

◆ isButtonEnabled()

bool QtxDialog::isButtonEnabled ( const int  id) const

Get "enabled" status of the specified button(s).

Parameters
idcontrol button(s) ID (QtxDialog::ButtonFlags)
Returns
true if all specified buttons are enabled.
See also
setButtonEnabled()

References buttons().

◆ keyPressEvent()

void QtxDialog::keyPressEvent ( QKeyEvent *  e)
protectedvirtual

Process key pressing event.

Re-implemented from Qt.

Call reject() if "Escape" key is pressed. Call accept() if "Ctrl+Enter" key-sequence is pressed. Process "F1" key and emit signal dlgHelp(). Transfer "Ctrl+(Shift+)Tab" key-sequence press event to the child Tab widget (if there is any).

Parameters
ekey press event

Reimplemented in VTKViewer_MarkerDlg.

References accept(), Apply, dlgApply(), dlgHelp(), Help, isButtonEnabled(), OK, reject(), testButtonFlags(), and Yes.

◆ mainFrame()

QFrame * QtxDialog::mainFrame ( ) const
protected

Get dialog box main frame widget.

Main frame is an internal widget which should contains all elements of dialog box except control buttons.

Returns
main frame widget

References myMainFrame.

◆ onAccept

void QtxDialog::onAccept ( )
privateslot

This slot is called when user presses on of the buttons "OK", "Yes", etc.

Call accept() method.

References accept(), and mySender.

◆ onButton

void QtxDialog::onButton ( )
privateslot

Process user button click event.

This method is called when user presses one of custom user buttons. Emits signal dlgButton(int) with identificator of the clicked user button passed as parameter.

References buttonId(), and dlgButton().

◆ onDestroyed

void QtxDialog::onDestroyed ( QObject obj)
privateslot

Watch for the user button destroying.

Parameters
objbutton being destroyed

References buttonId(), myArea, myButton, and myPosition.

◆ onReject

void QtxDialog::onReject ( )
privateslot

This slot is called when user presses on of the buttons "Cancel", "No", "Close".

Call reject() method.

References mySender, and reject().

◆ onSizeGripDestroyed

void QtxDialog::onSizeGripDestroyed ( )
privateslot

Update dialog box layout when the size grip is destroyed.

◆ placePolicy()

int QtxDialog::placePolicy ( const int  area) const

Get buttons layouting policy for the specified area.

Parameters
areabuttons area (QtxDialog::ButtonArea)
See also
setPlacePolicy()

References myArea.

◆ reject

void QtxDialog::reject ( )
protectedvirtualslot

Reject the dialog box.

This method is used when any reject button is pressed (usually "Close", "Cancel", "No", etc).

If dialog flag QtxDialog::Reject is set, this function invokes rejectData() method, which should in this case return true to allow further processing.

If rejectData() returns false, this function just returns.

If rejectData() returns true, the Rejected result is set and signal according to the pressed control button is emitted. Then the default implementation of reject() method is called (which hides the dialog box and, depending on the dialog box flags, can close and destroy it).

See also
rejectData()

Reimplemented in LightApp_PreferencesDlg.

References button(), Cancel, Close, emitSignal(), mySender, No, Reject, rejectData(), testButtonFlags(), and testDialogFlags().

◆ rejectData()

bool QtxDialog::rejectData ( ) const
protectedvirtual

Check if dialog box can be cancelled.

This method can be re-implemented in the successor class if it requires to check possibility to cancel dialog box safely. Default implementation returns true.

This method is called if dialog flag QtxDialog::Reject is set. If this method returns true, then dialog will be rejected and closed.

Returns
true if dialog box can be cancelled
See also
reject()

◆ removeButton()

void QtxDialog::removeButton ( const int  id)

Remove user button.

If id is -1, all user buttons are removed.

Parameters
iduser button ID
See also
insertButton(), userButton(), userButtonIds()

References myArea, myButton, myPosition, and update().

◆ setAlignment()

uint QtxDialog::setAlignment ( uint  align)

Sets alignment policy.

Use the function before the the dialog is first time shown. If dialog flag AlignOnce is set then alignment is performed only once, otherwise the dialog is aligned each time when it is shown. Dialog box is aligned relatively to its parent. By default, dialog box is aligned to the center of the parent widget (usually desktop or another dialog box).

Parameters
alignalignment flag(s) (Qtx::AlignmentFlags)
Returns
previous alignment policy

References myAlignment.

◆ setBorderEnabled()

void QtxDialog::setBorderEnabled ( const bool  on,
const int  area 
)

Show/hide border for the specified button area.

Border is a line which separate main frame and control buttons.

Parameters
areabuttons area (QtxDialog::ButtonArea)
onenable border flag
See also
isBorderEnabled()

References isBorderEnabled(), and myArea.

◆ setButtonEnabled()

void QtxDialog::setButtonEnabled ( const bool  on,
const int  id 
)

Enable/disable specified button(s).

Parameters
onenable button(s) flag
idcontrol button(s) ID (QtxDialog::ButtonFlags)
See also
isButtonEnabled()

References buttons().

◆ setButtonFlags()

void QtxDialog::setButtonFlags ( const int  f)

Add specified control button(s) to the dialog box.

Parameters
fORed buttons flags (Qtx::ButtonFlags)
See also
clearButtonFlags(), testButtonFlags()

References myButtonFlags, and update().

◆ setButtonFocus()

void QtxDialog::setButtonFocus ( const int  id)

Sets the keyboard focus to the specified button.

Parameters
idcontrol button ID (QtxDialog::ButtonFlags)
See also
hasButtonFocus()

References button().

◆ setButtonPlace()

void QtxDialog::setButtonPlace ( const int  area,
const int  id 
)

Move specified button(s) into specified area.

Parameters
areabuttons area (QtxDialog::ButtonArea)
idcontrol button(s) ID (QtxDialog::ButtonFlags)

References buttons(), QtxDialog::Area::insertButton(), myArea, and QtxDialog::Area::removeButton().

◆ setButtonPosition()

void QtxDialog::setButtonPosition ( const int  pos,
const int  id = -1 
)

Set the specified control button(s) position.

Parameters
idcontrol button(s) ID (QtxDialog::ButtonFlags)
posbutton(s) position (QtxDialog::ButtonPosition)

References button(), buttons(), myArea, and myPosition.

◆ setButtonText()

void QtxDialog::setButtonText ( const int  id,
const QString &  text 
)

Set specified button's text.

Parameters
idcontrol button ID (QtxDialog::ButtonFlags)
textbutton's text
See also
buttonText()

References adjustButtons(), and button().

◆ setDialogFlags()

void QtxDialog::setDialogFlags ( const int  f)

Set specified dialog box flags.

Parameters
fdialog box flags (QtxDialog::DialogFlags)
See also
clearDialogFlags(), testDialogFlags(), acceptData(), rejectData()

References myDialogFlags.

◆ setPlacePolicy()

void QtxDialog::setPlacePolicy ( const int  policy,
const int  area 
)

set buttons layouting policy for the specified area.

Parameters
policybuttons layouting policy (QtxDialog::PlacePolicy)
areabuttons area (QtxDialog::ButtonArea)
See also
placePolicy()

References myArea.

◆ setPlacePosition()

void QtxDialog::setPlacePosition ( const int  pos,
const int  area 
)

Set button position for all buttons in specified area.

Parameters
posbutton(s) position (QtxDialog::ButtonPosition)
areabuttons area (QtxDialog::ButtonArea)
See also
setButtonPosition()

References QtxDialog::Area::contains(), QtxDialog::Area::layoutButtons(), myArea, myButton, and myPosition.

◆ setUnits()

void QtxDialog::setUnits ( QLabel aLabel,
const QString &  aUnits 
)
static

Set measure units to the specified label.

In the dialog box label the measure units are closed in braces. If measure units do not exist they will be added.

For example:

// create label "Radius"
QLabel* aLabel = new QLabel( "Radius", mainFrame() );
// set measure units to "mm"
setUnits( aLabel, "mm" ) // => aLabel contains 'Radius (mm)'
// set measure units to "cm"
setUnits( aLabel, "cm" ) // => aLabel contains 'Radius (cm)'
// create label "Radius" with initially not set measure units
QLabel* aLabel = new QLabel( "Radius ():", mainFrame() );
// set measure units to "mm"
setUnits( aLabel, "mm" ) // => aLabel contains 'Radius (mm):'
// set measure units to "cm"
setUnits( aLabel, "cm" ) // => aLabel contains 'Radius (cm):'
QFrame * mainFrame() const
Get dialog box main frame widget.
Definition: QtxDialog.cxx:649
static void setUnits(QLabel *, const QString &)
Set measure units to the specified label.
Definition: QtxDialog.cxx:1100
Parameters
aLabellabel widget
aUnitsmeasure units

◆ setVisible

void QtxDialog::setVisible ( bool  on)
virtualslot

Show/hide dialog box, set keyboard focus to the dialog.

Re-implemented from Qt.

Parameters
onshow/hide flag

Reimplemented in LightApp_PreferencesDlg.

References myInited, SetFocus, and testDialogFlags().

◆ showEvent()

void QtxDialog::showEvent ( QShowEvent *  e)
protectedvirtual

Align this dialog according to the parent widget and alignment policy before the dialog box is shown.

Re-implemented from Qt.

Parameters
eshow event

References AlignOnce, Qtx::alignWidget(), myAlignment, myInited, and testDialogFlags().

◆ testButtonFlags()

bool QtxDialog::testButtonFlags ( const int  f) const

Test specified buttons.

Returns
true if specified control buttons are used in the dialog box
See also
setButtonFlags(), clearButtonFlags()

References myButtonFlags.

◆ testDialogFlags()

bool QtxDialog::testDialogFlags ( const int  f) const

Test specified dialog flags.

Returns
true if specified dialog box falgs are set
See also
setDialogFlags(), clearDialogFlags()

References myDialogFlags.

◆ update

void QtxDialog::update ( )
slot

Update dialog box.

References adjustButtons(), myArea, myButton, and testButtonFlags().

◆ userButton()

QAbstractButton * QtxDialog::userButton ( const int  id) const

Get user button by the specified id.

Parameters
iduser button ID
Returns
user button or 0 if it is not found
See also
insertButton(), removeButton(), userButtonIds()

References myButton.

◆ userButtonIds()

QIntList QtxDialog::userButtonIds ( ) const

Get all user button IDs.

Returns
list of user buttons identificators
See also
insertButton(), removeButton(), userButton()

References myButton.

Friends And Related Function Documentation

◆ Area

friend class Area
friend

Member Data Documentation

◆ myAlignment

uint QtxDialog::myAlignment
private

dialog box alignment type

◆ myArea

AreaMap QtxDialog::myArea
private

buttons areas map

◆ myButton

ButtonMap QtxDialog::myButton
private

buttons map

◆ myButtonFlags

int QtxDialog::myButtonFlags
private

button flags

◆ myDialogFlags

int QtxDialog::myDialogFlags
private

dialog flags

◆ myInited

bool QtxDialog::myInited
private

dialog's "initialized" flag

◆ myMainFrame

QFrame* QtxDialog::myMainFrame
private

main frame

◆ myPosition

PositionMap QtxDialog::myPosition
private

buttons position map

◆ mySender

const QObject* QtxDialog::mySender
private

signal sender


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