QMotifDialog(3qt)

NAME
QMotifDialog - The QDialog API for Motif dialogs

SYNOPSIS
This class is part of the Qt Motif Extension.

#include <qmotifdialog.h>

Inherits QDialog.

  Public Members
enum DialogType { Prompt, Selection, Command, FileSelection, Template, Error, Information, Message, Question, Warning, Working }
QMotifDialog ( DialogType dtype, Widget parent = NULL, ArgList args = NULL, Cardinal argcount = 0, const char * name = 0, bool modal = FALSE, WFlags flags = 0 )
QMotifDialog ( Widget parent = NULL, ArgList args = NULL, Cardinal argcount = 0, const char * name = 0, bool modal = FALSE, WFlags flags = 0 )
virtual ~QMotifDialog ()
Widget shell () const
Widget dialog () const

  Static Public Members
void acceptCallback ( Widget, XtPointer client_data, XtPointer )
void rejectCallback ( Widget, XtPointer client_data, XtPointer )

DESCRIPTION
This class is defined in the Qt Motif Extension, which can be found in the qt/extensions directory. It is not included in the main Qt API.

The QMotifDialog class provides the QDialog API for Motif dialogs.

QMotifDialog provides the QDialog API for Motif dialogs. Applications moving to Qt will need to not only rewrite Motif dialogs in Qt, they will also need tom move to the Qt modailty semantics. QMotifDialog ensures that modal Motif dialogs continue to work when used in a Qt application.

For the purpose of the QMotif extension, Motif has 2 types of dialogs: predefined dialogs and custom dialogs. The predefined Motif dialogs are:

Prompt

Selection

Command

FileSelection

Template

Error

Information

Message

Question

Warning

Working

QMotifDialog provides a constructor for the predefined Motif dialog types, which creates a dialog shell and the dialog widget itself.

Example usage QMotifDialog to create a predefined Motif dialog:

    ...
    XmString message = XmStringCreateLocalized( "This is a Message dialog.",
                                                XmSTRING_DEFAULT_CHARSET );
    Arg args[1];
    XtSetArg( args[0], XmNmessageString, message );
    // parent is an ApplicationShell created earlier in the application
    QMotifDialog dailog( QMotifDialog::Message, parent, args, 1,
                         "motif message dialog", TRUE );
    XtAddCallback( dialog.dialog(), XmNokCallback,
                   (XtCallbackProc) QMotifDialog::acceptCallback, &dialog );
    XtAddCallback( dialog.dialog(), XmNcancelCallback,
                   (XtCallbackProc) QMotifDialog::rejectCallback, &dialog );
    dialog.exec();
    XmStringFree( message );
    ...

QMotifDialog also provides a constructor for custom Motif dialogs, which creates only the dialog shell. The application programmer can create a custom dialog using the QMotifDialog shell as the parent.

QMotifDialog can be used with either an Xt/Motif or a QWidget parent.

  Member Type Documentation

QMotifDialog::DialogType
This enum covers the predefined Motif dialog types.

QMotifDialog::Prompt

QMotifDialog::Selection

QMotifDialog::Command

QMotifDialog::FileSelection

QMotifDialog::Template

QMotifDialog::Error

QMotifDialog::Information

QMotifDialog::Message

QMotifDialog::Question

QMotifDialog::Warning

QMotifDialog::Working

MEMBER FUNCTION DOCUMENTATION

QMotifDialog::QMotifDialog ( DialogType dtype, Widget parent = NULL, ArgList args = NULL, Cardinal argcount = 0, const char * name = 0, bool modal = FALSE, WFlags flags = 0 )
Creates a predefined Motif dialog of type dtype with a Motif widget parent.

The arguments are passed in args, and the number of arguments in argcount. The name, modal and flags arguments are passed on to the QDialog constructor.

Creates a Shell widget which is a special subclass of XmDialogShell. This allows applications to use the QDialog API with existing Motif dialogs. This allows appilications to have proper modality handling through the QMotif extension. You can access the Shell widget with the shell() member function.

Creates a dialog widget with the Shell widget as it's parent. The type of the dialog created is specified by the dtype argument. See the DialogType enum for a list of available dialog types. You can access the dialog widget with the dialog() member function.

Warning: When QMotifDialog is destroyed, the Shell widget and the dialog widget are destroyed. You should not destroy the dialog widget yourself.

QMotifDialog::QMotifDialog ( Widget parent = NULL, ArgList args = NULL, Cardinal argcount = 0, const char * name = 0, bool modal = FALSE, WFlags flags = 0 )
Creates a QMotifDialog for use in a custom Motif dialog.

The dialog's parent is parent. The arguments are passed in args and the number of arguments in argcount. The name, modal and flags arguments are passed on to the QDialog constructor.

Creates a Shell widget which is a special subclass of XmDialogShell. This allows applications to use the QDialog API with existing Motif dialogs. This allows appilications to have proper modality handling through the QMotif extension. You can access the Shell widget with the shell() member function.

A dialog widget is not created by this constructor. Instead, you should create the dialog widget as a child of this dialog. Once you do this, QMotifDialog will take over ownership of your custom dialog, and you can access it with the dialog() member function.

Warning: When QMotifDialog is destroyed, the Shell widget and the dialog widget are destroyed. You should not destroy the dialog widget yourself.

QMotifDialog::~QMotifDialog () [virtual]
Destroys the QDialog, dialog widget and shell widget.

void QMotifDialog::acceptCallback ( Widget, XtPointer client_data, XtPointer ) [static]
Convenient Xt/Motif callback to accept the QMotifDialog.

The widget is passed in widget and the data in client_data.

Widget QMotifDialog::dialog () const
Returns the Motif widget embedded in this dialog.

Example: dialog/mainwindow.cpp.

void QMotifDialog::rejectCallback ( Widget, XtPointer client_data, XtPointer ) [static]
Convenient Xt/Motif callback to reject the QMotifDialog.

The widget is passed in widget and the data in client_data.

Widget QMotifDialog::shell () const
Returns the Shell widget embedded in this dialog.

Example: dialog/mainwindow.cpp.

SEE ALSO
http://doc.trolltech.com/qmotifdialog.html http://www.trolltech.com/faq/tech.html

COPYRIGHT
Copyright 1992-2001 Trolltech AS, http://www.trolltech.com. See the license file included in the distribution for a complete license statement.

AUTHOR
Generated automatically from the source code.

BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you.

The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech.

If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qmotifdialog.3qt) and the Qt version (3.1.0-b1).