4#include <QtWidgets/qmessagebox.h>
6#include <QtWidgets/qdialogbuttonbox.h>
7#include "private/qlabel_p.h"
8#include "private/qapplication_p.h"
9#include <QtCore/qlist.h>
10#include <QtCore/qdebug.h>
11#include <QtWidgets/qstyle.h>
12#include <QtWidgets/qstyleoption.h>
13#include <QtWidgets/qgridlayout.h>
14#include <QtWidgets/qpushbutton.h>
15#include <QtWidgets/qcheckbox.h>
16#include <QtGui/qaccessible.h>
17#include <QtGui/qicon.h>
18#include <QtGui/qtextdocument.h>
19#include <QtWidgets/qapplication.h>
20#if QT_CONFIG(textedit)
21#include <QtWidgets/qtextedit.h>
24#include <QtWidgets/qmenu.h>
27#include <QtGui/qfont.h>
28#include <QtGui/qfontmetrics.h>
29#include <QtGui/qclipboard.h>
30#include "private/qabstractbutton_p.h"
31#include <QtGui/qpa/qplatformtheme.h>
33#include <QtCore/qanystringview.h>
34#include <QtCore/qdebug.h>
35#include <QtCore/qversionnumber.h>
38# include <QtCore/qt_windows.h>
39#include <qpa/qplatformnativeinterface.h>
49HMENU qt_getWindowsSystemMenu(
const QWidget *
w)
53 return GetSystemMenu(
reinterpret_cast<HWND
>(
handle),
false);
63#if QT_CONFIG(textedit)
64class QMessageBoxDetailsText :
public QWidget
72#ifndef QT_NO_CONTEXTMENU
75 if (
QMenu *
menu = createStandardContextMenu()) {
85 , copyAvailable(
false)
101 this,
SLOT(textCopyAvailable(
bool)));
108#ifdef QT_NO_CLIPBOARD
124 void textCopyAvailable(
bool available)
126 copyAvailable = available;
144 {
return label ==
ShowLabel ? QMessageBox::tr(
"Show Details...") : QMessageBox::tr(
"Hide Details..."); }
200 int button0,
int button1,
int button2);
206 int defaultButtonNumber,
207 int escapeButtonNumber);
226#if QT_CONFIG(textedit)
227 QMessageBoxDetailsText *detailsText;
251 label->setOpenExternalLinks(
true);
290 grid->
addItem(indentSpacer, 0, hasIcon ? 1 : 0, 2, 1);
311 q->setContentsMargins(24, 15, 24, 20);
317#if QT_CONFIG(textedit)
341 const QSize screenSize =
q->screen()->availableGeometry().size();
342 int hardLimit =
qMin(screenSize.
width() - 480, 1000);
344 if (screenSize.
width() <= 1024)
345 hardLimit = screenSize.
width();
347 int softLimit =
qMin(screenSize.
width()/2, 420);
350 int softLimit =
qMin(screenSize.
width()/2, 500);
356 label->setWordWrap(
false);
359 if (
width > softLimit) {
360 label->setWordWrap(
true);
363 if (
width > hardLimit) {
364 label->d_func()->ensureTextControl();
368 control->document()->setDefaultTextOption(
opt);
380 if (
width > hardLimit) {
385 control->document()->setDefaultTextOption(
opt);
395 if (windowTitleWidth >
width)
396 width = windowTitleWidth;
467#if QT_CONFIG(textedit)
470 detailsText->setHidden(!detailsText->isHidden());
514 dialogButton->
click();
882 if (
button !=
d->detailsButton) {
887 d->customButtonList.append(
button);
888 d->autoAddOkButton =
false;
936 d->autoAddOkButton =
false;
950 d->customButtonList.removeAll(
button);
952 d->escapeButton =
nullptr;
953 if (
d->defaultButton ==
button)
954 d->defaultButton =
nullptr;
955 d->buttonBox->removeButton(
button);
973 d->buttonBox->setStandardButtons(QDialogButtonBox::StandardButtons(
int(
buttons)));
976 if (!buttonList.
contains(
d->escapeButton))
977 d->escapeButton =
nullptr;
978 if (!buttonList.
contains(
d->defaultButton))
979 d->defaultButton =
nullptr;
980 d->autoAddOkButton =
false;
987 return QMessageBox::StandardButtons(
int(
d->buttonBox->standardButtons()));
1041 return d->escapeButton;
1055 if (
d->buttonBox->buttons().contains(
button))
1087 if (buttons.
size() == 1) {
1103 for (
auto *
button : buttons) {
1116 for (
auto *
button : buttons) {
1145 return d->clickedButton;
1160 return d->defaultButton;
1174 if (!
d->buttonBox->buttons().contains(
button))
1207 if (
cb ==
d->checkbox)
1211 d->checkbox->hide();
1213 if (
d->checkbox->parentWidget() ==
this) {
1214 d->checkbox->setParent(
nullptr);
1215 d->checkbox->deleteLater();
1222 d->checkbox->setSizePolicy(
sp);
1258 const QMessageBox::Options previousOptions =
options();
1259 if (!(previousOptions &
option) != !on)
1290 return QMessageBox::Options(
int(
d->options->options()));
1331 return d->label->text();
1337 d->label->setText(
text);
1417 return d->iconLabel->pixmap();
1423 d->iconLabel->setPixmap(
pixmap);
1442 return d->label->textFormat();
1448 d->label->setTextFormat(
format);
1469 return d->label->textInteractionFlags();
1475 d->label->setTextInteractionFlags(
flags);
1484 switch (
e->type()) {
1486 d_func()->updateSize();
1489 d_func()->retranslateStrings();
1511 if (!
d->detectedEscapeButton) {
1516 if (!
d->clickedButton) {
1517 d->clickedButton =
d->detectedEscapeButton;
1518 setResult(
d->execReturnCode(
d->detectedEscapeButton));
1528 switch (ev->
type()) {
1534 d->label->setTextInteractionFlags(
flags);
1536 if (
d->informativeLabel)
1537 d->informativeLabel->setTextInteractionFlags(
flags);
1546 d->label->setFont(
f);
1561#if QT_CONFIG(shortcut)
1564 if (
d->detectedEscapeButton) {
1566 d->detectedEscapeButton->animateClick();
1568 d->detectedEscapeButton->click();
1575#if !defined(QT_NO_CLIPBOARD) && !defined(QT_NO_SHORTCUT)
1577#if QT_CONFIG(textedit)
1579 if (
d->detailsText &&
d->detailsText->isVisible() &&
d->detailsText->copy()) {
1580 e->setAccepted(
true);
1584 d->detailsText->selectAll();
1585 e->setAccepted(
true);
1590#if defined(Q_OS_WIN)
1592 const auto separator =
"---------------------------\n"_L1;
1594 textToCopy += separator +
windowTitle() + u
'\n' + separator
1595 +
d->label->text() + u
'\n' + separator;
1597 if (
d->informativeLabel)
1598 textToCopy +=
d->informativeLabel->text() + u
'\n' + separator;
1603 textToCopy += u
'\n' + separator;
1604#if QT_CONFIG(textedit)
1606 textToCopy +=
d->detailsText->text() + u
'\n' + separator;
1615#ifndef QT_NO_SHORTCUT
1617 int key =
e->key() &
~Qt::MODIFIER_MASK;
1647 d->signalToDisconnectOnClose =
signal;
1648 d->receiverToDisconnectOnClose = receiver;
1649 d->memberToDisconnectOnClose = member;
1680 return d->buttonBox->buttons();
1703 if (
d->autoAddOkButton) {
1706 if (
d->detailsButton)
1708 d->clickedButton =
nullptr;
1709 d->detectEscapeButton();
1712#if QT_CONFIG(accessibility)
1713 QAccessibleEvent
event(
this, QAccessible::Alert);
1714 QAccessible::updateAccessibility(&
event);
1716#if defined(Q_OS_WIN)
1717 if (
const HMENU systemMenu = qt_getWindowsSystemMenu(
this)) {
1718 EnableMenuItem(systemMenu, SC_CLOSE,
d->detectedEscapeButton ?
1719 MF_BYCOMMAND|MF_ENABLED : MF_BYCOMMAND|MF_GRAYED);
1729 QMessageBox::StandardButtons buttons,
1734 if (defaultButton && !(buttons & defaultButton))
1738 int(defaultButton), 0);
1918 if (oldMsgBox && oldMsgBox->text() ==
text) {
1921 oldMsgBox->activateWindow();
1941 msgBox->d_func()->autoAddOkButton =
false;
1943 msgBox->d_func()->buttonBox->setCenterButtons(
true);
1975 oldMsgBox->activateWindow();
1980 QString translatedTextAboutQtCaption;
1981 translatedTextAboutQtCaption = QMessageBox::tr(
1983 "<p>This program uses Qt version %1.</p>"
1984 ).
arg(QT_VERSION_STR
""_L1);
1987 const QString translatedTextAboutQtText = QMessageBox::tr(
1988 "<p>Qt is a C++ toolkit for cross-platform application "
1990 "<p>Qt provides single-source portability across all major desktop "
1991 "operating systems. It is also available for embedded Linux and other "
1992 "embedded and mobile operating systems.</p>"
1993 "<p>Qt is available under multiple licensing options designed "
1994 "to accommodate the needs of our various users.</p>"
1995 "<p>Qt licensed under our commercial license agreement is appropriate "
1996 "for development of proprietary/commercial software where you do not "
1997 "want to share any source code with third parties or otherwise cannot "
1998 "comply with the terms of GNU (L)GPL.</p>"
1999 "<p>Qt licensed under GNU (L)GPL is appropriate for the "
2000 "development of Qt applications provided you can comply with the terms "
2001 "and conditions of the respective licenses.</p>"
2002 "<p>Please see <a href=\"http://%2/\">%2</a> "
2003 "for an overview of Qt licensing.</p>"
2004 "<p>Copyright (C) %1 The Qt Company Ltd and other "
2006 "<p>Qt and the Qt logo are trademarks of The Qt Company Ltd.</p>"
2007 "<p>Qt is The Qt Company Ltd product developed as an open source "
2008 "project. See <a href=\"http://%3/\">%3</a> for more information.</p>"
2018 QPixmap pm(
":/qt-project.org/qmessagebox/images/qtlogo-64.png"_L1);
2027 msgBox->d_func()->autoAddOkButton =
false;
2029 msgBox->d_func()->buttonBox->setCenterButtons(
true);
2066 if (button0 &
flags) {
2068 }
else if (button1 &
flags) {
2070 }
else if (button2 &
flags) {
2082 q->setDefaultButton(
2101 int button0,
int button1,
int button2)
2104 messageBox.d_func()->addOldButtons(button0, button1, button2);
2113 int defaultButtonNumber,
2114 int escapeButtonNumber)
2117 QString myButton0Text = button0Text;
2119 myButton0Text = QDialogButtonBox::tr(
"OK");
2135#if QT_CONFIG(textedit)
2141#if QT_DEPRECATED_SINCE(6,2)
2198 f |
Qt::WindowTitleHint |
Qt::WindowSystemMenuHint |
Qt::WindowCloseButtonHint)
2203 d->addOldButtons(button0, button1, button2);
2246 int button0,
int button1,
int button2)
2249 button0, button1, button2);
2284 const QString& button2Text,
int defaultButtonNumber,
2285 int escapeButtonNumber)
2288 button0Text, button1Text, button2Text,
2289 defaultButtonNumber, escapeButtonNumber);
2333 int button0,
int button1,
int button2)
2336 button0, button1, button2);
2370 const QString& button2Text,
int defaultButtonNumber,
2371 int escapeButtonNumber)
2374 button0Text, button1Text, button2Text,
2375 defaultButtonNumber, escapeButtonNumber);
2419 int button0,
int button1,
int button2)
2422 button0, button1, button2);
2456 const QString& button2Text,
int defaultButtonNumber,
2457 int escapeButtonNumber)
2460 button0Text, button1Text, button2Text,
2461 defaultButtonNumber, escapeButtonNumber);
2505 int button0,
int button1,
int button2)
2508 button0, button1, button2);
2542 const QString& button2Text,
int defaultButtonNumber,
2543 int escapeButtonNumber)
2546 button0Text, button1Text, button2Text,
2547 defaultButtonNumber, escapeButtonNumber);
2564 return abstractButton->text();
2567 return QDialogButtonBox::tr(
"OK");
2585 abstractButton->setText(
text);
2594#if QT_CONFIG(textedit)
2606QString QMessageBox::detailedText()
const
2609 return d->detailsText ?
d->detailsText->text() :
QString();
2612void QMessageBox::setDetailedText(
const QString &
text)
2616 if (
d->detailsText) {
2617 d->detailsText->hide();
2618 d->detailsText->deleteLater();
2620 d->detailsText =
nullptr;
2622 if (
d->detailsButton) {
2623 d->detailsButton->hide();
2624 d->detailsButton->deleteLater();
2626 d->detailsButton =
nullptr;
2628 if (!
d->detailsText) {
2629 d->detailsText =
new QMessageBoxDetailsText(
this);
2630 d->detailsText->hide();
2632 if (!
d->detailsButton) {
2633 const bool autoAddOkButton =
d->autoAddOkButton;
2636 d->autoAddOkButton = autoAddOkButton;
2638 d->detailsText->setText(
text);
2663 return d->informativeLabel ?
d->informativeLabel->text() :
QString();
2670 if (
d->informativeLabel) {
2671 d->informativeLabel->hide();
2672 d->informativeLabel->deleteLater();
2674 d->informativeLabel =
nullptr;
2676 if (!
d->informativeLabel) {
2681 label->setOpenExternalLinks(
true);
2682 label->setWordWrap(
true);
2687 label->setWordWrap(
true);
2688 d->informativeLabel =
label;
2690 d->informativeLabel->setText(
text);
2801 QPlatformDialogHelper::StandardButtons buttons(
int(
q->standardButtons()));
2818 if (strcmp(QMessageBox::staticMetaObject.
className(),
q->metaObject()->className()) != 0)
2830#if QT_CONFIG(textedit)
2844 if (current >= required)
2846 std::optional<QApplication> application;
2848 application.emplace(argc, argv);
2849 const QString message = QApplication::tr(
"Application \"%1\" requires Qt %2, found Qt %3.")
2850 .
arg(
qAppName(), required.toString(), current.toString());
2856#if QT_DEPRECATED_SINCE(6,2)
2943#include "moc_qmessagebox.cpp"
2944#include "qmessagebox.moc"
static QWindow * windowForWidget(const QWidget *widget)
static QStyle * style()
Returns the application's style object.
static QFont font()
Returns the default application font.
void addWidget(QWidget *, int stretch=0, Qt::Alignment alignment=Qt::Alignment())
Adds widget to the end of this box layout, with a stretch factor of stretch and alignment alignment.
void clear()
Clears the contents of the byte array and makes it null.
The QCheckBox widget provides a checkbox with a text label.
void setCheckState(Qt::CheckState state)
Sets the checkbox's check state to state.
Qt::CheckState checkState() const
Returns the checkbox's check state.
void setText(const QString &, Mode mode=Clipboard)
Copies text into the clipboard as plain text.
The QCloseEvent class contains parameters that describe a close event.
static void removePostedEvents(QObject *receiver, int eventType=0)
static bool testAttribute(Qt::ApplicationAttribute attribute)
Returns true if attribute attribute is set; otherwise returns false.
bool setNativeDialogVisible(bool visible)
virtual void setVisible(bool visible)
virtual bool canBeNativeDialog() const
virtual int dialogCode() const
The QDialog class is the base class of dialog windows.
void closeEvent(QCloseEvent *) override
\reimp
void finished(int result)
void setResult(int r)
Sets the modal dialog's result code to i.
void keyPressEvent(QKeyEvent *) override
\reimp
virtual int exec()
Shows the dialog as a \l{QDialog::Modal Dialogs}{modal dialog}, blocking until the user closes it.
int result() const
In general returns the modal dialog's result code, Accepted or Rejected.
void setModal(bool modal)
void resizeEvent(QResizeEvent *) override
\reimp
void showEvent(QShowEvent *) override
\reimp
friend class QPushButton
[1]
Type type() const
Returns the event type.
\reentrant \inmodule QtGui
QSize size(int flags, const QString &str, int tabstops=0, int *tabarray=nullptr) const
Returns the size in pixels of text.
int horizontalAdvance(const QString &, int len=-1) const
Returns the horizontal advance in pixels of the first len characters of text.
void setBold(bool)
If enable is true sets the font's weight to \l{Weight}{QFont::Bold}; otherwise sets the weight to \l{...
The QFrame class is the base class of widgets that can have a frame.
The QGridLayout class lays out widgets in a grid.
void setHorizontalSpacing(int spacing)
void addWidget(QWidget *w)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setRowMinimumHeight(int row, int minSize)
Sets the minimum height of row row to minSize pixels.
int rowCount() const
Returns the number of rows in this grid.
void addItem(QLayoutItem *item, int row, int column, int rowSpan=1, int columnSpan=1, Qt::Alignment=Qt::Alignment())
Adds item at position row, column, spanning rowSpan rows and columnSpan columns, and aligns it accord...
void setVerticalSpacing(int spacing)
void setRowStretch(int row, int stretch)
Sets the stretch factor of row row to stretch.
int columnCount() const
Returns the number of columns in this grid.
static QPlatformTheme * platformTheme()
static QPlatformNativeInterface * platformNativeInterface()
static QClipboard * clipboard()
Returns the object for interacting with the clipboard.
The QIcon class provides scalable icons in different modes and states.
bool isNull() const
Returns true if the icon is empty; otherwise returns false.
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.
The QKeyEvent class describes a key event.
The QKeySequence class encapsulates a key sequence as used by shortcuts.
The QLabel widget provides a text or image display.
QPixmap pixmap
the label's pixmap.
virtual bool hasHeightForWidth() const
Returns true if this layout's preferred height depends on its width; otherwise returns false.
int totalHeightForWidth(int w) const
void removeWidget(QWidget *w)
Removes the widget widget from the layout.
void setSizeConstraint(SizeConstraint)
bool activate()
Redoes the layout for parentWidget() if necessary.
QSize totalMinimumSize() const
void setContentsMargins(int left, int top, int right, int bottom)
qsizetype size() const noexcept
const_reference at(qsizetype i) const noexcept
T value(qsizetype i) const
QDialogButtonBox * buttonBox
QAbstractButton * abstractButtonForId(int id) const
QList< QAbstractButton * > customButtonList
void initHelper(QPlatformDialogHelper *) override
DetailButton * detailsButton
void _q_buttonClicked(QAbstractButton *)
int execReturnCode(QAbstractButton *button)
bool canBeNativeDialog() const override
void addOldButtons(int button0, int button1, int button2)
void retranslateStrings()
QLabel * informativeLabel
static QPixmap standardIcon(QMessageBox::Icon icon, QMessageBox *mb)
void init(const QString &title=QString(), const QString &text=QString())
QAbstractButton * clickedButton
QPushButton * defaultButton
int dialogCode() const override
QSharedPointer< QMessageDialogOptions > options
void setVisible(bool visible) override
QAbstractButton * escapeButton
QPointer< QObject > receiverToDisconnectOnClose
static int showOldMessageBox(QWidget *parent, QMessageBox::Icon icon, const QString &title, const QString &text, int button0, int button1, int button2)
QByteArray memberToDisconnectOnClose
void helperPrepareShow(QPlatformDialogHelper *) override
QAbstractButton * findButton(int button0, int button1, int button2, int flags)
void setClickedButton(QAbstractButton *button)
static QMessageBox::StandardButton standardButtonForRole(QMessageBox::ButtonRole role)
void detectEscapeButton()
static QMessageBox::StandardButton showNewMessageBox(QWidget *parent, QMessageBox::Icon icon, const QString &title, const QString &text, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton)
QAbstractButton * detectedEscapeButton
void _q_helperClicked(QPlatformDialogHelper::StandardButton button, QPlatformDialogHelper::ButtonRole role)
QByteArray signalToDisconnectOnClose
The QMessageBox class provides a modal dialog for informing the user or for asking the user a questio...
QList< QAbstractButton * > buttons() const
void closeEvent(QCloseEvent *event) override
\reimp
void changeEvent(QEvent *event) override
\reimp
void setEscapeButton(QAbstractButton *button)
bool testOption(Option option) const
void setStandardButtons(StandardButtons buttons)
void setWindowTitle(const QString &title)
static StandardButton warning(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
void buttonClicked(QAbstractButton *button)
This signal is emitted whenever a button is clicked inside the QMessageBox.
Qt::TextFormat textFormat
the format of the text displayed by the message box
StandardButtons standardButtons
collection of standard buttons in the message box
void keyPressEvent(QKeyEvent *event) override
\reimp
QMessageBox(QWidget *parent=nullptr)
Constructs an \l{Qt::ApplicationModal} {application modal} message box with no text and no buttons.
~QMessageBox()
Destroys the message box.
void addButton(QAbstractButton *button, ButtonRole role)
bool event(QEvent *e) override
\reimp
void removeButton(QAbstractButton *button)
void setInformativeText(const QString &text)
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 resizeEvent(QResizeEvent *event) override
\reimp
static StandardButton information(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
void setOptions(Options options)
void setTextFormat(Qt::TextFormat format)
static StandardButton critical(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
void showEvent(QShowEvent *event) override
\reimp
static void about(QWidget *parent, const QString &title, const QString &text)
Displays a simple about box with title title and text text.
QString text
the message box text to be displayed.
Icon icon
the message box's icon
QPushButton * defaultButton() const
Options options
options that affect the look and feel of the dialog
void setTextInteractionFlags(Qt::TextInteractionFlags flags)
void setWindowModality(Qt::WindowModality windowModality)
QAbstractButton * clickedButton() const
static StandardButton question(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=StandardButtons(Yes|No), StandardButton defaultButton=NoButton)
Icon
This enum has the following values:
void setIconPixmap(const QPixmap &pixmap)
Qt::TextInteractionFlags textInteractionFlags
void setCheckBox(QCheckBox *cb)
StandardButton standardButton(QAbstractButton *button) const
void setOption(Option option, bool on=true)
QPixmap iconPixmap
the current icon
QAbstractButton * escapeButton() const
ButtonRole buttonRole(QAbstractButton *button) const
void setText(const QString &text)
void setDefaultButton(QPushButton *button)
QString informativeText
the informative text that provides a fuller description for the message
QAbstractButton * button(StandardButton which) const
QCheckBox * checkBox() const
void setWindowTitle(const QString &)
void setInformativeText(const QString &text)
void setDetailedText(const QString &text)
void setText(const QString &text)
void setStandardButtons(QPlatformDialogHelper::StandardButtons buttons)
const CustomButton * customButton(int id)
void setCheckBox(const QString &label, Qt::CheckState state)
void setStandardIcon(StandardIcon icon)
void setIconPixmap(const QPixmap &pixmap)
T findChild(const QString &aName=QString(), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
Returns the child of this object that can be cast into type T and that is called name,...
QObject * parent() const
Returns a pointer to the parent object.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
virtual bool event(QEvent *event)
This virtual function receives events to an object and should return true if the event e was recogniz...
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
\threadsafe
Q_WEAK_OVERLOAD void setObjectName(const QString &name)
Sets the object's name to name.
qreal devicePixelRatio() const
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
bool isNull() const
Returns true if this is a null pixmap; otherwise returns false.
The QResizeEvent class contains event parameters for resize events.
The QShowEvent class provides an event that is sent when a widget is shown.
The QSizePolicy class is a layout attribute describing horizontal and vertical resizing policy.
constexpr void setHeightForWidth(bool b) noexcept
Sets the flag determining whether the widget's preferred height depends on its width,...
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
The QSpacerItem class provides blank space in a layout.
\macro QT_RESTRICTED_CAST_FROM_ASCII
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI.
virtual QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const =0
virtual QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *w=nullptr) const =0
Returns the size of the element described by the specified option and type, based on the provided con...
@ SH_MessageBox_CenterButtons
@ SH_MessageBox_TextInteractionFlags
@ SP_MessageBoxInformation
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const =0
Returns the value of the given pixel metric.
The QTextEdit class provides a widget that is used to edit and display both plain and rich text.
The QVBoxLayout class lines up widgets vertically.
static Q_CORE_EXPORT QVersionNumber fromString(QAnyStringView string, qsizetype *suffixIndex=nullptr)
Q_CORE_EXPORT QVersionNumber normalized() const
Returns an equivalent version number but with all trailing zeros removed.
Combined button and popup list for selecting options.
@ WA_WState_ExplicitShowHide
@ AA_DontUseNativeDialogs
Q_GUI_EXPORT bool mightBeRichText(const QString &)
Returns true if the string text is likely to be rich text; otherwise returns false.
static jboolean copy(JNIEnv *, jobject)
static jboolean selectAll(JNIEnv *, jobject)
FontHash * qt_app_fonts_hash()
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
static int oldButton(int button)
static QMessageDialogOptions::StandardIcon helperIcon(QMessageBox::Icon i)
static QMessageBox::StandardButton showNewMessageBox(QWidget *parent, QMessageBox::Icon icon, const QString &title, const QString &text, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton)
static QMessageBox::StandardButton newButton(int button)
static bool detectedCompat(int button0, int button1, int button2)
void qRequireVersion(int argc, char *argv[], QAnyStringView req)
static QPlatformDialogHelper::StandardButtons helperStandardButtons(QMessageBox *q)
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
GLuint64 GLenum void * handle
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint GLsizei const GLchar * label
[43]
GLuint GLsizei const GLchar * message
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
GLint GLsizei GLsizei GLenum format
GLfloat GLfloat GLfloat GLfloat h
GLdouble GLdouble GLdouble GLdouble q
static QT_BEGIN_NAMESPACE qreal dpr(const QWindow *w)
SSL_CTX int(* cb)(SSL *ssl, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
#define qUtf16Printable(string)
QLatin1StringView QLatin1String
#define QStringLiteral(str)
#define QT_CONFIG(feature)
QT_BEGIN_NAMESPACE Q_CORE_EXPORT Q_DECL_CONST_FUNCTION const char * qVersion(void) Q_DECL_NOEXCEPT
const char className[16]
[1]
if(qFloatDistance(a, b)<(1<< 7))
[0]
QMessageBox messageBox(this)
[2]
QGraphicsWidget * textEdit
myAction setIcon(SomeIcon)
insertRed setText("insert red text")
qsizetype indexOf(const AT &t, qsizetype from=0) const noexcept
bool contains(const AT &t) const noexcept
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent