7#include "icondialog_p.h"
10#include <QQuickWindow>
14#include <QApplication>
16IconDialog::IconDialog(
QObject *parent)
25 connect(m_dialog.data(), &KIconDialog::newIconName,
this, [
this](
const QString &newIconName) {
26 if (m_iconName != newIconName) {
27 m_iconName = newIconName;
28 Q_EMIT iconNameChanged(newIconName);
36IconDialog::~IconDialog()
43QString IconDialog::iconName()
const
48int IconDialog::iconSize()
const
53void IconDialog::setIconSize(
int iconSize)
55 if (m_dialog->iconSize() != iconSize) {
56 m_iconSize = iconSize;
57 Q_EMIT iconSizeChanged(iconSize);
61QString IconDialog::title()
const
63 return m_dialog->windowTitle();
66void IconDialog::setTitle(
const QString &title)
68 if (m_dialog->windowTitle() != title) {
69 m_dialog->setWindowTitle(title);
70 Q_EMIT titleChanged(title);
74bool IconDialog::user()
const
79void IconDialog::setUser(
bool user)
83 Q_EMIT userChanged(user);
87QString IconDialog::customLocation()
const
89 return m_customLocation;
92void IconDialog::setCustomLocation(
const QString &customLocation)
94 if (m_customLocation != customLocation) {
95 m_dialog->setCustomLocation(customLocation);
97 m_customLocation = customLocation;
98 Q_EMIT customLocationChanged(customLocation);
109 if (m_modality != modality) {
110 m_modality = modality;
111 Q_EMIT modalityChanged(modality);
115bool IconDialog::visible()
const
117 return m_dialog->isVisible();
120void IconDialog::setVisible(
bool visible)
129void IconDialog::open()
131 if (m_dialog->isVisible()) {
135 QQuickItem *parentItem = qobject_cast<QQuickItem *>(parent());
136 QQuickWindow *parentWindow = (parentItem ? parentItem->
window() : qobject_cast<QQuickWindow *>(parent()));
139 m_dialog->setModal(
false);
142 m_dialog->windowHandle()->setTransientParent(parentWindow);
143 m_dialog->setModal(
false);
145 m_dialog->setModal(
true);
148 m_dialog->setWindowModality(m_modality);
155void IconDialog::close()
157 if (!m_dialog->isVisible()) {
167 Q_EMIT visibleChanged();
173#include "moc_icondialog_p.cpp"
Dialog for interactive selection of icons.
@ Application
An icon that represents an application.
AKONADI_CALENDAR_EXPORT KCalendarCore::Event::Ptr event(const Akonadi::Item &item)
const QList< QKeySequence > & close()
const QList< QKeySequence > & open()
QCoreApplication * instance()
void installEventFilter(QObject *filterObj)
QQuickWindow * window() const const
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)