Qt:Документация 4.3.2/qmessagebox-qt3

Материал из Wiki.crossplatform.ru

Перейти к: навигация, поиск
40px Внимание: Актуальная версия перевода документации находится здесь

__NOTOC__

Image:qt-logo.png

Главная · Все классы · Основные классы · Классы по группам · Модули · Функции

Image:trolltech-logo.png

Содержание

[править] Qt 3 Support Members for QMessageBox

Описанные ниже члены класса являются частью слоя поддержки Qt 3. Они введены для поддержки старого кода в Qt 4. Мы советуем не использовать их во вновь создаваемом коде.



[править] Открытые функции

  • QMessageBox ( const QString & title, const QString & text, Icon icon, int button0, int button1, int button2, QWidget * parent, const char * name, bool modal, Qt::WindowFlags f = Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint )
  • QMessageBox ( QWidget * parent, const char * name )
  • 60 открытых функций, унаследованных от QWidget
  • 8 открытых функций, унаследованных от QObject
  • 8 открытых функций, унаследованных от QPaintDevice

[править] Статические открытые члены

  • int message ( const QString & title, const QString & text, const QString & buttonText = QString(), QWidget * parent = 0, const char * name = 0 )
  • bool query ( const QString & caption, const QString & text, const QString & yesButtonText = QString(), const QString & noButtonText = QString(), QWidget * parent = 0, const char * name = 0 )
  • QPixmap standardIcon ( Icon icon, Qt::GUIStyle style )

[править] Описание функций-членов

[править]
QMessageBox::QMessageBox ( const QString & title, const QString & text, Icon icon, int button0, int button1, int button2, QWidget * parent, const char * name, bool modal, Qt::WindowFlags f = Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint )

Constructs a message box with the given parent, name, and window flags, f. The window title is specified by title, and the message box displays message text and an icon specified by text and icon.

The buttons that the user can access to respond to the message are defined by button0, button1, and button2.

[править]
QMessageBox::QMessageBox ( QWidget * parent, const char * name )

Constructs a message box with the given parent and name.

[править]
int QMessageBox::message ( const QString & title, const QString & text, const QString & buttonText = QString(), QWidget * parent = 0, const char * name = 0 ) [static]

Opens a modal message box with the given title and showing the given text. The message box has a single button which has the given buttonText (or tr("OK")). The message box is centred over its parent and is called name.

Use information(), warning(), question(), or critical() instead.

Например, если у вас есть код

 QMessageBox::message(tr("My App"), tr("All occurrences replaced."),
                      tr("Close"), this);

вы можете записать его в виде

 QMessageBox::information(this, tr("My App"),
                          tr("All occurrences replaced."),
                          QMessageBox::Close);

[править]
bool QMessageBox::query ( const QString & caption, const QString & text, const QString & yesButtonText = QString(), const QString & noButtonText = QString(), QWidget * parent = 0, const char * name = 0 ) [static]

Queries the user using a modal message box with up to two buttons. The message box has the given caption (although some window managers don't show it), and shows the given text. The left button has the yesButtonText (or tr("OK")), and the right button has the noButtonText (or isn't shown). The message box is centred over its parent and is called name.

Use information(), question(), warning(), or critical() instead.

[править]
QPixmap QMessageBox::standardIcon ( Icon icon, Qt::GUIStyle style ) [static]

Returns the pixmap used for a standard icon. This allows the pixmaps to be used in more complex message boxes. icon specifies the required icon, e.g. QMessageBox::Information, QMessageBox::Warning or QMessageBox::Critical.

style is unused.



Copyright © 2007 Trolltech Trademarks
Qt 4.3.2