Changeset View
Changeset View
Standalone View
Standalone View
src/kcmoduleqml.cpp
Show First 20 Lines • Show All 174 Lines • ▼ Show 20 Line(s) | 168 | if (d->pageRow) { | |||
---|---|---|---|---|---|
175 | connect(d->configModule.get(), &KQuickAddons::ConfigModule::pageRemoved, this, [this]() { | 175 | connect(d->configModule.get(), &KQuickAddons::ConfigModule::pageRemoved, this, [this]() { | ||
176 | QMetaObject::invokeMethod(d->pageRow, "pop", Qt::DirectConnection, Q_ARG(QVariant, QVariant())); | 176 | QMetaObject::invokeMethod(d->pageRow, "pop", Qt::DirectConnection, Q_ARG(QVariant, QVariant())); | ||
177 | } | 177 | } | ||
178 | ); | 178 | ); | ||
179 | connect(d->configModule.get(), &KQuickAddons::ConfigModule::currentIndexChanged, this, [this]() { | 179 | connect(d->configModule.get(), &KQuickAddons::ConfigModule::currentIndexChanged, this, [this]() { | ||
180 | d->pageRow->setProperty("currentIndex", d->configModule->currentIndex()); | 180 | d->pageRow->setProperty("currentIndex", d->configModule->currentIndex()); | ||
181 | } | 181 | } | ||
182 | ); | 182 | ); | ||
183 | connect(d->configModule.get(), &KQuickAddons::ConfigModule::passiveNotificationRequested, this, [this](const QString &message, const QVariant &timeout, const QString &actionText, const QJSValue &callBack) { | ||||
184 | d->rootPlaceHolder->metaObject()->invokeMethod(d->rootPlaceHolder, "showPassiveNotification", Q_ARG(QVariant, message), Q_ARG(QVariant, timeout), Q_ARG(QVariant, actionText), Q_ARG(QVariant, QVariant::fromValue(callBack))); | ||||
185 | } | ||||
186 | ); | ||||
183 | //New syntax cannot be used to connect to QML types | 187 | //New syntax cannot be used to connect to QML types | ||
184 | connect(d->pageRow, SIGNAL(currentIndexChanged()), this, SLOT(syncCurrentIndex())); | 188 | connect(d->pageRow, SIGNAL(currentIndexChanged()), this, SLOT(syncCurrentIndex())); | ||
185 | 189 | | |||
186 | auto syncColumnWidth = [this](){ | 190 | auto syncColumnWidth = [this](){ | ||
187 | d->pageRow->setProperty("defaultColumnWidth", d->configModule->columnWidth() > 0 ? d->configModule->columnWidth() : d->rootPlaceHolder->width()); | 191 | d->pageRow->setProperty("defaultColumnWidth", d->configModule->columnWidth() > 0 ? d->configModule->columnWidth() : d->rootPlaceHolder->width()); | ||
188 | }; | 192 | }; | ||
189 | syncColumnWidth(); | 193 | syncColumnWidth(); | ||
190 | 194 | | |||
▲ Show 20 Lines • Show All 141 Lines • Show Last 20 Lines |