10#if QT_CONFIG(messagebox)
85 options->setWindowTitle(
q->windowTitle());
86 options->setText(QErrorMessage::tr(
"An error occurred"));
90 messageDialogHelper->setOptions(options);
94class QErrorMessageTextView :
public QTextEdit
100 virtual QSize minimumSizeHint()
const override;
101 virtual QSize sizeHint()
const override;
105QSize QErrorMessageTextView::minimumSizeHint()
const
107 return QSize(50, 50);
110QSize QErrorMessageTextView::sizeHint()
const
112 return QSize(250, 75);
176 const char *
const messages[] = {
183 Q_ASSERT(
size_t(
t) <
sizeof messages /
sizeof *messages);
192 const auto forwardToOriginalHandler =
qScopeGuard([&] {
201 if (
context.category && defaultCategory
202 &&
qstrcmp(
context.category, defaultCategory->categoryName()) != 0)
240#if defined(Q_OS_MACOS)
245 d->errors =
new QErrorMessageTextView(
this);
259#if QT_CONFIG(messagebox)
263 d->again->setChecked(
true);
266 d->retranslateStrings();
279 if (currentMessagHandler !=
jump)
293 if (!
d->again->isChecked()) {
294 if (
d->currentType.isEmpty()) {
295 if (!
d->currentMessage.isEmpty())
296 d->doNotShow.insert(
d->currentMessage);
298 d->doNotShowType.insert(
d->currentType);
301 d->currentMessage.clear();
302 d->currentType.clear();
306 if (
d->nextPending()) {
354#ifndef QT_NO_TEXTHTMLPARSER
431 d->retranslateStrings();
438 again->
setText(QErrorMessage::tr(
"&Show this message again"));
444#include "moc_qerrormessage.cpp"
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.
static QString translate(const char *context, const char *key, const char *disambiguation=nullptr, int n=-1)
\threadsafe
QString applicationName
the name of this application
bool setNativeDialogVisible(bool visible)
virtual void setVisible(bool visible)
virtual bool canBeNativeDialog() const
The QDialog class is the base class of dialog windows.
friend class QPushButton
[1]
virtual void done(int)
Closes the dialog and sets its result code to r.
virtual void accept()
Hides the modal dialog and sets the result code to Accepted.
void helperPrepareShow(QPlatformDialogHelper *) override
void retranslateStrings()
void initHelper(QPlatformDialogHelper *) override
QSet< QString > doNotShowType
bool isMessageToBeShown(const QString &message, const QString &type) const
std::queue< Message > pending
void setVisible(bool) override
QSet< QString > doNotShow
The QErrorMessage class provides an error message display dialog.
static QErrorMessage * qtHandler()
Returns a pointer to a QErrorMessage object that outputs the default Qt messages.
void showMessage(const QString &message)
Shows the given message, message, and returns immediately.
void changeEvent(QEvent *e) override
\reimp
QErrorMessage(QWidget *parent=nullptr)
Constructs and installs an error handler window with the given parent.
~QErrorMessage()
Destroys the error message dialog.
The QGridLayout class lays out widgets in a grid.
void addWidget(QWidget *w)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setRowStretch(int row, int stretch)
Sets the stretch factor of row row to stretch.
void setColumnStretch(int column, int stretch)
Sets the stretch factor of column column to stretch.
The QLabel widget provides a text or image display.
static QLoggingCategory * defaultCategory()
Returns a pointer to the global category "default" that is used, for example, by qDebug(),...
static QSharedPointer< QMessageDialogOptions > create()
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
bool contains(const T &value) const
\macro QT_RESTRICTED_CAST_FROM_ASCII
void chop(qsizetype n)
Removes n characters from the end of the string.
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
@ SP_MessageBoxInformation
The QTextEdit class provides a widget that is used to edit and display both plain and rich text.
void setReadOnly(bool ro)
void setPlainText(const QString &text)
Changes the text of the text edit to the string text.
void setHtml(const QString &text)
static QThread * currentThread()
QtMessageHandler qInstallMessageHandler(QtMessageHandler h)
Combined button and popup list for selecting options.
@ WA_WState_ExplicitShowHide
Q_GUI_EXPORT QString convertFromPlainText(const QString &plain, WhiteSpaceMode mode=WhiteSpacePre)
Converts the plain text string plain to an HTML-formatted paragraph while preserving most of its look...
Q_CORE_EXPORT int qstrcmp(const char *str1, const char *str2)
void qAddPostRoutine(QtCleanUpFunction p)
static QString msgType2i18nString(QtMsgType t)
static void deleteStaticcQErrorMessage()
static QErrorMessage * qtMessageHandler
static QtMessageHandler originalMessageHandler
static void jump(QtMsgType t, const QMessageLogContext &context, const QString &m)
void(* QtMessageHandler)(QtMsgType, const QMessageLogContext &, const QString &)
#define Q_ARG(Type, data)
GLboolean GLboolean GLboolean GLboolean a
[7]
GLuint GLsizei const GLchar * message
GLdouble GLdouble GLdouble GLdouble q
QScopeGuard< typename std::decay< F >::type > qScopeGuard(F &&f)
[qScopeGuard]
#define QT_TRANSLATE_NOOP(scope, x)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent