libyui-qt  2.42.4
 All Classes Functions Variables
YQDialog Class Reference
Inheritance 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)
 

Protected Slots

void waitForEventTimeout ()
 

Protected Member Functions

virtual ~YQDialog ()
 
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
 

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.

YQDialog::~YQDialog ( )
protectedvirtual

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

Definition at line 123 of file YQDialog.cc.

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 178 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 529 of file YQDialog.cc.

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 831 of file YQDialog.cc.

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.

Definition at line 145 of file YQDialog.cc.

void YQDialog::closeEvent ( QCloseEvent *  ev)

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

Definition at line 714 of file YQDialog.cc.

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.

Definition at line 128 of file YQDialog.h.

void YQDialog::ensureOnlyOneDefaultButton ( )

Ensure presence of no more than one single default button.

Definition at line 395 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 344 of file YQDialog.cc.

QEventLoop* YQDialog::eventLoop ( )
inline

Access to this dialog's event loop.

Definition at line 201 of file YQDialog.h.

YQGenericButton * YQDialog::findDefaultButton ( )

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

Definition at line 292 of file YQDialog.cc.

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

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

Definition at line 307 of file YQDialog.cc.

YQWizard * YQDialog::findWizard ( ) const

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

Definition at line 420 of file YQDialog.cc.

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

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

Definition at line 427 of file YQDialog.cc.

YQGenericButton* YQDialog::focusButton ( ) const
inline

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

Definition at line 122 of file YQDialog.h.

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 584 of file YQDialog.cc.

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 847 of file YQDialog.cc.

void YQDialog::keyPressEvent ( QKeyEvent *  event)
protectedvirtual

Qt event handlers.

All reimplemented from QWidget.

Definition at line 600 of file YQDialog.cc.

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 568 of file YQDialog.cc.

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 168 of file YQDialog.cc.

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 799 of file YQDialog.cc.

int YQDialog::preferredHeight ( )
virtual

Preferred height of the widget.

Reimplemented from YWidget.

Definition at line 217 of file YQDialog.cc.

int YQDialog::preferredWidth ( )
virtual

Preferred width of the widget.

Reimplemented from YWidget.

Definition at line 186 of file YQDialog.cc.

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 489 of file YQDialog.cc.

void YQDialog::setEnabled ( bool  enabled)
virtual

Set enabled/disabled state.

Reimplemented from YWidget.

Definition at line 248 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 256 of file YQDialog.cc.

bool YQDialog::userResized ( )
inline

Return 'true' if the user resized this dialog.

Definition at line 116 of file YQDialog.h.

YEvent * YQDialog::waitForEventInternal ( int  timeout_millisec)
protectedvirtual

Wait for a user event.

Implemented from YDialog.

Definition at line 749 of file YQDialog.cc.

void YQDialog::waitForEventTimeout ( )
protectedslot

Timeout during waitForEvent()

Definition at line 819 of file YQDialog.cc.

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 452 of file YQDialog.cc.


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