forked from qt-creator/qt-creator
Remove non-functional tracking of profiler root's vertical scroll
Vertical scrolling doesn't work at the moment and has to be implemented in a different way. Besides, the code tracking the root's vertical scroll hasn't done anything useful in a long time. Change-Id: If2add3874cba971bbaace2c22fbf1b2bf0b463b7 Reviewed-by: Kai Koehne <kai.koehne@digia.com> Reviewed-by: Ulf Hermann <ulf.hermann@digia.com>
This commit is contained in:
@@ -35,8 +35,6 @@ Rectangle {
|
|||||||
|
|
||||||
// ***** properties
|
// ***** properties
|
||||||
|
|
||||||
property int scrollY: 0
|
|
||||||
|
|
||||||
property int singleRowHeight: 30
|
property int singleRowHeight: 30
|
||||||
|
|
||||||
property bool dataAvailable: true
|
property bool dataAvailable: true
|
||||||
@@ -64,7 +62,6 @@ Rectangle {
|
|||||||
property real selectionRangeEnd: selectionRange.startTime + selectionRange.duration
|
property real selectionRangeEnd: selectionRange.startTime + selectionRange.duration
|
||||||
|
|
||||||
signal changeToolTip(string text)
|
signal changeToolTip(string text)
|
||||||
signal updateVerticalScroll(int newPosition)
|
|
||||||
|
|
||||||
property bool recordingEnabled: false
|
property bool recordingEnabled: false
|
||||||
property bool appKilled : false
|
property bool appKilled : false
|
||||||
@@ -458,18 +455,6 @@ Rectangle {
|
|||||||
zoomControl.setRange(from, from + windowLength);
|
zoomControl.setRange(from, from + windowLength);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// center view (vertically)
|
|
||||||
var itemY = view.getYPosition(selectedModel, selectedItem);
|
|
||||||
if (itemY < root.scrollY) {
|
|
||||||
root.updateVerticalScroll(itemY);
|
|
||||||
} else
|
|
||||||
if (itemY + root.singleRowHeight >
|
|
||||||
root.scrollY + root.height) {
|
|
||||||
root.updateVerticalScroll(itemY + root.singleRowHeight -
|
|
||||||
root.height);
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
root.hideRangeDetails();
|
root.hideRangeDetails();
|
||||||
}
|
}
|
||||||
@@ -585,7 +570,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
y: root.scrollY + root.height - height
|
y: root.height - height
|
||||||
height: 6
|
height: 6
|
||||||
width: root.width
|
width: root.width
|
||||||
x: 0
|
x: 0
|
||||||
|
|||||||
@@ -50,14 +50,6 @@ Item {
|
|||||||
x: 200
|
x: 200
|
||||||
y: 25
|
y: 25
|
||||||
|
|
||||||
property int yoffset: root.scrollY
|
|
||||||
onYoffsetChanged: {
|
|
||||||
y = relativey + yoffset
|
|
||||||
fitInView();
|
|
||||||
}
|
|
||||||
property int relativey : y - yoffset
|
|
||||||
onYChanged: relativey = y - yoffset
|
|
||||||
|
|
||||||
// keep inside view
|
// keep inside view
|
||||||
Connections {
|
Connections {
|
||||||
target: root
|
target: root
|
||||||
@@ -104,10 +96,10 @@ Item {
|
|||||||
x = root.width - width;
|
x = root.width - width;
|
||||||
if (x < 0)
|
if (x < 0)
|
||||||
x = 0;
|
x = 0;
|
||||||
if (y - yoffset + height > root.height)
|
if (y + height > root.height)
|
||||||
y = root.height - height + yoffset;
|
y = root.height - height;
|
||||||
if (y < yoffset)
|
if (y < 0)
|
||||||
y = yoffset;
|
y = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// shadow
|
// shadow
|
||||||
@@ -192,8 +184,8 @@ Item {
|
|||||||
drag.target: parent
|
drag.target: parent
|
||||||
drag.minimumX: 0
|
drag.minimumX: 0
|
||||||
drag.maximumX: root.width - parent.width
|
drag.maximumX: root.width - parent.width
|
||||||
drag.minimumY: yoffset
|
drag.minimumY: 0
|
||||||
drag.maximumY: root.height - parent.height + yoffset
|
drag.maximumY: root.height - parent.height
|
||||||
onClicked: {
|
onClicked: {
|
||||||
root.gotoSourceLocation(file, line, column);
|
root.gotoSourceLocation(file, line, column);
|
||||||
root.recenterOnItem(view.selectedModel, view.selectedItem);
|
root.recenterOnItem(view.selectedModel, view.selectedItem);
|
||||||
|
|||||||
@@ -45,14 +45,6 @@ Item {
|
|||||||
x: 200
|
x: 200
|
||||||
y: 125
|
y: 125
|
||||||
|
|
||||||
property int yoffset: root.scrollY
|
|
||||||
onYoffsetChanged: {
|
|
||||||
y = relativey + yoffset
|
|
||||||
fitInView();
|
|
||||||
}
|
|
||||||
property int relativey : y - yoffset
|
|
||||||
onYChanged: relativey = y - yoffset
|
|
||||||
|
|
||||||
// keep inside view
|
// keep inside view
|
||||||
Connections {
|
Connections {
|
||||||
target: root
|
target: root
|
||||||
@@ -69,10 +61,10 @@ Item {
|
|||||||
x = root.width - width;
|
x = root.width - width;
|
||||||
if (x < 0)
|
if (x < 0)
|
||||||
x = 0;
|
x = 0;
|
||||||
if (y + height - yoffset > root.height)
|
if (y + height > root.height)
|
||||||
y = root.height - height + yoffset;
|
y = root.height - height;
|
||||||
if (y < yoffset)
|
if (y < 0)
|
||||||
y = yoffset;
|
y = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// shadow
|
// shadow
|
||||||
@@ -161,8 +153,8 @@ Item {
|
|||||||
drag.target: parent
|
drag.target: parent
|
||||||
drag.minimumX: 0
|
drag.minimumX: 0
|
||||||
drag.maximumX: root.width - parent.width
|
drag.maximumX: root.width - parent.width
|
||||||
drag.minimumY: yoffset
|
drag.minimumY: 0
|
||||||
drag.maximumY: root.height - parent.height + yoffset
|
drag.maximumY: root.height - parent.height + 0
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if ((selectionRange.x < flick.contentX) ^ (selectionRange.x+selectionRange.width > flick.contentX + flick.width)) {
|
if ((selectionRange.x < flick.contentX) ^ (selectionRange.x+selectionRange.width > flick.contentX + flick.width)) {
|
||||||
root.recenter(selectionRange.startTime + selectionRange.duration/2);
|
root.recenter(selectionRange.startTime + selectionRange.duration/2);
|
||||||
|
|||||||
@@ -238,7 +238,6 @@ void QmlProfilerTraceView::reset()
|
|||||||
connect(this, SIGNAL(jumpToNext()), rootObject, SLOT(nextEvent()));
|
connect(this, SIGNAL(jumpToNext()), rootObject, SLOT(nextEvent()));
|
||||||
connect(rootObject, SIGNAL(selectedEventChanged(int)), this, SIGNAL(selectedEventChanged(int)));
|
connect(rootObject, SIGNAL(selectedEventChanged(int)), this, SIGNAL(selectedEventChanged(int)));
|
||||||
connect(rootObject, SIGNAL(changeToolTip(QString)), this, SLOT(updateToolTip(QString)));
|
connect(rootObject, SIGNAL(changeToolTip(QString)), this, SLOT(updateToolTip(QString)));
|
||||||
connect(rootObject, SIGNAL(updateVerticalScroll(int)), this, SLOT(updateVerticalScroll(int)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *QmlProfilerTraceView::createToolbar()
|
QWidget *QmlProfilerTraceView::createToolbar()
|
||||||
@@ -373,8 +372,6 @@ qint64 QmlProfilerTraceView::selectionEnd() const
|
|||||||
void QmlProfilerTraceView::clearDisplay()
|
void QmlProfilerTraceView::clearDisplay()
|
||||||
{
|
{
|
||||||
d->m_zoomControl->setRange(0,0);
|
d->m_zoomControl->setRange(0,0);
|
||||||
|
|
||||||
updateVerticalScroll(0);
|
|
||||||
d->m_mainView->rootObject()->setProperty("scrollY", QVariant(0));
|
d->m_mainView->rootObject()->setProperty("scrollY", QVariant(0));
|
||||||
|
|
||||||
QMetaObject::invokeMethod(d->m_mainView->rootObject(), "clearAll");
|
QMetaObject::invokeMethod(d->m_mainView->rootObject(), "clearAll");
|
||||||
@@ -496,10 +493,6 @@ void QmlProfilerTraceView::updateToolTip(const QString &text)
|
|||||||
setToolTip(text);
|
setToolTip(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlProfilerTraceView::updateVerticalScroll(int /*newPosition*/)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void QmlProfilerTraceView::resizeEvent(QResizeEvent *event)
|
void QmlProfilerTraceView::resizeEvent(QResizeEvent *event)
|
||||||
{
|
{
|
||||||
QWidget::resizeEvent(event);
|
QWidget::resizeEvent(event);
|
||||||
|
|||||||
@@ -117,7 +117,6 @@ private slots:
|
|||||||
void mouseWheelMoved(int mouseX, int mouseY, int wheelDelta);
|
void mouseWheelMoved(int mouseX, int mouseY, int wheelDelta);
|
||||||
|
|
||||||
void updateToolTip(const QString &text);
|
void updateToolTip(const QString &text);
|
||||||
void updateVerticalScroll(int newPosition);
|
|
||||||
void profilerDataModelStateChanged();
|
void profilerDataModelStateChanged();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
Reference in New Issue
Block a user