diff --git a/src/plugins/qmljsinspector/qmljspropertyinspector.cpp b/src/plugins/qmljsinspector/qmljspropertyinspector.cpp index 2bc8ee310df756b5ba6e44c70f53dad8397efee7..cbcc2a74edd1f17072827e9a68bb1a514b277e25 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 6ce6027f8e88446a6d00cbce3b52120557457251..61a5f36e558311cd904dabb902b29b4d04dfc29f 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 &);