Changeset 3806 in vbox for trunk/src/VBox/Frontends/VirtualBox/include
- Timestamp:
- Jul 24, 2007 11:06:48 AM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 23149
- Location:
- trunk/src/VBox/Frontends/VirtualBox/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxDefs.h
r3802 r3806 117 117 118 118 /** VM display rendering mode. */ 119 enum RenderMode { 119 enum RenderMode 120 { 120 121 InvalidRenderMode, TimerMode, QImageMode, SDLMode, DDRAWMode 121 122 }; 122 123 123 124 /** Additional Qt event types. */ 124 enum { 125 ResizeEventType = QEvent::User, 125 enum 126 { 127 AsyncEventType = QEvent::User + 100, 128 ResizeEventType, 126 129 RepaintEventType, 127 130 SetRegionEventType, … … 137 140 RuntimeErrorEventType, 138 141 ModifierKeyChangeEventType, 139 EnumerateMediaEventType = QEvent::User + 100,142 EnumerateMediaEventType, 140 143 #if defined (Q_WS_WIN) 141 144 ShellExecuteEventType, -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxGlobal.h
r3448 r3806 435 435 static QString removeAccelMark (const QString &aText); 436 436 437 static QWidget *findWidget (QWidget *aParent, const char *aName, 438 const char *aClassName = NULL, 439 bool aRecursive = false); 440 437 441 signals: 438 442 … … 548 552 inline VBoxGlobal &vboxGlobal() { return VBoxGlobal::instance(); } 549 553 554 // Helper classes 555 //////////////////////////////////////////////////////////////////////////////// 556 557 /** 558 * Generic asyncronous event. 559 * 560 * This abstract class is intended to provide a conveinent way to execute 561 * code on the main GUI thread asynchronously to the calling party. This is 562 * done by putting necessary actions to the #handle() function in a subclass 563 * and then posting an instance of the subclass using #post(). The instance 564 * must be allocated on the heap using the <tt>new</tt> operation and will be 565 * automatically deleted after processing. Note that if you don't call #post() 566 * on the created instance, you have to delete it yourself. 567 */ 568 class VBoxAsyncEvent : public QEvent 569 { 570 public: 571 572 VBoxAsyncEvent() : QEvent ((QEvent::Type) VBoxDefs::AsyncEventType) {} 573 574 /** 575 * Worker function. Gets executed on the GUI thread when the posted event 576 * is processed by the main event loop. 577 */ 578 virtual void handle() = 0; 579 580 /** 581 * Posts this event to the main event loop. 582 * The caller loses ownership of this object after this method returns 583 * and must not delete the object. 584 */ 585 void post() 586 { 587 QApplication::postEvent (&vboxGlobal(), this); 588 } 589 }; 550 590 551 591 /**
Note:
See TracChangeset
for help on using the changeset viewer.