Movatterモバイル変換


[0]ホーム

URL:


We bake cookies in your browser for a better experience. Using this site means that you consent.Read More

Menu

Qt Documentation

QErrorMessage Class

TheQErrorMessage class provides an error message display dialog.More...

Header:#include <QErrorMessage>
Inherits:QDialog

Public Functions

QErrorMessage(QWidget * parent = 0)
~QErrorMessage()
  • 8 public functions inherited fromQDialog
  • 220 public functions inherited fromQWidget
  • 29 public functions inherited fromQObject
  • 12 public functions inherited fromQPaintDevice

Public Slots

voidshowMessage(const QString & message)
voidshowMessage(const QString & message, const QString & type)
  • 5 public slots inherited fromQDialog
  • 19 public slots inherited fromQWidget
  • 1 public slot inherited fromQObject

Static Public Members

QErrorMessage *qtHandler()
  • 4 static public members inherited fromQWidget
  • 7 static public members inherited fromQObject

Reimplemented Protected Functions

virtual voidchangeEvent(QEvent * e)
virtual voiddone(int a)
  • 7 protected functions inherited fromQDialog
  • 37 protected functions inherited fromQWidget
  • 8 protected functions inherited fromQObject
  • 1 protected function inherited fromQPaintDevice

Additional Inherited Members

Detailed Description

TheQErrorMessage class provides an error message display dialog.

An error message widget consists of a text label and a checkbox. The checkbox lets the user control whether the same error message will be displayed again in the future, typically displaying the text, "Show this message again" translated into the appropriate local language.

For production applications, the class can be used to display messages which the user only needs to see once. To useQErrorMessage like this, you create the dialog in the usual way, and show it by calling theshowMessage() slot or connecting signals to it.

The staticqtHandler() function installs a message handler usingqInstallMsgHandler() and creates aQErrorMessage that displaysqDebug(),qWarning() andqFatal() messages. This is most useful in environments where no console is available to display warnings and error messages.

In both casesQErrorMessage will queue pending messages and display them in order, with each new message being shown as soon as the user has accepted the previous message. Once the user has specified that a message is not to be shown again it is automatically skipped, and the dialog will show the next appropriate message in the queue.

TheStandard Dialogs example shows how to useQErrorMessage as well as other built-in Qt dialogs.

See alsoQMessageBox,QStatusBar::showMessage(), andStandard Dialogs Example.

Member Function Documentation

QErrorMessage::QErrorMessage(QWidget * parent = 0)

Constructs and installs an error handler window with the givenparent.

QErrorMessage::~QErrorMessage()

Destroys the error message dialog.

[virtual protected]void QErrorMessage::changeEvent(QEvent * e)

Reimplemented fromQWidget::changeEvent().

[virtual protected]void QErrorMessage::done(int a)

Reimplemented fromQDialog::done().

[static]QErrorMessage * QErrorMessage::qtHandler()

Returns a pointer to aQErrorMessage object that outputs the default Qt messages. This function creates such an object, if there isn't one already.

[slot]void QErrorMessage::showMessage(constQString & message)

Shows the given message,message, and returns immediately. If the user has requested for the message not to be shown again, this function does nothing.

Normally, the message is displayed immediately. However, if there are pending messages, it will be queued to be displayed later.

[slot]void QErrorMessage::showMessage(constQString & message, constQString & type)

This is an overloaded function.

Shows the given message,message, and returns immediately. If the user has requested for messages of type,type, not to be shown again, this function does nothing.

Normally, the message is displayed immediately. However, if there are pending messages, it will be queued to be displayed later.

This function was introduced in Qt 4.5.

See alsoshowMessage().

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.


[8]ページ先頭

©2009-2025 Movatter.jp