Changeset 1004 for tests/embedded/embedded.cpp
- Timestamp:
- Aug 18, 2011, 2:39:17 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/embedded/embedded.cpp
r1003 r1004 46 46 class MainWindow : public QMainWindow 47 47 { 48 49 48 50 public: 49 51 50 52 MainWindow() 53 51 54 { 55 56 57 58 59 60 61 62 63 64 65 66 67 52 68 QWidget *main = new QWidget(); 53 69 setCentralWidget (main); … … 57 73 mainLayout->setMargin (0); 58 74 59 QStackedWidget *stackCentralW = new QStackedWidget (main);75 stackCentralW = new QStackedWidget (main); 60 76 61 stackCentralW->addWidget (new QLabel ("Background")); 77 bgWidget = new QLabel ("Background"); 78 stackCentralW->addWidget (bgWidget); 62 79 63 80 videoWidget = new VideoWidget(); … … 68 85 mainLayout->insertWidget (2, new QLabel ("Controls")); 69 86 70 stackCentralW->setCurrentWidget (videoWidget);71 72 id = videoWidget->request();73 74 startTimer (1000);75 87 } 76 88 77 89 void timerEvent (QTimerEvent *) 78 90 { 79 qDebug() << "*** timer" << qDebugFmtHex (id); 80 HWND hwnd = id; 81 HPS hps = WinGetPS (hwnd); 82 if (hps) 91 if (id) 83 92 { 84 RECTL rcl; 85 // WinQueryWindowRect (hwnd, &rcl); 93 qDebug() << "window handle" << qDebugFmtHex (id); 94 HWND hwnd = id; 95 HPS hps = WinGetPS (hwnd); 96 if (hps) 97 { 98 RECTL rcl; 99 // WinQueryWindowRect (hwnd, &rcl); 86 100 87 rcl.xLeft = 0;88 rcl.yBottom = 0;89 rcl.xRight = videoWidget->size().width();90 rcl.yTop = videoWidget->size().height();101 rcl.xLeft = 0; 102 rcl.yBottom = 0; 103 rcl.xRight = videoWidget->size().width(); 104 rcl.yTop = videoWidget->size().height(); 91 105 92 qDebug() << rcl.xRight << rcl.yTop;106 qDebug() << rcl.xRight << rcl.yTop; 93 107 94 WinDrawBorder (hps, &rcl, 3, 3, CLR_RED, CLR_DARKGREEN, DB_INTERIOR);108 WinDrawBorder (hps, &rcl, 3, 3, CLR_RED, CLR_DARKGREEN, DB_INTERIOR); 95 109 96 WinReleasePS (hps); 110 WinReleasePS (hps); 111 } 97 112 } 98 113 } 99 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 100 139 VideoWidget *videoWidget; 101 140 WId id; 141 102 142 }; 103 143 … … 111 151 return app.exec(); 112 152 } 153 154
Note:
See TracChangeset
for help on using the changeset viewer.