Changeset 182
- Timestamp:
- Sep 15, 2009, 3:21:22 PM (16 years ago)
- Location:
- trunk/src/gui/kernel
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gui/kernel/qapplication.cpp
r95 r182 2506 2506 #if defined(Q_WS_WIN) 2507 2507 extern void qt_win_set_cursor(QWidget *, bool); 2508 2509 2508 2510 #elif defined(Q_WS_X11) 2509 2511 extern void qt_x11_enforce_cursor(QWidget *, bool); … … 2657 2659 #if defined(Q_WS_WIN) 2658 2660 qt_win_set_cursor(cursorWidget, true); 2661 2662 2659 2663 #elif defined(Q_WS_X11) 2660 2664 qt_x11_enforce_cursor(cursorWidget, true); -
trunk/src/gui/kernel/qapplication_pm.cpp
r169 r182 423 423 void QApplication::setOverrideCursor(const QCursor &cursor) 424 424 { 425 // @todo implement 425 qApp->d_func()->cursor_list.prepend(cursor); 426 WinSetPointer(HWND_DESKTOP, qApp->d_func()->cursor_list.first().handle()); 426 427 } 427 428 428 429 void QApplication::restoreOverrideCursor() 429 430 { 430 // @todo implement 431 } 432 433 #endif 431 if (qApp->d_func()->cursor_list.isEmpty()) 432 return; 433 qApp->d_func()->cursor_list.removeFirst(); 434 435 if (!qApp->d_func()->cursor_list.isEmpty()) { 436 WinSetPointer(HWND_DESKTOP, qApp->d_func()->cursor_list.first().handle()); 437 } else { 438 QWidget *w = QWidget::find(curWin); 439 if (w) 440 WinSetPointer(HWND_DESKTOP, w->cursor().handle()); 441 else 442 WinSetPointer(HWND_DESKTOP, QCursor(Qt::ArrowCursor).handle()); 443 } 444 } 445 446 /* 447 Internal function called from QWidget::setCursor() 448 force is true if this function is called from dispatchEnterLeave, it means that the 449 mouse is actually directly under this widget. 450 */ 451 void qt_pm_set_cursor(QWidget *w, bool force) 452 { 453 static QPointer<QWidget> lastUnderMouse = 0; 454 if (force) { 455 lastUnderMouse = w; 456 } else if (w->testAttribute(Qt::WA_WState_Created) && lastUnderMouse 457 && lastUnderMouse->effectiveWinId() == w->effectiveWinId()) { 458 w = lastUnderMouse; 459 } 460 461 if (!curWin && w && w->internalWinId()) 462 return; 463 QWidget* cW = w && !w->internalWinId() ? w : QWidget::find(curWin); 464 if (!cW || cW->window() != w->window() || 465 !cW->isVisible() || !cW->underMouse() || QApplication::overrideCursor()) 466 return; 467 468 WinSetPointer(HWND_DESKTOP, cW->cursor().handle()); 469 } 470 471 #endif // QT_NO_CURSOR 434 472 435 473 /***************************************************************************** -
trunk/src/gui/kernel/qcursor_pm.cpp
r111 r182 136 136 QCursorData::initialize(); 137 137 // @todo we depend on QPixmap vs HBITMAP integration here 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 138 192 } 139 193 -
trunk/src/gui/kernel/qwidget_pm.cpp
r169 r182 1402 1402 1403 1403 #ifndef QT_NO_CURSOR 1404 1405 1406 1404 1407 void QWidgetPrivate::setCursor_sys(const QCursor &cursor) 1405 1408 { 1406 // @todo implement, depends on #29 1409 Q_UNUSED(cursor); 1410 Q_Q(QWidget); 1411 qt_pm_set_cursor(q, false); 1407 1412 } 1408 1413 1409 1414 void QWidgetPrivate::unsetCursor_sys() 1410 1415 { 1411 // @todo implement, depends on #29 1416 Q_Q(QWidget); 1417 qt_pm_set_cursor(q, false); 1412 1418 } 1413 1419 #endif
Note:
See TracChangeset
for help on using the changeset viewer.