From a26db1529f6d11e4c61a431fb8092242fda1b074 Mon Sep 17 00:00:00 2001 From: Aurindam Jana <aurindam.jana@nokia.com> Date: Tue, 27 Mar 2012 16:33:25 +0200 Subject: [PATCH] QmlJSInspector: Allow resizing of columns in property inspector Change-Id: I314a76ffe89268b651e4d8358e9d90072a7b747e Reviewed-by: Christiaan Janssen <christiaan.janssen@nokia.com> --- .../qmljsinspector/qmljspropertyinspector.cpp | 12 ++++++++++-- src/plugins/qmljsinspector/qmljspropertyinspector.h | 3 +++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmljsinspector/qmljspropertyinspector.cpp b/src/plugins/qmljsinspector/qmljspropertyinspector.cpp index 2bc8ee310df..cbcc2a74edd 100644 --- a/src/plugins/qmljsinspector/qmljspropertyinspector.cpp +++ b/src/plugins/qmljsinspector/qmljspropertyinspector.cpp @@ -262,13 +262,21 @@ QmlJSPropertyInspector::QmlJSPropertyInspector(QWidget *parent) setFrameStyle(QFrame::NoFrame); setExpandsOnDoubleClick(true); - header()->setResizeMode(QHeaderView::ResizeToContents); - header()->setMinimumSectionSize(150); + header()->setDefaultAlignment(Qt::AlignLeft); + header()->setClickable(true); setRootIsDecorated(false); setItemDelegateForColumn(PROPERTY_VALUE_COLUMN, new PropertyEditDelegate(this)); setModel(&m_model); + + connect(header(), SIGNAL(sectionClicked(int)), + SLOT(headerSectionClicked(int))); +} + +void QmlJSPropertyInspector::headerSectionClicked(int logicalIndex) +{ + resizeColumnToContents(logicalIndex); } void QmlJSPropertyInspector::clear() diff --git a/src/plugins/qmljsinspector/qmljspropertyinspector.h b/src/plugins/qmljsinspector/qmljspropertyinspector.h index 6ce6027f8e8..61a5f36e558 100644 --- a/src/plugins/qmljsinspector/qmljspropertyinspector.h +++ b/src/plugins/qmljsinspector/qmljspropertyinspector.h @@ -120,6 +120,9 @@ public slots: void openExpressionEditor(const QModelIndex &itemIndex); void openColorSelector(const QModelIndex &itemIndex); +private slots: + void headerSectionClicked(int logicalIndex); + private: friend class PropertyEditDelegate; void buildPropertyTree(const QmlDebugObjectReference &); -- GitLab