libyui-qt
 
Loading...
Searching...
No Matches
YQDialog Class Reference
Inheritance diagram for YQDialog:
Collaboration diagram for YQDialog:

Public Member Functions

 YQDialog (YDialogType dialogType, YDialogColorMode colorMode=YDialogNormalColor)
 
void closeEvent (QCloseEvent *ev)
 
virtual void setEnabled (bool enabled)
 
virtual int preferredWidth ()
 
virtual int preferredHeight ()
 
virtual void setSize (int newWidth, int newHeight)
 
YQGenericButtonfindDefaultButton ()
 
bool userResized ()
 
YQGenericButtonfocusButton () const
 
YQGenericButtondefaultButton () const
 
void losingFocus (YQGenericButton *button)
 
void gettingFocus (YQGenericButton *button)
 
void setDefaultButton (YPushButton *newDefaultButton)
 
void ensureOnlyOneDefaultButton ()
 
bool activateDefaultButton (bool warn=true)
 
YQWizardfindWizard () const
 
YQGenericButtonwizardDefaultButton (YQWizard *wizard) const
 
virtual void highlight (YWidget *child)
 
QEventLoop * eventLoop ()
 

Static Public Member Functions

static void center (QWidget *dialog, QWidget *parent=0)
 
static QWidget * popupParent ()
 

Protected Slots

void waitForEventTimeout ()
 

Protected Member Functions

virtual ~YQDialog ()
 
void toggleAlternateStyleSheet ()
 
YQGenericButtonfindDefaultButton (YWidgetListConstIterator begin, YWidgetListConstIterator end) const
 
YQWizardfindWizard (YWidgetListConstIterator begin, YWidgetListConstIterator end) const
 
YQWizardensureOnlyOneDefaultButton (YWidgetListConstIterator begin, YWidgetListConstIterator end)
 
virtual void openInternal ()
 
virtual YEvent * waitForEventInternal (int timeout_millisec)
 
virtual YEvent * pollEventInternal ()
 
virtual void activate ()
 
virtual void keyPressEvent (QKeyEvent *event)
 
virtual void focusInEvent (QFocusEvent *event)
 
virtual void resizeEvent (QResizeEvent *event)
 

Static Protected Member Functions

static QWidget * chooseParent (YDialogType dialogType)
 

Protected Attributes

bool _userResized
 
QSize _userSize
 
YQGenericButton_focusButton
 
YQGenericButton_defaultButton
 
QTimer * _waitForEventTimer
 
QEventLoop * _eventLoop
 
YWidget * _highlightedChild
 
QPalette _preHighlightPalette
 
bool _preHighlightAutoFill
 
QY2StyleEditor_styleEditor
 

Constructor & Destructor Documentation

◆ YQDialog()

YQDialog::YQDialog ( YDialogType dialogType,
YDialogColorMode colorMode = YDialogNormalColor )

Constructor.

'dialogType' is one of YMainDialog, YWizardDialog, or YPopupDialog.

The Qt UI supports YWizardDialogs. They are handled very much like YMainDialogs, except for wizard dialogs that are opened over a wizard with a steps panel on the left side, in which case that new wizard dialog will be resized and moved so the steps panel from the wizard below will remain visible.

'colorMode' can be set to YDialogWarnColor to use very bright "warning" colors or YDialogInfoColor to use more prominent, yet not quite as bright as "warning" colors. Use both only very rarely.

◆ ~YQDialog()

YQDialog::~YQDialog ( )
protectedvirtual

Destructor. Don't delete a dialog directly, use YDialog::deleteTopmostDialog().

Member Function Documentation

◆ activate()

void YQDialog::activate ( )
protectedvirtual

Activate this dialog: Make sure that it is shown as the topmost dialog of this application and that it can receive input.

Implemented from YDialog.

◆ activateDefaultButton()

bool YQDialog::activateDefaultButton ( bool warn = true)

Activate (i.e. click) this dialog's default button, if there is any. Issue a warning to the log file if 'warn' is true.

◆ center()

void YQDialog::center ( QWidget * dialog,
QWidget * parent = 0 )
static

Center a dialog relative to 'parent'.

If 'parent' is 0, the dialog is centered relative to the application's main widget. If 'dialog' is the main widget and 'parent' is 0, the dialog is centered relative to the desktop.

◆ chooseParent()

QWidget * YQDialog::chooseParent ( YDialogType dialogType)
staticprotected

Choose a parent widget for a dialog of the specified type: Either the main window dock (if this is a YMainDialog and the dock currently accepts child dialogs) or 0.

◆ closeEvent()

void YQDialog::closeEvent ( QCloseEvent * ev)

Interited from QDialog: The window was closed via the window manager close button.

◆ defaultButton()

YQGenericButton * YQDialog::defaultButton ( ) const
inline

Returns the dialog's default button - the button that is activated with [Return] if no button has the keyboard focus.

◆ ensureOnlyOneDefaultButton() [1/2]

