Home

QtMotifDialog Class Reference

The QtMotifDialog class provides the QDialog API for Motif-based dialogs. More...

 #include <QtMotifDialog>

Inherits QDialog.

Public Functions

Static Public Members

Protected Functions

Additional Inherited Members


Detailed Description

The QtMotifDialog class provides the QDialog API for Motif-based dialogs.

QtMotifDialog provides two separate modes of operation. Application programmers can use QtMotifDialog with an existing Motif-based dialog and a QWidget parent, or they can use QtMotifDialog with a custom Qt-based dialog and a Motif-based parent. Modality continues to work as expected.

Motif-based dialogs must have a Shell widget parent with a single child, due to requirements of the Motif toolkit. The Shell widget, which is a special subclass of XmDialogShell, is created during construction. It can be accessed using the shell() member function.

The single child of the Shell can be accessed using the dialog() member function after it has been created.

The acceptCallback() and rejectCallback() functions provide a convenient way to call QDialog::accept() and QDialog::reject() through callbacks. A pointer to the QtMotifDialog should be passed as the client_data argument to the callback.

The QtMotifDialog's API and behavior is identical to that of QDialog when using a custom Qt-based dialog with a Motif-based parent. The only difference is that a Motif-based parent argument is passed to the constructor, instead of a QWidget parent.


Member Function Documentation

QtMotifDialog::QtMotifDialog ( Widget parent, Qt::WFlags flags = 0 )

Constructs a QtMotifDialog with the given parent and window flags specified by flags that allows the application programmer to use the Motif-based parent for a custom QDialog.

This constructor creates a Shell widget, which is a special subclass of XmDialogShell. You can access the Shell widget with the shell() member function.

See also shell().

QtMotifDialog::QtMotifDialog ( QWidget * parent, Qt::WFlags flags = 0 )

Constructs a QtMotifDialog with the given parent and window flags specified by flags that allows the application programmer to use a QWidget parent for an existing Motif-based dialog.

This constructor creates a Shell widget, which is a special subclass of XmDialogShell. You can access the Shell widget with the shell() member functon.

Note that a dialog widget is not created, only the shell. Instead, you should create the dialog widget as a child of the QtMotifDialog. QtMotifDialog will take ownership of your custom dialog, and you can access it with the dialog() member function.

Warning: QtMotifDialog takes ownership of the child widget and destroys it during destruction. You should not destroy the dialog widget yourself.

See also shell() and dialog().

QtMotifDialog::QtMotifDialog ( const char * name, Widget parent, Qt::WFlags flags = 0 )

This is an overloaded function.

The created Shell widget is given the name name.

QtMotifDialog::QtMotifDialog ( const char * name, QWidget * parent, Qt::WFlags flags = 0 )

This is an overloaded function.

The created Shell widget is given the name name.

QtMotifDialog::~QtMotifDialog ()

Destroys the QDialog, dialog widget, and Shell widget.

void QtMotifDialog::acceptCallback ( Widget widget, XtPointer client_data, XtPointer ptr )   [static]

Convenient Xt/Motif callback to accept the QtMotifDialog.

The data is passed in client_data. The widget and ptr parameters are ignored.

Widget QtMotifDialog::dialog () const

Returns the Motif widget embedded in this dialog.

void QtMotifDialog::hideEvent ( QHideEvent * event )   [virtual protected]

This function is a reimplementation of QWidget::hideEvent(). The reimplemented function handles the given event by ensuring that the dialog widget is unmanaged and hidden.

Reimplemented from QWidget.

void QtMotifDialog::rejectCallback ( Widget widget, XtPointer client_data, XtPointer ptr )   [static]

Convenient Xt/Motif callback to reject the QtMotifDialog.

The data is passed in client_data. The widget and ptr parameters are ignored.

Widget QtMotifDialog::shell () const

Returns the Shell widget embedded in this dialog.

void QtMotifDialog::showEvent ( QShowEvent * event )   [virtual protected]

This function is a reimplementation of QWidget::showEvent(). The reimplemented function handles the given event by ensuring that the dialog widget is managed and hidden.

Reimplemented from QWidget.


Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies) Trademarks
Qt Solutions