From 9a1da15739f09c423ee9eb3fde944cb90d4ef612 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Tue, 12 Nov 2013 13:11:47 +0100 Subject: [PATCH] QmlProfiler: remove broken zoom toolbar The zoom slider has to be rebuilt in QML as positioning QWidgets on top of QQuickViews creates various problems we don't want to solve for such a simple element. Task-number: QTCREATORBUG-10635 Change-Id: I9aa22edd3e3a4fddb1d04545260ceacf22184260 Reviewed-by: Kai Koehne --- .../qmlprofiler/qmlprofilertraceview.cpp | 49 ------------------- .../qmlprofiler/qmlprofilertraceview.h | 1 - 2 files changed, 50 deletions(-) diff --git a/src/plugins/qmlprofiler/qmlprofilertraceview.cpp b/src/plugins/qmlprofiler/qmlprofilertraceview.cpp index feda7a1a3e0..b82448a0ded 100644 --- a/src/plugins/qmlprofiler/qmlprofilertraceview.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertraceview.cpp @@ -136,7 +136,6 @@ public: QToolButton *m_buttonRange; QToolButton *m_buttonLock; - QWidget *m_zoomToolbar; int m_currentZoomLevel; }; @@ -173,10 +172,6 @@ QmlProfilerTraceView::QmlProfilerTraceView(QWidget *parent, Analyzer::IAnalyzerT overviewContainer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); overviewContainer->setMaximumHeight(50); - d->m_zoomToolbar = createZoomToolbar(); - d->m_zoomToolbar->move(0, d->m_timebar->height()); - d->m_zoomToolbar->setVisible(false); - toolsLayout->addWidget(createToolbar()); toolsLayout->addWidget(timeBarContainer); emit enableToolbar(false); @@ -269,7 +264,6 @@ QWidget *QmlProfilerTraceView::createToolbar() buttonZoomControls->setToolTip(tr("Show zoom slider")); buttonZoomControls->setCheckable(true); buttonZoomControls->setChecked(false); - connect(buttonZoomControls, SIGNAL(toggled(bool)), d->m_zoomToolbar, SLOT(setVisible(bool))); connect(this, SIGNAL(enableToolbar(bool)), buttonZoomControls, SLOT(setEnabled(bool))); d->m_buttonRange = new QToolButton; @@ -301,49 +295,6 @@ QWidget *QmlProfilerTraceView::createToolbar() return bar; } - -QWidget *QmlProfilerTraceView::createZoomToolbar() -{ - Utils::StyledBar *bar = new Utils::StyledBar(this); - bar->setStyleSheet(QLatin1String("background: #9B9B9B")); - bar->setSingleRow(true); - bar->setFixedWidth(150); - bar->setFixedHeight(24); - - QHBoxLayout *toolBarLayout = new QHBoxLayout(bar); - toolBarLayout->setMargin(0); - toolBarLayout->setSpacing(0); - - QSlider *zoomSlider = new QSlider(Qt::Horizontal); - zoomSlider->setFocusPolicy(Qt::NoFocus); - zoomSlider->setRange(1, sliderTicks); - zoomSlider->setInvertedAppearance(true); - zoomSlider->setPageStep(sliderTicks/100); - connect(this, SIGNAL(enableToolbar(bool)), zoomSlider, SLOT(setEnabled(bool))); - connect(zoomSlider, SIGNAL(valueChanged(int)), this, SLOT(setZoomLevel(int))); - connect(this, SIGNAL(zoomLevelChanged(int)), zoomSlider, SLOT(setValue(int))); - zoomSlider->setStyleSheet(QLatin1String("\ - QSlider:horizontal {\ - background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #444444, stop: 1 #5a5a5a);\ - border: 1px #313131;\ - height: 20px;\ - margin: 0px 0px 0px 0px;\ - }\ - QSlider::add-page:horizontal {\ - background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #5a5a5a, stop: 1 #444444);\ - border: 1px #313131;\ - }\ - QSlider::sub-page:horizontal {\ - background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #5a5a5a, stop: 1 #444444);\ - border: 1px #313131;\ - }\ - ")); - - toolBarLayout->addWidget(zoomSlider); - - return bar; -} - ///////////////////////////////////////////////////////// bool QmlProfilerTraceView::hasValidSelection() const { diff --git a/src/plugins/qmlprofiler/qmlprofilertraceview.h b/src/plugins/qmlprofiler/qmlprofilertraceview.h index 8bb84949e67..5ac42601fae 100644 --- a/src/plugins/qmlprofiler/qmlprofilertraceview.h +++ b/src/plugins/qmlprofiler/qmlprofilertraceview.h @@ -143,7 +143,6 @@ signals: private: void contextMenuEvent(QContextMenuEvent *); QWidget *createToolbar(); - QWidget *createZoomToolbar(); void setRecording(bool recording); void setAppKilled();