Changeset View
Changeset View
Standalone View
Standalone View
kcm/src/widget.cpp
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | |||||
43 | #include <kscreen/configmonitor.h> | 43 | #include <kscreen/configmonitor.h> | ||
44 | 44 | | |||
45 | #include <QtCore/QDir> | 45 | #include <QtCore/QDir> | ||
46 | #include <QStandardPaths> | 46 | #include <QStandardPaths> | ||
47 | #include <KLocalizedString> | 47 | #include <KLocalizedString> | ||
48 | #include <QComboBox> | 48 | #include <QComboBox> | ||
49 | #include <QPushButton> | 49 | #include <QPushButton> | ||
50 | #include <QQuickView> | 50 | #include <QQuickView> | ||
51 | #include <QQuickWidget> | ||||
51 | 52 | | |||
52 | #define QML_PATH "kcm_kscreen/qml/" | 53 | #define QML_PATH "kcm_kscreen/qml/" | ||
53 | 54 | | |||
54 | Widget::Widget(QWidget *parent): | 55 | Widget::Widget(QWidget *parent): | ||
55 | QWidget(parent), | 56 | QWidget(parent), | ||
56 | mScreen(nullptr), | 57 | mScreen(nullptr), | ||
57 | mConfig(nullptr), | 58 | mConfig(nullptr), | ||
58 | mPrevConfig(nullptr) | 59 | mPrevConfig(nullptr) | ||
59 | { | 60 | { | ||
60 | qRegisterMetaType<QQuickView*>(); | 61 | qRegisterMetaType<QQuickView*>(); | ||
61 | 62 | | |||
62 | setMinimumHeight(550); | 63 | setMinimumHeight(550); | ||
63 | 64 | | |||
64 | QVBoxLayout *layout = new QVBoxLayout(this); | 65 | QVBoxLayout *layout = new QVBoxLayout(this); | ||
65 | 66 | | |||
66 | QSplitter *splitter = new QSplitter(Qt::Vertical, this); | 67 | QSplitter *splitter = new QSplitter(Qt::Vertical, this); | ||
67 | layout->addWidget(splitter); | 68 | layout->addWidget(splitter); | ||
68 | 69 | | |||
69 | mDeclarativeView = new QQuickView(); | 70 | mDeclarativeView = new QQuickWidget(); | ||
70 | QWidget *container = QWidget::createWindowContainer(mDeclarativeView, this); | 71 | mDeclarativeView->setResizeMode(QQuickWidget::SizeRootObjectToView); | ||
71 | mDeclarativeView->setResizeMode(QQuickView::SizeRootObjectToView); | | |||
72 | mDeclarativeView->setMinimumHeight(280); | 72 | mDeclarativeView->setMinimumHeight(280); | ||
73 | container->setMinimumHeight(280); | 73 | splitter->addWidget(mDeclarativeView); | ||
74 | splitter->addWidget(container); | | |||
75 | 74 | | |||
76 | QWidget *widget = new QWidget(this); | 75 | QWidget *widget = new QWidget(this); | ||
77 | splitter->addWidget(widget); | 76 | splitter->addWidget(widget); | ||
78 | splitter->setStretchFactor(1, 1); | 77 | splitter->setStretchFactor(1, 1); | ||
79 | widget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding); | 78 | widget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding); | ||
80 | 79 | | |||
81 | QVBoxLayout *vbox = new QVBoxLayout(widget); | 80 | QVBoxLayout *vbox = new QVBoxLayout(widget); | ||
82 | const int topMargin = style()->pixelMetric(QStyle::PM_LayoutTopMargin, 0, this); | 81 | const int topMargin = style()->pixelMetric(QStyle::PM_LayoutTopMargin, 0, this); | ||
▲ Show 20 Lines • Show All 402 Lines • Show Last 20 Lines |