forked from qt-creator/qt-creator
QmlJSInspector: Allow resizing of columns in property inspector
Change-Id: I314a76ffe89268b651e4d8358e9d90072a7b747e Reviewed-by: Christiaan Janssen <christiaan.janssen@nokia.com>
This commit is contained in:
@@ -262,13 +262,21 @@ QmlJSPropertyInspector::QmlJSPropertyInspector(QWidget *parent)
|
|||||||
setFrameStyle(QFrame::NoFrame);
|
setFrameStyle(QFrame::NoFrame);
|
||||||
setExpandsOnDoubleClick(true);
|
setExpandsOnDoubleClick(true);
|
||||||
|
|
||||||
header()->setResizeMode(QHeaderView::ResizeToContents);
|
header()->setDefaultAlignment(Qt::AlignLeft);
|
||||||
header()->setMinimumSectionSize(150);
|
header()->setClickable(true);
|
||||||
setRootIsDecorated(false);
|
setRootIsDecorated(false);
|
||||||
|
|
||||||
setItemDelegateForColumn(PROPERTY_VALUE_COLUMN, new PropertyEditDelegate(this));
|
setItemDelegateForColumn(PROPERTY_VALUE_COLUMN, new PropertyEditDelegate(this));
|
||||||
|
|
||||||
setModel(&m_model);
|
setModel(&m_model);
|
||||||
|
|
||||||
|
connect(header(), SIGNAL(sectionClicked(int)),
|
||||||
|
SLOT(headerSectionClicked(int)));
|
||||||
|
}
|
||||||
|
|
||||||
|
void QmlJSPropertyInspector::headerSectionClicked(int logicalIndex)
|
||||||
|
{
|
||||||
|
resizeColumnToContents(logicalIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlJSPropertyInspector::clear()
|
void QmlJSPropertyInspector::clear()
|
||||||
|
@@ -120,6 +120,9 @@ public slots:
|
|||||||
void openExpressionEditor(const QModelIndex &itemIndex);
|
void openExpressionEditor(const QModelIndex &itemIndex);
|
||||||
void openColorSelector(const QModelIndex &itemIndex);
|
void openColorSelector(const QModelIndex &itemIndex);
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void headerSectionClicked(int logicalIndex);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class PropertyEditDelegate;
|
friend class PropertyEditDelegate;
|
||||||
void buildPropertyTree(const QmlDebugObjectReference &);
|
void buildPropertyTree(const QmlDebugObjectReference &);
|
||||||
|
Reference in New Issue
Block a user