Changeset 182 for trunk/src/gui/kernel/qapplication_pm.cpp
- Timestamp:
- Sep 15, 2009, 3:21:22 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 /*****************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.