void YQDialog::ensureOnlyOneDefaultButton ( )

Ensure presence of no more than one single default button.

◆ ensureOnlyOneDefaultButton() [2/2]

YQWizard * YQDialog::ensureOnlyOneDefaultButton ( YWidgetListConstIterator begin,
YWidgetListConstIterator end )
protected

Helper function for ensureOnlyOneDefaultButton(): Recursively find all normal and wizard buttons between 'begin' and 'end' and make sure that no more than one button is marked as default. Return (the first) wizard widget found on the way.

◆ eventLoop()

QEventLoop * YQDialog::eventLoop ( )
inline

Access to this dialog's event loop.

◆ findDefaultButton() [1/2]

YQGenericButton * YQDialog::findDefaultButton ( )

Return this dialog's (first) default button or 0 if none

◆ findDefaultButton() [2/2]

YQGenericButton * YQDialog::findDefaultButton ( YWidgetListConstIterator begin,
YWidgetListConstIterator end ) const
protected

Return the (first) default button between 'begin' and 'end' or 0 if there is none.

◆ findWizard() [1/2]

YQWizard * YQDialog::findWizard ( ) const

Find the first wizard in that dialog, if there is any. Returns 0 if there is none.

◆ findWizard() [2/2]

YQWizard * YQDialog::findWizard ( YWidgetListConstIterator begin,
YWidgetListConstIterator end ) const
protected

Return the (first) wizard widget between 'begin' and 'end' or 0 if there is none.

◆ focusButton()

YQGenericButton * YQDialog::focusButton ( ) const
inline

Returns the button that has the keyboard focus or 0 if no button has the keyboard focus.

◆ gettingFocus()

void YQDialog::gettingFocus ( YQGenericButton * button)

Notification that a button gets the keyboard focus.

All pushbuttons are required to call this whenever they gain focus so the dialog can keep track of its focusButton.

◆ highlight()

void YQDialog::highlight ( YWidget * child)
virtual

Highlight a child widget of this dialog. This is meant for debugging: YDialogSpy and similar uses.

No more than one widget can be highlighted at any one time in the same dialog. Highlighting another widget un-highlights a previously highlighted widget. 0 means 'unhighlight the last highlighted widget, but don't highlight any other'.

Implemented from YDialog.

◆ keyPressEvent()

void YQDialog::keyPressEvent ( QKeyEvent * event)
protectedvirtual

Qt event handlers.

All reimplemented from QWidget.

◆ losingFocus()

void YQDialog::losingFocus ( YQGenericButton * button)

Notification that a button loses the keyboard focus.

All pushbuttons are required to call this whenever they lose focus so the dialog can keep track of its focusButton.

◆ openInternal()

void YQDialog::openInternal ( )
protectedvirtual

Internal open() method, called exactly once during the life time of the dialog in open().

Implemented from YDialog.

◆ pollEventInternal()

YEvent * YQDialog::pollEventInternal ( )
protectedvirtual

Check if a user event is pending. If there is one, return it. If there is none, do not wait for one - return 0.

Implemented from YDialog.

◆ popupParent()

QWidget * YQDialog::popupParent ( )
static

Return a suitable parent QWidget for a Qt pop-up dialog to maintain the correct window stacking order (so the pop-up does not appear behind an existing window). If there is none, this returns 0 which is also a suitable parent.

◆ preferredHeight()

int YQDialog::preferredHeight ( )
virtual

Preferred height of the widget.

Reimplemented from YWidget.

◆ preferredWidth()

int YQDialog::preferredWidth ( )
virtual

Preferred width of the widget.

Reimplemented from YWidget.

◆ setDefaultButton()

void YQDialog::setDefaultButton ( YPushButton * newDefaultButton)

Set the dialog's default button - the button that is activated with [Return] if no other button has the keyboard focus. 'newDefaultButton' may be 0 if the former default button is destroyed.

◆ setEnabled()

void YQDialog::setEnabled ( bool enabled)
virtual

Set enabled/disabled state.

Reimplemented from YWidget.

◆ setSize()

void YQDialog::setSize ( int newWidth,
int newHeight )
virtual

Set the new size of the widget.

Reimplemented from YWidget.

◆ toggleAlternateStyleSheet()

void YQDialog::toggleAlternateStyleSheet ( )
protected

Switch between the normal widget theme (QSS style sheet) and the vision impaired theme with very bright colors.

◆ userResized()

bool YQDialog::userResized ( )
inline

Return 'true' if the user resized this dialog.

◆ waitForEventInternal()

YEvent * YQDialog::waitForEventInternal ( int timeout_millisec)
protectedvirtual

Wait for a user event.

Implemented from YDialog.

◆ waitForEventTimeout

void YQDialog::waitForEventTimeout ( )
protectedslot

Timeout during waitForEvent()

◆ wizardDefaultButton()

YQGenericButton * YQDialog::wizardDefaultButton ( YQWizard * wizard) const

Find a wizard button that would make sense as a default button. Return 0 if none can be found.


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