diff --git a/src/plugins/qmlprofiler/qmlprofiler.pro b/src/plugins/qmlprofiler/qmlprofiler.pro index 880b4bae476..89904cfb45a 100644 --- a/src/plugins/qmlprofiler/qmlprofiler.pro +++ b/src/plugins/qmlprofiler/qmlprofiler.pro @@ -1,6 +1,6 @@ DEFINES += QMLPROFILER_LIBRARY -QT += network qml quick +QT += network qml quick quickwidgets include(../../qtcreatorplugin.pri) diff --git a/src/plugins/qmlprofiler/qmlprofiler.qbs b/src/plugins/qmlprofiler/qmlprofiler.qbs index 694d52e9f71..aedf53224c2 100644 --- a/src/plugins/qmlprofiler/qmlprofiler.qbs +++ b/src/plugins/qmlprofiler/qmlprofiler.qbs @@ -3,7 +3,7 @@ import qbs 1.0 QtcPlugin { name: "QmlProfiler" - Depends { name: "Qt"; submodules: ["widgets", "network", "quick"] } + Depends { name: "Qt"; submodules: ["widgets", "network", "quick", "quickwidgets"] } Depends { name: "Aggregation" } Depends { name: "QmlJS" } Depends { name: "QmlDebug" } diff --git a/src/plugins/qmlprofiler/qmlprofilertraceview.cpp b/src/plugins/qmlprofiler/qmlprofilertraceview.cpp index c7a962649c5..2615cea0666 100644 --- a/src/plugins/qmlprofiler/qmlprofilertraceview.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertraceview.cpp @@ -59,6 +59,7 @@ #include #include #include +#include #include #include @@ -81,7 +82,7 @@ public: QSize m_sizeHint; - QQuickView *m_mainView; + QQuickWidget *m_mainView; QmlProfilerModelManager *m_modelManager; Timeline::TimelineModelAggregator *m_modelProxy; @@ -109,12 +110,11 @@ QmlProfilerTraceView::QmlProfilerTraceView(QWidget *parent, Analyzer::IAnalyzerT qmlRegisterType(); qmlRegisterType(); - d->m_mainView = new QmlProfilerQuickView(this); - d->m_mainView->setResizeMode(QQuickView::SizeRootObjectToView); - QWidget *mainViewContainer = QWidget::createWindowContainer(d->m_mainView); - mainViewContainer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + d->m_mainView = new QQuickWidget(this); + d->m_mainView->setResizeMode(QQuickWidget::SizeRootObjectToView); + d->m_mainView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - groupLayout->addWidget(mainViewContainer); + groupLayout->addWidget(d->m_mainView); setLayout(groupLayout); d->m_profilerTool = profilerTool; @@ -311,42 +311,5 @@ void QmlProfilerTraceView::profilerDataModelStateChanged() } } -bool QmlProfilerQuickView::event(QEvent *ev) -{ - // We assume context menus can only be triggered by mouse press, mouse release, or - // pre-synthesized events from the window system. - - bool relayed = false; - switch (ev->type()) { - case QEvent::ContextMenu: - // In the case of mouse clicks the active popup gets automatically closed before they show - // up here. That's not necessarily the case with keyboard triggered context menu events, so - // we just ignore them if there is a popup already. Also, the event's pos() and globalPos() - // don't make much sense in this case, so we just put the menu in the upper left corner. - if (QApplication::activePopupWidget() == 0) { - ev->accept(); - parent->showContextMenu(parent->mapToGlobal(QPoint(0,0))); - relayed = true; - } - break; - case QEvent::MouseMove: - case QEvent::MouseButtonPress: - case QEvent::MouseButtonRelease: { - QMouseEvent *orig = static_cast(ev); - QCoreApplication::instance()->postEvent(parent->window()->windowHandle(), - new QMouseEvent(orig->type(), parent->window()->mapFromGlobal(orig->globalPos()), - orig->button(), orig->buttons(), orig->modifiers())); - relayed = true; - break; - } - default: - break; - } - - // QQuickView will eat mouse events even if they're not accepted by any QML construct. So we - // ignore the return value of event() above. - return QQuickView::event(ev) || relayed; -} - } // namespace Internal } // namespace QmlProfiler diff --git a/src/plugins/qmlprofiler/qmlprofilertraceview.h b/src/plugins/qmlprofiler/qmlprofilertraceview.h index f428ffb6f38..a2a79b1d5bb 100644 --- a/src/plugins/qmlprofiler/qmlprofilertraceview.h +++ b/src/plugins/qmlprofiler/qmlprofilertraceview.h @@ -32,7 +32,6 @@ #define QMLPROFILERTRACEVIEW_H #include "qmlprofilermodelmanager.h" -#include #include #include @@ -85,14 +84,6 @@ private: QmlProfilerTraceViewPrivate *d; }; -class QmlProfilerQuickView : public QQuickView { -public: - QmlProfilerQuickView(QmlProfilerTraceView *parent) : parent(parent) {} -protected: - QmlProfilerTraceView *parent; - bool event(QEvent *ev); -}; - } // namespace Internal } // namespace QmlProfiler