From 5b736f96cb0975a9402613a9330ac96fc076171e Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 23 Mar 2010 13:04:51 +0100 Subject: [PATCH] QmlDesigner.propertyEditor: stabilize collapse button --- .../propertyeditor/propertyeditor.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp index 67b1141e6cd..3251287bb63 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp @@ -475,6 +475,11 @@ void PropertyEditor::expand() while (parentWidget) { if (Core::SideBar *sideBar = qobject_cast(parentWidget)) { childWidget->setMaximumWidth(2000); + foreach (QObject* child, sideBar->children()) { + if (QWidget* otherWidget = qobject_cast(child)) + if (otherWidget != childWidget && !qobject_cast(otherWidget)) + otherWidget->show(); + } QList list = sideBar->findChildren(); foreach (QComboBox* box, list) { if (qobject_cast(box->parentWidget())) @@ -502,10 +507,18 @@ void PropertyEditor::collapse() while (parentWidget) { if (Core::SideBar *sideBar = qobject_cast(parentWidget)) { childWidget->setMaximumWidth(22); + foreach (QObject* child, sideBar->children()) { + if (QWidget* otherWidget = qobject_cast(child)) + if (otherWidget != childWidget && !qobject_cast(otherWidget)) + otherWidget->hide(); + } + QSplitter* parentSplitter = qobject_cast(sideBar->parentWidget()); - QList s = sideBar->sizes(); + QList s = parentSplitter->sizes(); + qDebug() << s; s.removeLast(); s.append(25); + qDebug() << s; parentSplitter->setSizes(s); parentSplitter->refresh(); parentSplitter->update(); @@ -574,7 +587,7 @@ void PropertyEditor::setQmlDir(const QString &qmlDir) void PropertyEditor::delayedResetView() { if (m_timerId == 0) - m_timerId = startTimer(500); + m_timerId = startTimer(200); } void PropertyEditor::timerEvent(QTimerEvent *timerEvent)