KWidgetsAddons
kmessagebox.cpp
41QDialogButtonBox::StandardButton KWIDGETSADDONS_EXPORT (*KMessageBox_exec_hook)(QDialog *) = nullptr;
153 return createKMessageBox(dialog, buttons, tmpIcon, text, strlist, ask, checkboxReturn, options, details, icon);
169 // install the qm translation of the knotifications library which will cause a LanguageChange event to be sent
170 // Which will end up in QDialogButtonBoxPrivate::retranslateStrings and will overwrite the texts
172 // For people wondering if they can remove this bit of code later, this seems to only be an issue
173 // in non Plasma desktops, emulate by running something like XDG_CURRENT_DESKTOP=X-Cinnamon okular
174 // on plasma desktops the platform plugin already uses knotifications so it's qm has been loaded on startup
193 const int horizontalSpacing = mainWidget->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing);
208 iconLabel->setPixmap(icon.pixmap(mainWidget->style()->pixelMetric(QStyle::PM_MessageBoxIconSize, &option, mainWidget)));
274 const int borderWidth = listWidget->width() - listWidget->viewport()->width() + listWidget->verticalScrollBar()->height();
375 const QDialogButtonBox::StandardButton result = QDialogButtonBox::StandardButton(guardedDialog->exec());
392 return questionTwoActionsList(parent, text, QStringList(), title, primaryAction, secondaryAction, dontAskAgainName, options);
458 dialog->setWindowTitle(title.isEmpty() ? QApplication::translate("KMessageBox", "Question") : title);
474 dontAskAgainName.isEmpty() ? QString() : QApplication::translate("KMessageBox", "Do not ask again"),
494 return questionTwoActionsListInternal(new QDialog(parent), text, strlist, title, primaryAction, secondaryAction, dontAskAgainName, options);
513 dialog->setWindowTitle(title.isEmpty() ? QApplication::translate("KMessageBox", "Question") : title);
517 buttonBox->setStandardButtons(QDialogButtonBox::Yes | QDialogButtonBox::No | QDialogButtonBox::Cancel);
530 dontAskAgainName.isEmpty() ? QString() : QApplication::translate("KMessageBox", "Do not ask again"),
557 return questionTwoActionsCancelInternal(new QDialog(parent), text, title, primaryAction, secondaryAction, cancelAction, dontAskAgainName, options);
568 return warningTwoActionsList(parent, text, QStringList(), title, primaryAction, secondaryAction, dontAskAgainName, options);
587 dialog->setWindowTitle(title.isEmpty() ? QApplication::translate("KMessageBox", "Warning") : title);
603 dontAskAgainName.isEmpty() ? QString() : QApplication::translate("KMessageBox", "Do not ask again"),
623 return warningTwoActionsListInternal(new QDialog(parent), text, strlist, title, primaryAction, secondaryAction, dontAskAgainName, options);
634 return warningContinueCancelList(parent, text, QStringList(), title, buttonContinue, buttonCancel, dontAskAgainName, options);
653 dialog->setWindowTitle(title.isEmpty() ? QApplication::translate("KMessageBox", "Warning") : title);
669 dontAskAgainName.isEmpty() ? QString() : QApplication::translate("KMessageBox", "Do not ask again"),
704 return warningContinueCancelListInternal(new QDialog(parent), text, QStringList(), title, buttonContinue, buttonCancel, dontAskAgainName, options, details);
716 return warningTwoActionsCancelList(parent, text, QStringList(), title, primaryAction, secondaryAction, cancelAction, dontAskAgainName, options);
736 dialog->setWindowTitle(title.isEmpty() ? QApplication::translate("KMessageBox", "Warning") : title);
740 buttonBox->setStandardButtons(QDialogButtonBox::Yes | QDialogButtonBox::No | QDialogButtonBox::Cancel);
753 dontAskAgainName.isEmpty() ? QString() : QApplication::translate("KMessageBox", "Do not ask again"),
793static void errorInternal(QDialog *dialog, const QString &text, const QString &title, const KGuiItem &buttonOk, Options options)
795 dialog->setWindowTitle(title.isEmpty() ? QApplication::translate("KMessageBox", "Error") : title);
804 createKMessageBox(dialog, buttonBox, QMessageBox::Critical, text, QStringList(), QString(), nullptr, options);
818static void errorListInternal(QDialog *dialog, const QString &text, const QStringList &strlist, const QString &title, Options options)
820 dialog->setWindowTitle(title.isEmpty() ? QApplication::translate("KMessageBox", "Error") : title);
828 createKMessageBox(dialog, buttonBox, QMessageBox::Critical, text, strlist, QString(), nullptr, options);
837static void detailedErrorInternal(QDialog *dialog, const QString &text, const QString &details, const QString &title, const KGuiItem &buttonOk, Options options)
839 dialog->setWindowTitle(title.isEmpty() ? QApplication::translate("KMessageBox", "Error") : title);
849 createKMessageBox(dialog, buttonBox, QMessageBox::Critical, text, QStringList(), QString(), nullptr, options, details);
852void detailedError(QWidget *parent, const QString &text, const QString &details, const QString &title, Options options)
854 detailedErrorInternal(new QDialog(parent), text, details, title, KStandardGuiItem::ok(), options);
880 dialog->setWindowTitle(title.isEmpty() ? QApplication::translate("KMessageBox", "Information") : title);
895 dontShowAgainName.isEmpty() ? QString() : QApplication::translate("KMessageBox", "Do not show this message again"),
904void informationList(QWidget *parent, const QString &text, const QStringList &strlist, const QString &title, const QString &dontShowAgainName, Options options)
922 return questionTwoActionsListInternal(dialog, text, QStringList(), title, primaryAction, secondaryAction, dontShow, options);
924 return questionTwoActionsCancelInternal(dialog, text, title, primaryAction, secondaryAction, cancelAction, dontShow, options);
926 return warningTwoActionsListInternal(dialog, text, QStringList(), title, primaryAction, secondaryAction, dontShow, options);
938 return warningTwoActionsCancelListInternal(dialog, text, QStringList(), title, primaryAction, secondaryAction, cancelAction, dontShow, options);
960 return messageBoxInternal(new QDialog(parent), type, text, title, primaryAction, secondaryAction, buttonCancel, dontShow, options);
971 return questionTwoActionsListWId(parent_id, text, QStringList(), title, primaryAction, secondaryAction, dontAskAgainName, options);
1006 return warningTwoActionsListWId(parent_id, text, QStringList(), title, primaryAction, secondaryAction, dontAskAgainName, options);
1029 return warningContinueCancelListWId(parent_id, text, QStringList(), title, buttonContinue, buttonCancel, dontAskAgainName, options);
1061 return warningTwoActionsCancelListWId(parent_id, text, QStringList(), title, primaryAction, secondaryAction, buttonCancel, dontAskAgainName, options);
1090void errorListWId(WId parent_id, const QString &text, const QStringList &strlist, const QString &title, Options options)
1095void detailedErrorWId(WId parent_id, const QString &text, const QString &details, const QString &title, Options options)
1097 detailedErrorInternal(createWIdDialog(parent_id), text, details, title, KStandardGuiItem::ok(), options);
1105void informationWId(WId parent_id, const QString &text, const QString &title, const QString &dontShowAgainName, Options options)
1110void informationListWId(WId parent_id, const QString &text, const QStringList &strlist, const QString &title, const QString &dontShowAgainName, Options options)
A groupbox featuring a clickable header and arrow indicator that can be expanded and collapsed to rev...
Definition kcollapsiblegroupbox.h:26
void setTitle(const QString &title)
Set the title that will be permanently shown at the top of the collapsing box Mnemonics are supported...
Definition kcollapsiblegroupbox.cpp:70
An abstract class for setting the text, icon, tooltip and WhatsThis data on a GUI item (e....
Definition kguiitem.h:34
static void assign(QPushButton *button, const KGuiItem &item)
A static method that can be used to set the text, icon, tooltip and WhatThis properties from item on ...
Definition kguiitem.cpp:172
A replacement for QLabel that squeezes its text into the label.
Definition ksqueezedtextlabel.h:54
void saveDontShowAgainTwoActions(const QString &dontShowAgainName, ButtonCode result)
Save the fact that a two actions message box should not be shown again.
Definition kmessagebox.cpp:411
ButtonCode warningContinueCancel(QWidget *parent, const QString &text, const QString &title, const KGuiItem &buttonContinue, const KGuiItem &buttonCancel, const QString &dontAskAgainName, Options options)
Display a "warning" dialog.
Definition kmessagebox.cpp:626
ButtonCode warningTwoActionsCancelListWId(WId parent_id, const QString &text, const QStringList &strlist, const QString &title, const KGuiItem &primaryAction, const KGuiItem &secondaryAction, const KGuiItem &buttonCancel, const QString &dontAskAgainName, Options options)
This function accepts the window id of the parent window, instead of QWidget*.
Definition kmessagebox.cpp:1064
void error(QWidget *parent, const QString &text, const QString &title, Options options)
Display an "Error" dialog.
Definition kmessagebox.cpp:807
ButtonCode warningTwoActionsListWId(WId parent_id, const QString &text, const QStringList &strlist, const QString &title, const KGuiItem &primaryAction, const KGuiItem &secondaryAction, const QString &dontAskAgainName, Options options)
This function accepts the window id of the parent window, instead of QWidget*.
Definition kmessagebox.cpp:1009
ButtonCode warningContinueCancelListWId(WId parent_id, const QString &text, const QStringList &strlist, const QString &title, const KGuiItem &buttonContinue, const KGuiItem &buttonCancel, const QString &dontAskAgainName, Options options)
This function accepts the window id of the parent window, instead of QWidget*.
Definition kmessagebox.cpp:1032
ButtonCode messageBoxWId(WId parent_id, DialogType type, const QString &text, const QString &title, const KGuiItem &primaryAction, const KGuiItem &secondaryAction, const KGuiItem &cancelAction, const QString &dontShow, Options options)
This function accepts the window id of the parent window, instead of QWidget*.
Definition kmessagebox.cpp:1115
void saveDontShowAgainContinue(const QString &dontShowAgainName)
Save the fact that the continue/cancel message box should not be shown again.
Definition kmessagebox.cpp:419
ButtonCode questionTwoActionsWId(WId parent_id, const QString &text, const QString &title, const KGuiItem &primaryAction, const KGuiItem &secondaryAction, const QString &dontAskAgainName, Options options)
This function accepts the window id of the parent window, instead of QWidget*.
Definition kmessagebox.cpp:963
void errorList(QWidget *parent, const QString &text, const QStringList &strlist, const QString &title, Options options)
Display an "Error" dialog with a listbox.
Definition kmessagebox.cpp:831
ButtonCode warningTwoActions(QWidget *parent, const QString &text, const QString &title, const KGuiItem &primaryAction, const KGuiItem &secondaryAction, const QString &dontAskAgainName, Options options)
Display a "warning" dialog with two action buttons.
Definition kmessagebox.cpp:560
void enableAllMessages()
Enable all messages which have been turned off with the dontShowAgainName feature.
Definition kmessagebox.cpp:427
ButtonCode questionTwoActionsCancelWId(WId parent_id, const QString &text, const QString &title, const KGuiItem &primaryAction, const KGuiItem &secondaryAction, const KGuiItem &cancelAction, const QString &dontAskAgainName, Options options)
This function accepts the window id of the parent window, instead of QWidget*.
Definition kmessagebox.cpp:986
ButtonCode warningTwoActionsWId(WId parent_id, const QString &text, const QString &title, const KGuiItem &primaryAction, const KGuiItem &secondaryAction, const QString &dontAskAgainName, Options options)
This function accepts the window id of the parent window, instead of QWidget*.
Definition kmessagebox.cpp:998
ButtonCode warningTwoActionsList(QWidget *parent, const QString &text, const QStringList &strlist, const QString &title, const KGuiItem &primaryAction, const KGuiItem &secondaryAction, const QString &dontAskAgainName, Options options)
Display a "warning" dialog with a listbox to show information to the user and two action buttons.
Definition kmessagebox.cpp:614
void errorWId(WId parent_id, const QString &text, const QString &title, Options options)
This function accepts the window id of the parent window, instead of QWidget*.
Definition kmessagebox.cpp:1085
void informationList(QWidget *parent, const QString &text, const QStringList &strlist, const QString &title, const QString &dontShowAgainName, Options options)
Display an "Information" dialog with a listbox.
Definition kmessagebox.cpp:904
void informationListWId(WId parent_id, const QString &text, const QStringList &strlist, const QString &title, const QString &dontShowAgainName, Options options)
This function accepts the window id of the parent window, instead of QWidget*.
Definition kmessagebox.cpp:1110
ButtonCode warningContinueCancelList(QWidget *parent, const QString &text, const QStringList &strlist, const QString &title, const KGuiItem &buttonContinue, const KGuiItem &buttonCancel, const QString &dontAskAgainName, Options options)
Display a "warning" dialog with a listbox to show information to the user.
Definition kmessagebox.cpp:683
void detailedErrorWId(WId parent_id, const QString &text, const QString &details, const QString &title, Options options)
This function accepts the window id of the parent window, instead of QWidget*.
Definition kmessagebox.cpp:1095
void informationWId(WId parent_id, const QString &text, const QString &title, const QString &dontShowAgainName, Options options)
This function accepts the window id of the parent window, instead of QWidget*.
Definition kmessagebox.cpp:1105
void information(QWidget *parent, const QString &text, const QString &title, const QString &dontShowAgainName, Options options)
Display an "Information" dialog.
Definition kmessagebox.cpp:862
bool shouldBeShownContinue(const QString &dontShowAgainName)
Definition kmessagebox.cpp:403
ButtonCode questionTwoActionsList(QWidget *parent, const QString &text, const QStringList &strlist, const QString &title, const KGuiItem &primaryAction, const KGuiItem &secondaryAction, const QString &dontAskAgainName, Options options)
Display a "question" dialog with a listbox to show information to the user and two action buttons.
Definition kmessagebox.cpp:485
ButtonCode messageBox(QWidget *parent, DialogType type, const QString &text, const QString &title, const KGuiItem &primaryAction, const KGuiItem &secondaryAction, const KGuiItem &buttonCancel, const QString &dontShow, Options options)
Alternate method to show a messagebox:
Definition kmessagebox.cpp:950
bool shouldBeShownTwoActions(const QString &dontShowAgainName, ButtonCode &result)
Definition kmessagebox.cpp:395
ButtonCode warningContinueCancelDetailed(QWidget *parent, const QString &text, const QString &title, const KGuiItem &buttonContinue, const KGuiItem &buttonCancel, const QString &dontAskAgainName, Options options, const QString &details)
Display a "warning" dialog with a collapsible "Details" section.
Definition kmessagebox.cpp:695
ButtonCode questionTwoActionsCancel(QWidget *parent, const QString &text, const QString &title, const KGuiItem &primaryAction, const KGuiItem &secondaryAction, const KGuiItem &cancelAction, const QString &dontAskAgainName, Options options)
Display a "question" dialog with two action buttons and a cancel button.
Definition kmessagebox.cpp:548
ButtonCode warningTwoActionsCancelWId(WId parent_id, const QString &text, const QString &title, const KGuiItem &primaryAction, const KGuiItem &secondaryAction, const KGuiItem &buttonCancel, const QString &dontAskAgainName, Options options)
This function accepts the window id of the parent window, instead of QWidget*.
Definition kmessagebox.cpp:1052
QDialogButtonBox::StandardButton createKMessageBox(QDialog *dialog, QDialogButtonBox *buttons, QMessageBox::Icon icon, const QString &text, const QStringList &strlist, const QString &ask, bool *checkboxReturn, Options options, const QString &details)
Create content and layout of a standard dialog.
Definition kmessagebox.cpp:124
@ WindowModal
The window is to be modal relative to its parent. By default, it is application modal.
Definition kmessagebox.h:76
@ Dangerous
The action to be confirmed by the dialog is a potentially destructive one.
Definition kmessagebox.h:73
ButtonCode warningTwoActionsCancelList(QWidget *parent, const QString &text, const QStringList &strlist, const QString &title, const KGuiItem &primaryAction, const KGuiItem &secondaryAction, const KGuiItem &cancelAction, const QString &dontAskAgainName, Options options)
Display a "warning" dialog with a listbox to show information to the user, two action buttons and a c...
Definition kmessagebox.cpp:771
ButtonCode warningContinueCancelWId(WId parent_id, const QString &text, const QString &title, const KGuiItem &buttonContinue, const KGuiItem &buttonCancel, const QString &dontAskAgainName, Options options)
This function accepts the window id of the parent window, instead of QWidget*.
Definition kmessagebox.cpp:1021
void detailedError(QWidget *parent, const QString &text, const QString &details, const QString &title, Options options)
Displays an "Error" dialog with a "Details >>" button.
Definition kmessagebox.cpp:852
void errorListWId(WId parent_id, const QString &text, const QStringList &strlist, const QString &title, Options options)
This function accepts the window id of the parent window, instead of QWidget*.
Definition kmessagebox.cpp:1090
void setDontShowAgainConfig(KConfig *cfg)
Use cfg for all settings related to the dontShowAgainName feature.
Definition kmessagebox.cpp:437
ButtonCode questionTwoActions(QWidget *parent, const QString &text, const QString &title, const KGuiItem &primaryAction, const KGuiItem &secondaryAction, const QString &dontAskAgainName, Options options)
Display a "question" dialog with two action buttons.
Definition kmessagebox.cpp:384
ButtonCode questionTwoActionsListWId(WId parent_id, const QString &text, const QStringList &strlist, const QString &title, const KGuiItem &primaryAction, const KGuiItem &secondaryAction, const QString &dontAskAgainName, Options options)
This function accepts the window id of the parent window, instead of QWidget*.
Definition kmessagebox.cpp:974
ButtonCode warningTwoActionsCancel(QWidget *parent, const QString &text, const QString &title, const KGuiItem &primaryAction, const KGuiItem &secondaryAction, const KGuiItem &cancelAction, const QString &dontAskAgainName, Options options)
Display a "warning" dialog with two action buttons and a cancel button.
Definition kmessagebox.cpp:707
void enableMessage(const QString &dontShowAgainName)
Re-enable a specific dontShowAgainName messages that had previously been turned off.
Definition kmessagebox.cpp:432
NoSelection
void setSelectionMode(QAbstractItemView::SelectionMode mode)
QScrollBar * verticalScrollBar() const const
QWidget * viewport() const const
QStyle * style()
void addLayout(QLayout *layout, int stretch)
void addSpacing(int size)
void addStretch(int stretch)
void addWidget(QWidget *widget, int stretch, Qt::Alignment alignment)
virtual void setSpacing(int spacing) override
bool setStretchFactor(QLayout *layout, int stretch)
virtual QSize sizeHint() const const override
void processEvents(QEventLoop::ProcessEventsFlags flags)
QString translate(const char *context, const char *sourceText, const char *disambiguation, int n)
virtual void done(int r)
void setModal(bool modal)
virtual QSize sizeHint() const const override
StandardButton
QPushButton * addButton(StandardButton button)
QPushButton * button(StandardButton which) const const
QList< QAbstractButton * > buttons() const const
void clicked(QAbstractButton *button)
StandardButton standardButton(QAbstractButton *button) const const
void setStandardButtons(StandardButtons buttons)
QRect boundingRect(QChar ch) const const
int lineSpacing() const const
NoFrame
void setFrameShape(Shape)
QPixmap pixmap(QWindow *window, const QSize &size, Mode mode, State state) const const
bool isNull() const const
void setOpenExternalLinks(bool open)
void setPixmap(const QPixmap &)
virtual QSize sizeHint() const const override
void setTextInteractionFlags(Qt::TextInteractionFlags flags)
void setWordWrap(bool on)
SetFixedSize
void setContentsMargins(const QMargins &margins)
void setSizeConstraint(SizeConstraint)
bool isEmpty() const const
void addItems(const QStringList &labels)
const_iterator constBegin() const const
const_iterator constEnd() const const
QObject(QObject *parent)
Q_OBJECTQ_OBJECT
Q_SLOTSQ_SLOTS
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
void deleteLater()
void destroyed(QObject *obj)
void setObjectName(QAnyStringView name)
Window
void setColor(ColorGroup group, ColorRole role, const QColor &color)
void setDefault(bool)
int height() const const
int width() const const
geometry
void setWidget(QWidget *widget)
void setWidgetResizable(bool resizable)
int height() const const
int width() const const
Preferred
bool isEmpty() const const
qsizetype length() const const
QString join(QChar separator) const const
PM_LayoutVerticalSpacing
SP_MessageBoxInformation
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const const=0
virtual QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const const=0
void initFrom(const QWidget *widget)
transparent
typedef TextInteractionFlags
WA_NativeWindow
WindowModal
Dialog
void setReadOnly(bool ro)
void setText(const QString &text)
QWidget * topLevelWidget() const const
bool isEnabled() const const
QWidget * find(WId id)
QFontMetrics fontMetrics() const const
height
void setMinimumHeight(int minh)
void setMinimumSize(const QSize &)
void setMinimumWidth(int minw)
palette
QScreen * screen() const const
void setAttribute(Qt::WidgetAttribute attribute, bool on)
void setFixedSize(const QSize &s)
void setFocus()
void setParent(QWidget *parent)
void setSizePolicy(QSizePolicy)
QStyle * style() const const
width
QWindow * windowHandle() const const
void setWindowModality(Qt::WindowModality windowModality)
void setWindowTitle(const QString &)
QWindow * fromWinId(WId id)
void setTransientParent(QWindow *parent)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:11:51 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:11:51 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.