forked from qt-creator/qt-creator
QmlDesigner.propertyEditor: stabilize collapse button
This commit is contained in:
@@ -475,6 +475,11 @@ void PropertyEditor::expand()
|
|||||||
while (parentWidget) {
|
while (parentWidget) {
|
||||||
if (Core::SideBar *sideBar = qobject_cast<Core::SideBar*>(parentWidget)) {
|
if (Core::SideBar *sideBar = qobject_cast<Core::SideBar*>(parentWidget)) {
|
||||||
childWidget->setMaximumWidth(2000);
|
childWidget->setMaximumWidth(2000);
|
||||||
|
foreach (QObject* child, sideBar->children()) {
|
||||||
|
if (QWidget* otherWidget = qobject_cast<QWidget*>(child))
|
||||||
|
if (otherWidget != childWidget && !qobject_cast<QComboBox*>(otherWidget))
|
||||||
|
otherWidget->show();
|
||||||
|
}
|
||||||
QList<QComboBox*> list = sideBar->findChildren<QComboBox*>();
|
QList<QComboBox*> list = sideBar->findChildren<QComboBox*>();
|
||||||
foreach (QComboBox* box, list) {
|
foreach (QComboBox* box, list) {
|
||||||
if (qobject_cast<QToolBar*>(box->parentWidget()))
|
if (qobject_cast<QToolBar*>(box->parentWidget()))
|
||||||
@@ -502,10 +507,18 @@ void PropertyEditor::collapse()
|
|||||||
while (parentWidget) {
|
while (parentWidget) {
|
||||||
if (Core::SideBar *sideBar = qobject_cast<Core::SideBar*>(parentWidget)) {
|
if (Core::SideBar *sideBar = qobject_cast<Core::SideBar*>(parentWidget)) {
|
||||||
childWidget->setMaximumWidth(22);
|
childWidget->setMaximumWidth(22);
|
||||||
|
foreach (QObject* child, sideBar->children()) {
|
||||||
|
if (QWidget* otherWidget = qobject_cast<QWidget*>(child))
|
||||||
|
if (otherWidget != childWidget && !qobject_cast<QComboBox*>(otherWidget))
|
||||||
|
otherWidget->hide();
|
||||||
|
}
|
||||||
|
|
||||||
QSplitter* parentSplitter = qobject_cast<QSplitter*>(sideBar->parentWidget());
|
QSplitter* parentSplitter = qobject_cast<QSplitter*>(sideBar->parentWidget());
|
||||||
QList<int> s = sideBar->sizes();
|
QList<int> s = parentSplitter->sizes();
|
||||||
|
qDebug() << s;
|
||||||
s.removeLast();
|
s.removeLast();
|
||||||
s.append(25);
|
s.append(25);
|
||||||
|
qDebug() << s;
|
||||||
parentSplitter->setSizes(s);
|
parentSplitter->setSizes(s);
|
||||||
parentSplitter->refresh();
|
parentSplitter->refresh();
|
||||||
parentSplitter->update();
|
parentSplitter->update();
|
||||||
@@ -574,7 +587,7 @@ void PropertyEditor::setQmlDir(const QString &qmlDir)
|
|||||||
void PropertyEditor::delayedResetView()
|
void PropertyEditor::delayedResetView()
|
||||||
{
|
{
|
||||||
if (m_timerId == 0)
|
if (m_timerId == 0)
|
||||||
m_timerId = startTimer(500);
|
m_timerId = startTimer(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PropertyEditor::timerEvent(QTimerEvent *timerEvent)
|
void PropertyEditor::timerEvent(QTimerEvent *timerEvent)
|
||||||
|
|||||||
Reference in New Issue
Block a user