Changeset 7447 in vbox for trunk/src/VBox/Frontends/VirtualBox4/include
- Timestamp:
- Mar 13, 2008 9:37:52 PM (17 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox4/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxMediaComboBox.h
r7220 r7447 34 34 public: 35 35 36 VBoxMediaComboBox (QWidget *aParent = 0, const char *aName = 0,36 VBoxMediaComboBox (QWidget *aParent, const char *aName, 37 37 int aType = 0, bool aUseEmptyItem = false); 38 VBoxMediaComboBox (QWidget *aParent); 38 39 ~VBoxMediaComboBox() {} 39 40 … … 58 59 protected: 59 60 61 void init(); 60 62 void updateToolTip (int); 61 63 void processMedia (const VBoxMedia &); -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxUtils.h
r7220 r7447 23 23 #include <qevent.h> 24 24 #include <q3listview.h> 25 #include <q3textedit.h>26 25 #include <qlabel.h> 27 26 #include <qlayout.h> … … 171 170 }; 172 171 173 174 /**175 * Simple QTextEdit subclass to return its minimumSizeHint() as sizeHint()176 * for getting more compact layout.177 */178 class QITextEdit : public Q3TextEdit179 {180 Q_OBJECT181 182 public:183 184 QITextEdit (QWidget *aParent)185 : Q3TextEdit (aParent) {}186 187 QSize sizeHint() const188 {189 return minimumSizeHint();190 }191 192 QSize minimumSizeHint() const193 {194 return QSize (width(), heightForWidth (width()));195 }196 };197 198 199 /**200 * Simple QLabel subclass to re-query and return its sizeHint()201 * before the widget to be shown for getting more compact layout.202 */203 class QILabel : public QLabel204 {205 Q_OBJECT206 207 public:208 209 QILabel (QWidget *aParent, const char *aName)210 : QLabel (aParent, aName), mShowed (false)211 {212 /* setup default size policy and alignment */213 setSizePolicy (QSizePolicy ((QSizePolicy::SizeType)1,214 (QSizePolicy::SizeType)0,215 0, 0,216 sizePolicy().hasHeightForWidth()));217 setAlignment (int (Qt::AlignTop));218 /* install show-parent-widget watcher */219 aParent->topLevelWidget()->installEventFilter (this);220 }221 222 QSize sizeHint() const223 {224 return mShowed ?225 QSize (width(), heightForWidth (width())) : QLabel::sizeHint();226 }227 228 private:229 230 bool eventFilter (QObject *aObject, QEvent *aEvent)231 {232 switch (aEvent->type())233 {234 case QEvent::Show:235 {236 mShowed = true;237 if (parent() && ((QWidget*)parent())->layout())238 ((QWidget*)parent())->layout()->activate();239 break;240 }241 default:242 break;243 }244 return QLabel::eventFilter (aObject, aEvent);245 }246 247 bool mShowed;248 };249 250 251 172 #ifdef Q_WS_MAC 252 173 # undef PAGE_SIZE
Note:
See TracChangeset
for help on using the changeset viewer.