On Monday 06 October 2014, Martin Gräßlin wrote:
> On Monday 06 October 2014 14:04:16 Marco Martin wrote:
> > Hi all,
> >
> > since i'm growing a bit tired about those black screens in kcms that use
> > qml, i was thinking for the time being to switch to the newer (and
> > supposedly better) QQuickWidget to the old (and hack-y xembed-y)
> > QWidget::createWindowContainer
> >
> > will be slower, hackier, but i don't think we can really ship 5.1 with
> > kcm modules randomly turing black
>
> if we can get it without other regressions I think that sounds valid. I
> guess everybody would have used QQuickWidget if it had existed back when
> we wrote the code.
the diff is very small:
can someone try it to see if it solves the black widget for look and feel?
(changes only that one, splash screen and lock screen should still be black)
--
Marco Martin
diff --git a/kcms/lookandfeel/kcm.cpp b/kcms/lookandfeel/kcm.cpp
index 0cf0d22..2b61412 100644
--- a/kcms/lookandfeel/kcm.cpp
+++ b/kcms/lookandfeel/kcm.cpp
@@ -31,6 +31,7 @@
#include <QStandardPaths>
#include <QProcess>
#include <QQuickWidget>
+#include <QQuickView>
#include <KGlobalSettings>
#include <KIconLoader>
@@ -93,16 +94,17 @@ KCMLookandFeel::KCMLookandFeel(QWidget* parent, const QVariantList& args)
m_model->setItemRoleNames(roles);
QVBoxLayout* layout = new QVBoxLayout(this);
- m_quickWidget = new QQuickWidget(this);
- m_quickWidget->setResizeMode(QQuickWidget::SizeRootObjectToView);
+ m_quickView = new QQuickView(0);
+ QWidget *widget = QWidget::createWindowContainer(m_quickView, this);
+ m_quickView->setResizeMode(QQuickView::SizeRootObjectToView);
Plasma::Package package = Plasma::PluginLoader::self()->loadPackage("Plasma/Generic");
package.setDefaultPackageRoot("plasma/kcms");
package.setPath("kcm_lookandfeel");
- m_quickWidget->rootContext()->setContextProperty("kcm", this);
- m_quickWidget->setSource(QUrl::fromLocalFile(package.filePath("mainscript")));
- setMinimumHeight(m_quickWidget->initialSize().height());
+ m_quickView->rootContext()->setContextProperty("kcm", this);
+ m_quickView->setSource(QUrl::fromLocalFile(package.filePath("mainscript")));
+ setMinimumHeight(m_quickView->initialSize().height());
- layout->addWidget(m_quickWidget);
+ layout->addWidget(widget);
}
KCMLookandFeel::~KCMLookandFeel()
diff --git a/kcms/lookandfeel/kcm.h b/kcms/lookandfeel/kcm.h
index ca6d10f..b6b6ec9 100644
--- a/kcms/lookandfeel/kcm.h
+++ b/kcms/lookandfeel/kcm.h
@@ -28,7 +28,7 @@
#include <Plasma/Package>
-class QQuickWidget;
+class QQuickView;
class QStandardItemModel;
class KCMLookandFeel : public KCModule
@@ -100,7 +100,7 @@ Q_SIGNALS:
private:
QDir cursorThemeDir(const QString &theme, const int depth);
const QStringList cursorSearchPaths();
- QQuickWidget *m_quickWidget;
+ QQuickView *m_quickView;
QStandardItemModel *m_model;
Plasma::Package m_package;
QString m_selectedPlugin;
_______________________________________________
Plasma-devel mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/plasma-devel