Connect changed from QML to the C++ side
Connected in the view and further emited as a signal our KCM connects to.
This commit is contained in:
parent
befb2b8e8a
commit
aa39bb192f
3 changed files with 7 additions and 0 deletions
|
@ -55,6 +55,9 @@ KWinCompositingKCM::KWinCompositingKCM(QWidget* parent, const QVariantList& args
|
|||
setLayout(vl);
|
||||
m_view->setWidth(width());
|
||||
m_view->setHeight(height());
|
||||
connect(m_view.data(), &KWin::Compositing::EffectView::changed, [this]{
|
||||
emit changed(true);
|
||||
});
|
||||
}
|
||||
|
||||
KWinCompositingKCM::~KWinCompositingKCM()
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include <QString>
|
||||
#include <QQmlEngine>
|
||||
#include <QtQml>
|
||||
#include <QQuickItem>
|
||||
#include <QDebug>
|
||||
|
||||
namespace KWin {
|
||||
|
@ -371,6 +372,7 @@ void EffectView::init()
|
|||
setResizeMode(QQuickView::SizeRootObjectToView);
|
||||
rootContext()->setContextProperty("engine", this);
|
||||
setSource(QUrl(mainFile));
|
||||
connect(rootObject(), SIGNAL(changed()), this, SIGNAL(changed()));
|
||||
}
|
||||
|
||||
}//end namespace Compositing
|
||||
|
|
|
@ -103,6 +103,8 @@ public:
|
|||
|
||||
Q_INVOKABLE QColor backgroundViewColor() { return KColorScheme(QPalette::Active, KColorScheme::Window, KSharedConfigPtr(0)).background(KColorScheme::NormalBackground).color(); };
|
||||
|
||||
Q_SIGNALS:
|
||||
void changed();
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue