KConfigWidgets
kconfigdialog.cpp
34 const QString dialogName = !name.isEmpty() ? name : QString::asprintf("SettingsDialog-%p", static_cast<void *>(q));
42 buttonBox->setStandardButtons(QDialogButtonBox::RestoreDefaults | QDialogButtonBox::Ok | QDialogButtonBox::Apply | QDialogButtonBox::Cancel
44 QObject::connect(buttonBox->button(QDialogButtonBox::Ok), &QAbstractButton::clicked, q, &KConfigDialog::updateSettings);
45 QObject::connect(buttonBox->button(QDialogButtonBox::Apply), &QAbstractButton::clicked, q, &KConfigDialog::updateSettings);
46 QObject::connect(buttonBox->button(QDialogButtonBox::Apply), &QAbstractButton::clicked, q, [this]() {
49 QObject::connect(buttonBox->button(QDialogButtonBox::Cancel), &QAbstractButton::clicked, q, &KConfigDialog::updateWidgets);
50 QObject::connect(buttonBox->button(QDialogButtonBox::RestoreDefaults), &QAbstractButton::clicked, q, &KConfigDialog::updateWidgetsDefault);
51 QObject::connect(buttonBox->button(QDialogButtonBox::RestoreDefaults), &QAbstractButton::clicked, q, [this]() {
54 QObject::connect(buttonBox->button(QDialogButtonBox::Help), &QAbstractButton::clicked, q, &KConfigDialog::showHelp);
66 KPageWidgetItem *addPageInternal(QWidget *page, const QString &itemName, const QString &pixmapName, const QString &header);
118KPageWidgetItem *KConfigDialog::addPage(QWidget *page, const QString &itemName, const QString &pixmapName, const QString &header, bool manage)
141KPageWidgetItem *KConfigDialog::addPage(QWidget *page, KCoreConfigSkeleton *config, const QString &itemName, const QString &pixmapName, const QString &header)
164KPageWidgetItem *KConfigDialogPrivate::addPageInternal(QWidget *page, const QString &itemName, const QString &pixmapName, const QString &header)
184 // We can only set the minimumSize(), so this approach relies on QStackedWidget size calculation.
185 scroll->setMinimumWidth(scroll->sizeHint().width() + qBound(0, scroll->verticalScrollBar()->sizeHint().width(), 200) + 4);
210 q->connect(buttonBox->button(QDialogButtonBox::Ok), &QPushButton::clicked, manager, &KConfigDialogManager::updateSettings);
211 q->connect(buttonBox->button(QDialogButtonBox::Apply), &QPushButton::clicked, manager, &KConfigDialogManager::updateSettings);
212 q->connect(buttonBox->button(QDialogButtonBox::Cancel), &QPushButton::clicked, manager, &KConfigDialogManager::updateWidgets);
213 q->connect(buttonBox->button(QDialogButtonBox::RestoreDefaults), &QPushButton::clicked, manager, &KConfigDialogManager::updateWidgetsDefault);
223 const bool hasManagerChanged = std::any_of(m_managerForPage.cbegin(), m_managerForPage.cend(), [](const WidgetManager &widgetManager) {
237 const bool isManagerDefaulted = std::all_of(m_managerForPage.cbegin(), m_managerForPage.cend(), [](const WidgetManager &widgetManager) {
241 restoreDefaultsButton->setDisabled(manager->isDefault() && q->isDefault() && isManagerDefaulted);
246 auto it = std::find_if(d->m_managerForPage.cbegin(), d->m_managerForPage.cend(), [item](const KConfigDialogPrivate::WidgetManager &wm) {
Provides a means of automatically retrieving, saving and resetting KConfigSkeleton based settings in ...
Definition kconfigdialogmanager.h:132
void updateWidgetsDefault()
Traverse the specified widgets, sets the state of all known widgets according to the default state in...
Definition kconfigdialogmanager.cpp:347
void widgetModified()
If retrieveSettings() was told to track changes then if any known setting was changed this signal wil...
void settingsChanged()
One or more of the settings have been saved (such as when the user clicks on the Apply button).
void updateWidgets()
Traverse the specified widgets, sets the state of all known widgets according to the state in the set...
Definition kconfigdialogmanager.cpp:308
bool hasChanged() const
Returns whether the current state of the known widgets are different from the state in the config obj...
Definition kconfigdialogmanager.cpp:539
void updateSettings()
Traverse the specified widgets, saving the settings of all known widgets in the settings object.
Definition kconfigdialogmanager.cpp:360
bool isDefault() const
Returns whether the current state of the known widgets are the same as the default state in the confi...
Definition kconfigdialogmanager.cpp:561
virtual bool isDefault()
Returns whether the current state of the dialog is the same as the default configuration.
Definition kconfigdialog.cpp:332
KConfigDialog(QWidget *parent, const QString &name, KCoreConfigSkeleton *config)
Definition kconfigdialog.cpp:99
static bool showDialog(const QString &name)
Attempts to show the dialog with the name 'name'.
Definition kconfigdialog.cpp:267
KPageWidgetItem * addPage(QWidget *page, const QString &itemName, const QString &pixmapName=QString(), const QString &header=QString(), bool manage=true)
Adds page to the dialog and to KConfigDialogManager.
Definition kconfigdialog.cpp:118
~KConfigDialog() override
Deconstructor, removes name from the list of open dialogs.
Definition kconfigdialog.cpp:105
static KConfigDialog * exists(const QString &name)
See if a dialog with the name 'name' already exists.
Definition kconfigdialog.cpp:257
virtual bool hasChanged()
Returns whether the current state of the dialog is different from the current configuration.
Definition kconfigdialog.cpp:327
virtual void updateWidgets()
Update the dialog based on the settings.
Definition kconfigdialog.cpp:319
void settingsChanged(const QString &dialogName)
One or more of the settings have been permanently changed such as if the user clicked on the Apply or...
void setHelp(const QString &anchor, const QString &appname=QString())
Sets the help path and topic.
Definition kconfigdialog.cpp:347
virtual void updateWidgetsDefault()
Update the dialog based on the default settings.
Definition kconfigdialog.cpp:323
QDialogButtonBox * buttonBox()
void pageRemoved(KPageWidgetItem *page)
void setFaceType(FaceType faceType)
void setIcon(const QIcon &icon)
void setHeader(const QString &header)
QString i18nc(const char *context, const char *text, const TYPE &arg...)
void invokeHelp(const QString &anchor=QString(), const QString &appname=QString())
Invokes the KHelpCenter HTML help viewer from docbook sources.
Definition khelpclient.cpp:17
QString name(StandardAction id)
void clicked(bool checked)
void setHorizontalScrollBarPolicy(Qt::ScrollBarPolicy)
QScrollBar * verticalScrollBar() const const
void setVerticalScrollBarPolicy(Qt::ScrollBarPolicy)
void addWidget(QWidget *widget, int stretch, Qt::Alignment alignment)
virtual void showEvent(QShowEvent *event) override
RestoreDefaults
QPushButton * button(StandardButton which) const const
void setStandardButtons(StandardButtons buttons)
NoFrame
void setFrameShape(Shape)
QIcon fromTheme(const QString &name)
void setContentsMargins(const QMargins &margins)
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
objectName
void setObjectName(QAnyStringView name)
void setWidget(QWidget *widget)
virtual QSize sizeHint() const const override
void setWidgetResizable(bool resizable)
virtual QSize sizeHint() const const override
int height() const const
int width() const const
MinimumExpanding
QString asprintf(const char *cformat,...)
bool isEmpty() const const
ScrollBarAsNeeded
bool isEnabled() const const
minimumSizeHint
void setMinimumWidth(int minw)
void setDisabled(bool disable)
void show()
sizeHint
void setSizePolicy(QSizePolicy)
void setWindowTitle(const QString &)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:07:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:07:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.