Commit 1fd24aa8 authored by hjk's avatar hjk

Debugger: Maintain slider position in watch view

Setting column width seems to reset slider positions, needlessly.
Work around.

Change-Id: Ifa6c6a204dd2fbd7ad3dada0c386b697ae7a4100
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
parent 0544f9dd
......@@ -47,17 +47,18 @@
#include <utils/savedaction.h>
#include <utils/fancylineedit.h>
#include <QDebug>
#include <QMetaProperty>
#include <QMimeData>
#include <QApplication>
#include <QClipboard>
#include <QDebug>
#include <QHeaderView>
#include <QInputDialog>
#include <QItemDelegate>
#include <QMenu>
#include <QInputDialog>
#include <QMessageBox>
#include <QMetaProperty>
#include <QMimeData>
#include <QScrollBar>
#include <QTimer>
//#define USE_WATCH_MODEL_TEST 1
......@@ -1055,6 +1056,23 @@ void WatchTreeView::reset()
resetHelper();
}
void WatchTreeView::doItemsLayout()
{
if (m_sliderPosition == 0)
m_sliderPosition = verticalScrollBar()->sliderPosition();
Utils::BaseTreeView::doItemsLayout();
if (m_sliderPosition)
QTimer::singleShot(0, this, SLOT(adjustSlider()));
}
void WatchTreeView::adjustSlider()
{
if (m_sliderPosition) {
verticalScrollBar()->setSliderPosition(m_sliderPosition);
m_sliderPosition = 0;
}
}
void WatchTreeView::watchExpression(const QString &exp)
{
watchExpression(exp, QString());
......
......@@ -69,6 +69,7 @@ private slots:
void resetHelper();
void expandNode(const QModelIndex &idx);
void collapseNode(const QModelIndex &idx);
void adjustSlider();
void onClearIndividualFormat();
void onClearTypeFormat();
......@@ -78,6 +79,7 @@ private slots:
void onIndividualFormatChange();
private:
void doItemsLayout();
void keyPressEvent(QKeyEvent *ev);
void contextMenuEvent(QContextMenuEvent *ev);
void dragEnterEvent(QDragEnterEvent *ev);
......@@ -95,6 +97,7 @@ private:
WatchType m_type;
bool m_grabbing;
int m_sliderPosition;
};
} // namespace Internal
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment