42 #include <QtGui/qmessagebox.h> 44 #ifndef QT_NO_MESSAGEBOX 46 #include <QtGui/qdialogbuttonbox.h> 47 #include "private/qlabel_p.h" 48 #include "private/qapplication_p.h" 49 #include <QtCore/qlist.h> 50 #include <QtCore/qdebug.h> 51 #include <QtGui/qstyle.h> 52 #include <QtGui/qstyleoption.h> 53 #include <QtGui/qgridlayout.h> 54 #include <QtGui/qdesktopwidget.h> 55 #include <QtGui/qpushbutton.h> 56 #include <QtGui/qaccessible.h> 57 #include <QtGui/qicon.h> 58 #include <QtGui/qtextdocument.h> 59 #include <QtGui/qapplication.h> 60 #include <QtGui/qtextedit.h> 61 #include <QtGui/qtextbrowser.h> 62 #include <QtGui/qmenu.h> 64 #include <QtGui/qfont.h> 65 #include <QtGui/qfontmetrics.h> 66 #include <QtGui/qclipboard.h> 68 #ifndef QT_NO_STYLE_S60 69 #include <qs60style.h> 87 #ifndef QT_NO_TEXTEDIT 97 #ifndef QT_NO_CONTEXTMENU 128 #endif // QT_NO_TEXTEDIT 148 initStyleOption(&opt);
172 compatMode(false), autoAddOkButton(true),
173 detectedEscapeButton(0), informativeLabel(0) { }
178 QAbstractButton *findButton(
int button0,
int button1,
int button2,
int flags);
179 void addOldButtons(
int button0,
int button1,
int button2);
184 void detectEscapeButton();
186 int layoutMinimumWidth();
187 void retranslateStrings();
195 int button0,
int button1,
int button2);
201 int defaultButtonNumber,
202 int escapeButtonNumber);
219 #ifndef QT_NO_TEXTEDIT 226 #if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) 242 label->setOpenExternalLinks(
true);
243 #if defined(Q_WS_MAC) 244 label->setContentsMargins(16, 0, 0, 0);
245 #elif !defined(Q_WS_QWS) 246 label->setContentsMargins(2, 0, 0, 0);
266 const int preferredIconColumn = 0;
267 const int preferredTextColumn = 1;
270 grid->
addWidget(label, 0, preferredTextColumn, 1, 1);
277 q->setContentsMargins(24, 15, 24, 20);
290 q->setWindowTitle(title);
300 retranslateStrings();
317 #if defined(Q_WS_QWS) || defined(Q_WS_WINCE) || defined(Q_OS_SYMBIAN) 319 int hardLimit = screenSize.
width() - (q->frameGeometry().width() - q->geometry().width());
321 int hardLimit =
qMin(screenSize.
width() - 480, 1000);
323 if (screenSize.
width() <= 1024)
324 hardLimit = screenSize.
width();
327 int softLimit =
qMin(screenSize.
width()/2, 420);
328 #elif defined(Q_WS_QWS) 329 int softLimit =
qMin(hardLimit, 500);
333 int softLimit =
qMin(screenSize.
width()/2, 500);
335 int softLimit =
qMin(screenSize.
width() * 3 / 4, 500);
339 if (informativeLabel)
342 label->setWordWrap(
false);
343 int width = layoutMinimumWidth();
345 if (width > softLimit) {
346 label->setWordWrap(
true);
347 width =
qMax(softLimit, layoutMinimumWidth());
349 if (width > hardLimit) {
350 label->d_func()->ensureTextControl();
352 QTextOption opt = control->document()->defaultTextOption();
354 control->document()->setDefaultTextOption(opt);
369 if (informativeLabel) {
373 informativeLabel->setSizePolicy(policy);
374 width =
qMax(width, layoutMinimumWidth());
375 if (width > hardLimit) {
376 informativeLabel->d_func()->ensureTextControl();
377 if (
QTextControl *control = informativeLabel->d_func()->control) {
378 QTextOption opt = control->document()->defaultTextOption();
380 control->document()->setDefaultTextOption(opt);
385 label->setSizePolicy(policy);
389 int windowTitleWidth =
qMin(fm.
width(q->windowTitle()) + 50, hardLimit);
390 if (windowTitleWidth > width)
391 width = windowTitleWidth;
398 #ifndef QT_NO_STYLE_S60 399 QS60Style *s60Style = 0;
407 q->setFixedSize(width, height);
426 for (
int i=0; i<list.
size(); ++i) {
464 int ret = buttonBox->standardButton(button);
466 ret = customButtonList.indexOf(button);
467 }
else if (compatMode) {
476 #ifndef QT_NO_TEXTEDIT 477 if (detailsButton && detailsText && button == detailsButton) {
479 detailsText->setHidden(!detailsText->isHidden());
484 clickedButton = button;
485 q->done(execReturnCode(button));
486 emit q->buttonClicked(button);
488 if (receiverToDisconnectOnClose) {
490 memberToDisconnectOnClose);
491 receiverToDisconnectOnClose = 0;
493 signalToDisconnectOnClose.clear();
494 memberToDisconnectOnClose.clear();
805 d->init(title, text);
836 d->customButtonList.append(button);
837 d->autoAddOkButton =
false;
876 d->autoAddOkButton =
false;
893 d->customButtonList.removeAll(button);
894 if (
d->escapeButton == button)
896 if (
d->defaultButton == button)
897 d->defaultButton = 0;
898 d->buttonBox->removeButton(button);
919 d->buttonBox->setStandardButtons(QDialogButtonBox::StandardButtons(
int(buttons)));
922 if (!buttonList.
contains(
d->escapeButton))
925 d->defaultButton = 0;
926 d->autoAddOkButton =
false;
933 return QMessageBox::StandardButtons(
int(
d->buttonBox->standardButtons()));
996 return d->escapeButton;
1013 if (
d->buttonBox->buttons().contains(button))
1014 d->escapeButton = button;
1043 if (detectedEscapeButton)
1048 if (buttons.
count() == 1) {
1049 detectedEscapeButton = buttons.
first();
1054 for (
int i = 0; i < buttons.
count(); i++) {
1056 if (detectedEscapeButton) {
1057 detectedEscapeButton = 0;
1060 detectedEscapeButton = buttons.
at(i);
1063 if (detectedEscapeButton)
1067 for (
int i = 0; i < buttons.
count(); i++) {
1069 if (detectedEscapeButton) {
1070 detectedEscapeButton = 0;
1073 detectedEscapeButton = buttons.
at(i);
1099 return d->clickedButton;
1117 return d->defaultButton;
1134 if (!
d->buttonBox->buttons().contains(button))
1177 return d->label->text();
1183 d->label->setText(text);
1271 if (
d->iconLabel &&
d->iconLabel->pixmap())
1272 return *
d->iconLabel->pixmap();
1279 d->iconLabel->setPixmap(pixmap);
1300 return d->label->textFormat();
1306 d->label->setTextFormat(format);
1318 switch (e->
type()) {
1320 d_func()->updateSize();
1323 d_func()->retranslateStrings();
1333 for (
int i=0; i<list.
size(); ++i) {
1335 if (pb->
text() == bName) {
1363 if (!
d->detectedEscapeButton) {
1368 d->clickedButton =
d->detectedEscapeButton;
1369 setResult(
d->execReturnCode(
d->detectedEscapeButton));
1378 switch (ev->
type()) {
1384 d->label->setTextInteractionFlags(flags);
1386 if (
d->informativeLabel)
1387 d->informativeLabel->setTextInteractionFlags(flags);
1396 d->label->setFont(f);
1416 if (
d->detectedEscapeButton) {
1418 d->detectedEscapeButton->animateClick();
1420 d->detectedEscapeButton->click();
1426 #if defined (Q_OS_WIN) && !defined(QT_NO_CLIPBOARD) && !defined(QT_NO_SHORTCUT) 1429 QString textToCopy = separator;
1432 textToCopy +=
d->label->text() + separator;
1434 if (
d->informativeLabel)
1435 textToCopy +=
d->informativeLabel->text() + separator;
1439 for (
int i = 0; i < buttons.
count(); i++) {
1442 textToCopy += buttonTexts + separator;
1447 #endif //QT_NO_SHORTCUT QT_NO_CLIPBOARD Q_OS_WIN 1449 #ifndef QT_NO_SHORTCUT 1454 for (
int i = 0; i < buttons.
count(); ++i) {
1500 connect(
this, signal, receiver, member);
1501 d->signalToDisconnectOnClose = signal;
1502 d->receiverToDisconnectOnClose = receiver;
1503 d->memberToDisconnectOnClose = member;
1520 return d->buttonBox->buttons();
1546 if (
d->autoAddOkButton) {
1548 #if defined(Q_WS_WINCE) 1552 if (
d->detailsButton)
1554 d->detectEscapeButton();
1557 #ifndef QT_NO_ACCESSIBILITY 1561 HMENU systemMenu = GetSystemMenu((HWND)
winId(),
FALSE);
1562 if (!
d->detectedEscapeButton) {
1563 EnableMenuItem(systemMenu, SC_CLOSE, MF_BYCOMMAND|MF_GRAYED);
1566 EnableMenuItem(systemMenu, SC_CLOSE, MF_BYCOMMAND|MF_ENABLED);
1576 QMessageBox::StandardButtons
buttons,
1581 if (defaultButton && !(buttons & defaultButton))
1585 int(defaultButton), 0);
1605 if (msgBox.
exec() == -1)
1778 if (oldMsgBox && oldMsgBox->
text() ==
text) {
1801 msgBox->d_func()->autoAddOkButton =
false;
1803 msgBox->d_func()->buttonBox->setCenterButtons(
true);
1839 QString translatedTextAboutQtCaption;
1842 "<p>This program uses Qt version %1.</p>" 1844 QString translatedTextAboutQtText;
1846 "<p>Qt is a C++ toolkit for cross-platform application " 1848 "<p>Qt provides single-source portability across MS Windows, " 1849 "Mac OS X, Linux, and all major commercial Unix variants. " 1850 "Qt is also available for embedded devices as Qt for Embedded Linux " 1851 "and Qt for Windows CE.</p>" 1852 "<p>Qt is available under three different licensing options designed " 1853 "to accommodate the needs of our various users.</p>" 1854 "<p>Qt licensed under our commercial license agreement is appropriate " 1855 "for development of proprietary/commercial software where you do not " 1856 "want to share any source code with third parties or otherwise cannot " 1857 "comply with the terms of the GNU LGPL version 2.1 or GNU GPL version " 1859 "<p>Qt licensed under the GNU LGPL version 2.1 is appropriate for the " 1860 "development of Qt applications (proprietary or open source) provided " 1861 "you can comply with the terms and conditions of the GNU LGPL version " 1863 "<p>Qt licensed under the GNU General Public License version 3.0 is " 1864 "appropriate for the development of Qt applications where you wish to " 1865 "use such applications in combination with software subject to the " 1866 "terms of the GNU GPL version 3.0 or where you are otherwise willing " 1867 "to comply with the terms of the GNU GPL version 3.0.</p>" 1868 "<p>Please see <a href=\"http://qt.digia.com/product/licensing\">qt.digia.com/product/licensing</a> " 1869 "for an overview of Qt licensing.</p>" 1870 "<p>Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).</p>" 1871 "<p>Qt is a Digia product. See <a href=\"http://qt.digia.com/\">qt.digia.com</a> " 1872 "for more information.</p>" 1877 msgBox->
setText(translatedTextAboutQtCaption);
1883 #if defined(Q_WS_WINCE) 1892 msgBox->d_func()->autoAddOkButton =
false;
1894 msgBox->d_func()->buttonBox->setCenterButtons(
true);
1920 #if QT_VERSION < 0x050000 1951 if (button1 != 0 && !(button1 & NewButtonMask))
1953 if (button2 != 0 && !(button2 & NewButtonMask))
1963 if (button0 & flags) {
1965 }
else if (button1 & flags) {
1967 }
else if (button2 & flags) {
1979 q->setDefaultButton(
1998 int button0,
int button1,
int button2)
2001 messageBox.d_func()->addOldButtons(button0, button1, button2);
2002 return messageBox.
exec();
2010 int defaultButtonNumber,
2011 int escapeButtonNumber)
2014 QString myButton0Text = button0Text;
2027 return messageBox.
exec();
2032 #ifndef QT_NO_TEXTEDIT 2100 d->init(title, text);
2102 d->addOldButtons(button0, button1, button2);
2148 int button0,
int button1,
int button2)
2151 button0, button1, button2);
2189 const QString& button2Text,
int defaultButtonNumber,
2190 int escapeButtonNumber)
2193 button0Text, button1Text, button2Text,
2194 defaultButtonNumber, escapeButtonNumber);
2240 int button0,
int button1,
int button2)
2243 button0, button1, button2);
2280 const QString& button2Text,
int defaultButtonNumber,
2281 int escapeButtonNumber)
2284 button0Text, button1Text, button2Text,
2285 defaultButtonNumber, escapeButtonNumber);
2332 int button0,
int button1,
int button2)
2335 button0, button1, button2);
2372 const QString& button2Text,
int defaultButtonNumber,
2373 int escapeButtonNumber)
2376 button0Text, button1Text, button2Text,
2377 defaultButtonNumber, escapeButtonNumber);
2424 int button0,
int button1,
int button2)
2427 button0, button1, button2);
2464 const QString& button2Text,
int defaultButtonNumber,
2465 int escapeButtonNumber)
2468 button0Text, button1Text, button2Text,
2469 defaultButtonNumber, escapeButtonNumber);
2489 return abstractButton->text();
2490 }
else if (
d->buttonBox->buttons().isEmpty() && (button ==
Ok || button ==
Old_Ok)) {
2513 abstractButton->setText(text);
2514 }
else if (
d->buttonBox->buttons().isEmpty() && (button ==
Ok || button ==
Old_Ok)) {
2520 #ifndef QT_NO_TEXTEDIT 2538 return d->detailsText ?
d->detailsText->text() :
QString();
2545 delete d->detailsText;
2548 delete d->detailsButton;
2549 d->detailsButton = 0;
2553 if (!
d->detailsText) {
2558 d->detailsText->hide();
2560 if (!
d->detailsButton)
2562 d->detailsText->setText(text);
2564 #endif // QT_NO_TEXTEDIT 2589 return d->informativeLabel ?
d->informativeLabel->text() :
QString();
2597 delete d->informativeLabel;
2598 d->informativeLabel = 0;
2600 d->label->setContentsMargins(2, 0, 0, 0);
2606 if (!
d->informativeLabel) {
2614 d->label->setContentsMargins(2, 0, 0, 0);
2624 #if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) 2628 #if defined(Q_OS_SYMBIAN) 2631 const int preferredTextColumn = 1;
2633 grid->
addWidget(textBrowser, 1, preferredTextColumn, 1, 1);
2634 d->textBrowser = textBrowser;
2638 d->informativeLabel = label;
2640 d->informativeLabel->setText(text);
2642 #if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) 2644 d->textBrowser->setText(
d->informativeLabel->text());
2715 int button0,
int button1,
int button2,
2717 bool modal, Qt::WindowFlags f)
2723 d->init(title, text);
2724 d->addOldButtons(button0, button1, button2);
2824 return tmpIcon.
pixmap(iconSize, iconSize);
2902 #include "moc_qmessagebox.cpp" 2904 #endif // QT_NO_MESSAGEBOX
void removeButton(QAbstractButton *button)
Removes button from the button box without deleting it.
static QMessageBox::StandardButton newButton(int button)
static void aboutQt(QWidget *parent, const QString &title=QString())
Displays a simple message box about Qt, with the given title and centered over parent (if parent is n...
void showEvent(QShowEvent *event)
Reimplemented Function
static Qt::LayoutDirection layoutDirection()
Icon
This enum has the following values:
static void updateAccessibility(QObject *, int who, Event reason)
Notifies accessibility clients about a change in object's accessibility information.
int width(const QString &, int len=-1) const
Returns the width in pixels of the first len characters of text.
int totalHeightForWidth(int w) const
Also takes contentsMargins and menu bar into account.
The QKeyEvent class describes a key event.
static QPixmap standardIcon(Icon icon)
Returns the pixmap used for a standard icon.
void setText(const QString &text)
void setTextFormat(Qt::TextFormat format)
void addOldButtons(int button0, int button1, int button2)
void keyPressEvent(QKeyEvent *)
Reimplemented Function
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
The QFontMetrics class provides font metrics information.
#define QT_END_NAMESPACE
This macro expands to.
QPointer< QObject > receiverToDisconnectOnClose
void setWordWrap(bool on)
static QString fromAscii(const char *, int size=-1)
Returns a QString initialized with the first size characters from the string str. ...
QString informativeText() const
QAbstractButton * findButton(int button0, int button1, int button2, int flags)
The QDialog class is the base class of dialog windows.
QAbstractButton * clickedButton() const
Returns the button that was clicked by the user, or 0 if the user hit the Esc key and no escape butto...
static QSize globalStrut()
void setOpenExternalLinks(bool open)
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option=0, const QWidget *widget=0) const =0
Returns the value of the given pixel metric.
The QByteArray class provides an array of bytes.
QString & prepend(QChar c)
QMessageBox(QWidget *parent=0)
Constructs a message box with no text and no buttons.
static Qt::MouseButtons buttons
The QMessageBox class provides a modal dialog for informing the user or for asking the user a questio...
PixelMetric
This enum describes the various available pixel metrics.
Q_GUI_EXPORT bool mightBeRichText(const QString &)
Returns true if the string text is likely to be rich text; otherwise returns false.
QSize expandedTo(const QSize &) const
Returns a size holding the maximum width and height of this size and the given otherSize.
bool qt_wince_is_smartphone()
TextEdit(QWidget *parent=0)
bool qt_wince_is_mobile()
bool activate()
Redoes the layout for parentWidget() if necessary.
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
bool event(QEvent *e)
Reimplemented Function
QMessageBoxDetailsText * detailsText
QList< QAbstractButton * > buttons() const
Returns a list of all the buttons that have been added to the message box.
int count(const T &t) const
Returns the number of occurrences of value in the list.
static QStyle * style()
Returns the application's style object.
void showEvent(QShowEvent *)
This event handler can be reimplemented in a subclass to receive widget show events which are passed ...
DetailButton * detailsButton
void setTextInteractionFlags(Qt::TextInteractionFlags flags)
QByteArray signalToDisconnectOnClose
The QString class provides a Unicode character string.
void closeEvent(QCloseEvent *event)
Reimplemented Function
T * qobject_cast(QObject *object)
virtual bool hasHeightForWidth() const
Returns true if this layout's preferred height depends on its width; otherwise returns false...
void setText(const QString &, Mode mode=Clipboard)
Copies text into the clipboard as plain text.
bool modal
whether show() should pop up the dialog as modal or modeless
QPushButton * defaultButton
static int showOldMessageBox(QWidget *parent, QMessageBox::Icon icon, const QString &title, const QString &text, int button0, int button1, int button2)
QAbstractButton * detectedEscapeButton
void setOpenExternalLinks(bool open)
The QObject class is the base class of all Qt objects.
void addWidget(QWidget *, int stretch=0, Qt::Alignment alignment=0)
Adds widget to the end of this box layout, with a stretch factor of stretch and alignment alignment...
int rowCount() const
Returns the number of rows in this grid.
static StandardButton warning(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
Opens a warning message box with the given title and text in front of the specified parent widget...
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
QString text
the message box text to be displayed.
static QString translate(const char *context, const char *key, const char *disambiguation=0, Encoding encoding=CodecForTr)
void setObjectName(const QString &name)
QFrame(QWidget *parent=0, Qt::WindowFlags f=0)
Constructs a frame widget with frame style NoFrame and a 1-pixel frame width.
static QFont font()
Returns the default application font.
void buttonClicked(QAbstractButton *button)
This signal is emitted whenever a button is clicked inside the QMessageBox.
QString toPlainText() const
Returns the text of the text edit as plain text.
void setHorizontalSpacing(int spacing)
void setHeightForWidth(bool b)
Qt::KeyboardModifiers modifiers() const
Returns the keyboard modifier flags that existed immediately after the event occurred.
int key() const
Returns the code of the key that was pressed or released.
void contextMenuEvent(QContextMenuEvent *e)
Shows the standard context menu created with createStandardContextMenu().
int columnCount() const
Returns the number of columns in this grid.
void setIconPixmap(const QPixmap &pixmap)
int width() const
Returns the width.
void addButton(QAbstractButton *button, ButtonRole role)
Adds the given button to the message box with the specified role.
QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option=0, const QWidget *widget=0) const
Returns an icon for the given standardIcon.
void resizeEvent(QResizeEvent *)
Reimplemented Function
#define QT_BEGIN_NAMESPACE
This macro expands to.
void setBold(bool)
If enable is true sets the font's weight to QFont::Bold ; otherwise sets the weight to QFont::Normal...
QBool contains(const T &t) const
Returns true if the list contains an occurrence of value; otherwise returns false.
QAbstractButton * button(StandardButton which) const
Returns a pointer corresponding to the standard button which, or 0 if the standard button doesn't exi...
void init(const QString &title=QString(), const QString &text=QString())
QSize size(int flags, const QString &str, int tabstops=0, int *tabarray=0) const
Returns the size in pixels of text.
static QClipboard * clipboard()
Returns a pointer to the application global clipboard.
int execReturnCode(QAbstractButton *button)
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
void closeEvent(QCloseEvent *)
Reimplemented Function
QSize size() const
Returns the size of the rectangle.
const T & at(int i) const
Returns the item at index position i in the list.
bool isNull() const
Returns true if the icon is empty; otherwise returns false.
void setVisible(bool visible)
Reimplemented Function
QSize sizeHint() const
Reimplemented Function
The QResizeEvent class contains event parameters for resize events.
const char * styleHint(const QFontDef &request)
void setRowMinimumHeight(int row, int minSize)
Sets the minimum height of row row to minSize pixels.
void retranslateStrings()
static StandardButton critical(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
Opens a critical message box with the given title and text in front of the specified parent widget...
void setText(const QString &text)
#define QT_VERSION_STR
This macro expands to a string that specifies Qt's version number (for example, "4.
T findChild(const QString &aName=QString()) const
Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object.
static QMessageBox::StandardButton showNewMessageBox(QWidget *parent, QMessageBox::Icon icon, const QString &title, const QString &text, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton)
FontHash * qt_app_fonts_hash()
#define FALSE
Synonym for false.
QMessageBoxDetailsText(QWidget *parent=0)
QAbstractButton * abstractButtonForId(int id) const
static QChar fromLatin1(char c)
Converts the Latin-1 character c to its equivalent QChar.
T value(int i) const
Returns the value at index position i in the list.
void setVerticalSpacing(int spacing)
void setFrameShape(Shape)
The QShowEvent class provides an event that is sent when a widget is shown.
void _q_buttonClicked(QAbstractButton *)
void setInformativeText(const QString &text)
void setDetailedText(const QString &text)
ButtonRole buttonRole(QAbstractButton *button) const
Returns the button role for the specified button.
QPixmap iconPixmap() const
static QPixmap standardIcon(QMessageBox::Icon icon, QMessageBox *mb)
static void about(QWidget *parent, const QString &title, const QString &text)
Displays a simple about box with title title and text text.
QString detailedText() const
void setWindowModality(Qt::WindowModality windowModality)
This function shadows QWidget::setWindowModality().
QDialog(QWidget *parent=0, Qt::WindowFlags f=0)
Constructs a dialog with parent parent.
void setButtonText(int button, const QString &text)
Sets the text of the message box button button to text.
void setFrameShadow(Shadow)
static QDesktopWidget * desktop()
Returns the desktop widget (also called the root window).
virtual QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *w=0) const =0
Returns the size of the element described by the specified option and type, based on the provided con...
void setResult(int r)
Sets the modal dialog's result code to i.
T & first()
Returns a reference to the first item in the list.
QLabel * informativeLabel
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
Disconnects signal in object sender from method in object receiver.
void setPlainText(const QString &text)
Changes the text of the text edit to the string text.
static bool detectedCompat(int button0, int button1, int button2)
void hideSpecial()
Hides special buttons which are rather shown in the title bar on WinCE, to conserve screen space...
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
bool qt_wince_is_pocket_pc()
#define Q_DECLARE_PUBLIC(Class)
QPushButton * defaultButton() const
Returns the button that should be the message box's default button.
ButtonRole
Combinations of these roles are as flags used to describe different aspects of their behavior...
The QFont class specifies a font used for drawing text.
QAbstractButton * escapeButton() const
Returns the button that is activated when escape is pressed.
QMenu * createStandardContextMenu()
This function creates the standard context menu which is shown when the user clicks on the text edit ...
void resizeEvent(QResizeEvent *event)
Reimplemented Function
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
QSize actualSize(const QSize &size, Mode mode=Normal, State state=Off) const
Returns the actual size of the icon for the requested size, mode, and state.
QObject * parent() const
Returns a pointer to the parent object.
int result() const
In general returns the modal dialog's result code, Accepted or Rejected.
The QGridLayout class lays out widgets in a grid.
static StandardButton question(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
Opens a question message box with the given title and text in front of the specified parent widget...
The QTextBrowser class provides a rich text browser with hypertext navigation.
int exec()
Shows the message box as a modal dialog, blocking until the user closes it.
int size() const
Returns the number of items in the list.
void setStandardButtons(StandardButtons buttons)
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI...
Qt::TextFormat textFormat() const
bool event(QEvent *e)
Reimplemented Function
void setDefaultButton(QPushButton *button)
Sets the message box's default button to button.
int height() const
Returns the height.
if(void) toggleToolbarShown
static StandardButton information(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
Opens an information message box with the given title and text in front of the specified parent widge...
StandardButton standardButton(QAbstractButton *button) const
Returns the standard button enum value corresponding to the given button, or NoButton if the given bu...
The QLabel widget provides a text or image display.
The QTextOption class provides a description of general rich text properties.
static int oldButton(int button)
The QPixmap class is an off-screen image representation that can be used as a paint device...
QSize totalMinimumSize() const
Also takes contentsMargins and menu bar into account.
StandardButton
These enums describe flags for standard buttons.
QPixmap pixmap(const QSize &size, Mode mode=Normal, State state=Off) const
Returns a pixmap with the requested size, mode, and state, generating one if necessary.
void setWindowTitle(const QString &title)
This function shadows QWidget::setWindowTitle().
void setWrapMode(WrapMode wrap)
Sets the option's text wrap mode to the given mode.
void ignore()
Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false).
void setSizeConstraint(SizeConstraint)
void open()
Shows the dialog as a window modal dialog, returning immediately.
The QSize class defines the size of a two-dimensional object using integer point precision.
void setRowStretch(int row, int stretch)
Sets the stretch factor of row row to stretch.
void keyPressEvent(QKeyEvent *event)
Reimplemented Function
StandardButtons standardButtons() const
void setEscapeButton(QAbstractButton *button)
Sets the button that gets activated when the Escape key is pressed to button.
removePostedEvents
Removes all events of the given eventType that were posted using postEvent() for receiver.
The QVBoxLayout class lines up widgets vertically.
void addWidget(QWidget *w)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString buttonText(int button) const
Returns the text of the message box button button, or an empty string if the message box does not con...
void changeEvent(QEvent *event)
Reimplemented Function
void setModal(bool modal)
QString & remove(int i, int len)
Removes n characters from the string, starting at the given position index, and returns a reference t...
QByteArray memberToDisconnectOnClose
bool isNull() const
Returns true if this is a null pixmap; otherwise returns false.
QList< QAbstractButton * > customButtonList
QAbstractButton * clickedButton
The QEvent class is the base class of all event classes.
Type type() const
Returns the event type.
void finished(int result)
This signal is emitted when the dialog's result code has been set, either by the user or by calling d...
The QFrame class is the base class of widgets that can have a frame.
void setVisible(bool visible)
Reimplemented Function
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
void setReadOnly(bool ro)
void setAlignment(Qt::Alignment)
Without this function, a call to e.
void detectEscapeButton()
void setText(const QString &text)
Sets the text edit's text.
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
QDialogButtonBox * buttonBox
The QCloseEvent class contains parameters that describe a close event.
The QTextEdit class provides a widget that is used to edit and display both plain and rich text...
void removeWidget(QWidget *w)
Removes the widget widget from the layout.
static QPoint pos()
Returns the position of the cursor (hot spot) in global screen coordinates.
~QMessageBox()
Destroys the message box.
The QList class is a template class that provides lists.
QAbstractButton * escapeButton
The QIcon class provides scalable icons in different modes and states.