libyui-qt  2.47.1.1
YQDialog Class Reference
Inheritance diagram for YQDialog:
Collaboration diagram for YQDialog:

Public Member Functions

 YQDialog (YDialogType dialogType, YDialogColorMode colorMode=YDialogNormalColor)
 Constructor. More...
 
void closeEvent (QCloseEvent *ev)
 Interited from QDialog: The window was closed via the window manager close button.
 
virtual void setEnabled (bool enabled)
 Set enabled/disabled state. More...
 
virtual int preferredWidth ()
 Preferred width of the widget. More...
 
virtual int preferredHeight ()
 Preferred height of the widget. More...
 
virtual void setSize (int newWidth, int newHeight)
 Set the new size of the widget. More...
 
YQGenericButtonfindDefaultButton ()
 Return this dialog's (first) default button or 0 if none.
 
bool userResized ()
 Return 'true' if the user resized this dialog.
 
YQGenericButtonfocusButton () const
 Returns the button that has the keyboard focus or 0 if no button has the keyboard focus.
 
YQGenericButtondefaultButton () const
 Returns the dialog's default button - the button that is activated with [Return] if no button has the keyboard focus.
 
void losingFocus (YQGenericButton *button)
 Notification that a button loses the keyboard focus. More...
 
void gettingFocus (YQGenericButton *button)
 Notification that a button gets the keyboard focus. More...
 
void setDefaultButton (YPushButton *newDefaultButton)
 Set the dialog's default button - the button that is activated with [Return] if no other button has the keyboard focus. More...
 
void ensureOnlyOneDefaultButton ()
 Ensure presence of no more than one single default button.
 
bool activateDefaultButton (bool warn=true)
 Activate (i.e. More...
 
YQWizardfindWizard () const
 Find the first wizard in that dialog, if there is any. More...
 
YQGenericButtonwizardDefaultButton (YQWizard *wizard) const
 Find a wizard button that would make sense as a default button. More...
 
virtual void highlight (YWidget *child)
 Highlight a child widget of this dialog. More...
 
QEventLoop * eventLoop ()
 Access to this dialog's event loop.
 

Static Public Member Functions

static void center (QWidget *dialog, QWidget *parent=0)
 Center a dialog relative to 'parent'. More...
 

Protected Slots

void waitForEventTimeout ()
 Timeout during waitForEvent()
 

Protected Member Functions

virtual ~YQDialog ()
 Destructor. More...
 
YQGenericButtonfindDefaultButton (YWidgetListConstIterator begin, YWidgetListConstIterator end) const
 Return the (first) default button between 'begin' and 'end' or 0 if there is none.
 
YQWizardfindWizard (YWidgetListConstIterator begin, YWidgetListConstIterator end) const
 Return the (first) wizard widget between 'begin' and 'end' or 0 if there is none.
 
YQWizardensureOnlyOneDefaultButton (YWidgetListConstIterator begin, YWidgetListConstIterator end)
 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. More...
 
virtual void openInternal ()
 Internal open() method, called exactly once during the life time of the dialog in open(). More...
 
virtual YEvent * waitForEventInternal (int timeout_millisec)
 Wait for a user event. More...
 
virtual YEvent * pollEventInternal ()
 Check if a user event is pending. More...
 
virtual void activate ()
 Activate this dialog: Make sure that it is shown as the topmost dialog of this application and that it can receive input. More...
 
virtual void keyPressEvent (QKeyEvent *event)
 Qt event handlers. More...
 
virtual void focusInEvent (QFocusEvent *event)
 
virtual void resizeEvent (QResizeEvent *event)
 

Static Protected Member Functions

static QWidget * chooseParent (YDialogType dialogType)
 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.
 

Protected Attributes

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

Detailed Description

Definition at line 42 of file YQDialog.h.

Constructor & Destructor Documentation

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.

Definition at line 60 of file YQDialog.cc.

Here is the call graph for this function:

YQDialog::~YQDialog ( )
protectedvirtual

Destructor.

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

Definition at line 126 of file YQDialog.cc.

Here is the call graph for this function:

Member Function Documentation

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.

Definition at line 184 of file YQDialog.cc.

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.

Definition at line 535 of file YQDialog.cc.

Here is the call graph for this function:

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.

Definition at line 839 of file YQDialog.cc.

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.

Definition at line 350 of file YQDialog.cc.

Here is the call graph for this function:

YQWizard * YQDialog::findWizard ( ) const

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

Returns 0 if there is none.

Definition at line 426 of file YQDialog.cc.

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.

Definition at line 590 of file YQDialog.cc.

Here is the call graph for this function:

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.

Definition at line 855 of file YQDialog.cc.

void YQDialog::keyPressEvent ( QKeyEvent *  event)
protectedvirtual

Qt event handlers.

All reimplemented from QWidget.

Definition at line 606 of file YQDialog.cc.

Here is the call graph for this function:

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.

Definition at line 574 of file YQDialog.cc.

Here is the call graph for this function:

void YQDialog::openInternal ( )
protectedvirtual

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

Implemented from YDialog.

Definition at line 174 of file YQDialog.cc.

Here is the call graph for this function:

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.

Definition at line 805 of file YQDialog.cc.

Here is the call graph for this function:

int YQDialog::preferredHeight ( )
virtual

Preferred height of the widget.

Reimplemented from YWidget.

Definition at line 223 of file YQDialog.cc.

Here is the call graph for this function:

int YQDialog::preferredWidth ( )
virtual

Preferred width of the widget.

Reimplemented from YWidget.

Definition at line 192 of file YQDialog.cc.

Here is the call graph for this function:

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.

Definition at line 495 of file YQDialog.cc.

Here is the call graph for this function:

void YQDialog::setEnabled ( bool  enabled)
virtual

Set enabled/disabled state.

Reimplemented from YWidget.

Definition at line 254 of file YQDialog.cc.

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

Set the new size of the widget.

Reimplemented from YWidget.

Definition at line 262 of file YQDialog.cc.

YEvent * YQDialog::waitForEventInternal ( int  timeout_millisec)
protectedvirtual

Wait for a user event.

Implemented from YDialog.

Definition at line 755 of file YQDialog.cc.

Here is the call graph for this function:

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.

Definition at line 458 of file YQDialog.cc.

Here is the call graph for this function:


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