- Timestamp:
- May 5, 2012 2:29:39 PM (13 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/extensions
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIArrowSplitter.cpp
r28800 r41175 78 78 { 79 79 mSwitchButton->setText (aName); 80 relayout();80 emit sigSizeChanged(); 81 81 } 82 82 … … 84 84 { 85 85 mChild->setVisible (mSwitchButton->isExpanded()); 86 relayout();86 emit sigSizeChanged(); 87 87 } 88 88 … … 139 139 } 140 140 141 void QIArrowSplitter::relayout()142 {143 /* Update full layout system of message window */144 QList <QLayout*> layouts = findChildren <QLayout*> ();145 foreach (QLayout *item, layouts)146 {147 item->update();148 item->activate();149 }150 151 /* Update main layout of message window at last */152 window()->layout()->update();153 window()->layout()->activate();154 qApp->processEvents();155 156 /* Now resize window to minimum possible size */157 window()->resize (window()->minimumSizeHint());158 qApp->processEvents();159 160 /* Check if we have to make dialog fixed in height */161 if (mSwitchButton->isExpanded())162 window()->setMaximumHeight (QWIDGETSIZE_MAX);163 else164 window()->setFixedHeight (window()->minimumSizeHint().height());165 }166 -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIArrowSplitter.h
r28800 r41175 62 62 void showBackDetails(); 63 63 void showNextDetails(); 64 void sigSizeChanged(); 64 65 65 66 private: 66 67 67 68 bool eventFilter (QObject *aObject, QEvent *aEvent); 68 69 void relayout();70 69 71 70 QVBoxLayout *mMainLayout; -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIDialog.cpp
r28800 r41175 25 25 #endif /* Q_WS_MAC */ 26 26 27 /* Qt includes */28 #include <QPointer>29 30 27 QIDialog::QIDialog (QWidget *aParent /* = 0 */, Qt::WindowFlags aFlags /* = 0 */) 31 28 : QDialog (aParent, aFlags) 32 29 , mPolished (false) 33 , mEventLoop (0)34 30 { 35 31 } … … 89 85 90 86 /* Create a local event loop */ 91 mEventLoop = new QEventLoop(); 87 QEventLoop eventLoop; 88 mEventLoop = &eventLoop; 92 89 /* Show the window if requested */ 93 90 if (aShow) … … 96 93 QPointer<QIDialog> guard = this; 97 94 /* Start the event loop. This blocks. */ 98 mEventLoop->exec(); 99 /* Delete the event loop */ 100 delete mEventLoop; 101 mEventLoop = 0; 95 eventLoop.exec(); 102 96 /* Are we valid anymore? */ 103 97 if (guard.isNull()) 104 98 return QDialog::Rejected; 99 mEventLoop = 0; 105 100 /* Save the result code in case we delete ourself */ 106 101 QDialog::DialogCode res = (QDialog::DialogCode)result(); -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIDialog.h
r28800 r41175 22 22 /* Qt includes */ 23 23 #include <QDialog> 24 #include <QPointer> 24 25 25 26 /* Qt forwards declarations */ … … 43 44 /* Private member vars */ 44 45 bool mPolished; 45 Q EventLoop *mEventLoop;46 QPointer<QEventLoop> mEventLoop; 46 47 }; 47 48 -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIMessageBox.cpp
r38977 r41175 137 137 connect (mDetailsSplitter, SIGNAL (showBackDetails()), this, SLOT (detailsBack())); 138 138 connect (mDetailsSplitter, SIGNAL (showNextDetails()), this, SLOT (detailsNext())); 139 connect (mDetailsSplitter, SIGNAL (sigSizeChanged()), this, SLOT (sltUpdateSize())); 139 140 detailsVBoxLayout->addWidget (mDetailsSplitter); 140 141 … … 369 370 /* Polishing sub-widgets */ 370 371 resize (minimumSizeHint()); 371 qApp->processEvents();372 372 mTextLabel->useSizeHintForWidth (mTextLabel->width()); 373 373 mTextLabel->updateGeometry(); 374 qApp->processEvents();375 374 setFixedWidth (width()); 376 375 mDetailsSplitter->toggleWidget(); … … 434 433 mSpacer->changeSize (0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); 435 434 } 435 } 436 437 void QIMessageBox::sltUpdateSize() 438 { 439 /* Update/activate all the layouts of the message-box: */ 440 QList<QLayout*> layouts = findChildren<QLayout*>(); 441 for (int i = 0; i < layouts.size(); ++i) 442 { 443 QLayout *pItem = layouts.at(i); 444 pItem->update(); 445 pItem->activate(); 446 } 447 QCoreApplication::sendPostedEvents(0, QEvent::LayoutRequest); 448 449 /* Now resize message-box to the minimum possible size: */ 450 resize(minimumSizeHint()); 436 451 } 437 452 -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIMessageBox.h
r38185 r41175 22 22 /* VBox includes */ 23 23 #include "QIDialog.h" 24 #include "QIArrowSplitter.h"25 24 26 25 /* Qt includes */ … … 105 104 private slots: 106 105 106 void sltUpdateSize(); 107 107 108 void detailsBack(); 108 109 void detailsNext();
Note:
See TracChangeset
for help on using the changeset viewer.