- Timestamp:
- Aug 26, 2009, 9:37:08 PM (16 years ago)
- Location:
- trunk/src/gui/kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gui/kernel/qwidget_p.h
r128 r130 473 473 { return maybeTopData() && maybeTopData()->fId != NULLHANDLE ? 474 474 maybeTopData()->fId : data.winid; } 475 HWND effectiveFrameWinId() const; 475 476 #endif 476 477 -
trunk/src/gui/kernel/qwidget_pm.cpp
r129 r130 1450 1450 void QWidget::grabMouse() 1451 1451 { 1452 // @todo implement 1452 Q_D(QWidget); 1453 if (!qt_nograb()) { 1454 if (mouseGrb) 1455 mouseGrb->releaseMouse(); 1456 Q_ASSERT(testAttribute(Qt::WA_WState_Created)); 1457 WinSetCapture(HWND_DESKTOP, d->effectiveFrameWinId()); 1458 mouseGrb = this; 1459 #ifndef QT_NO_CURSOR 1460 mouseGrbCur = new QCursor(mouseGrb->cursor()); 1461 #endif 1462 } 1453 1463 } 1454 1464 1455 1465 void QWidget::grabMouse(const QCursor &cursor) 1456 1466 { 1457 // @todo implement 1467 Q_D(QWidget); 1468 if (!qt_nograb()) { 1469 if (mouseGrb) 1470 mouseGrb->releaseMouse(); 1471 Q_ASSERT(testAttribute(Qt::WA_WState_Created)); 1472 WinSetCapture(HWND_DESKTOP, d->effectiveFrameWinId()); 1473 mouseGrbCur = new QCursor(cursor); 1474 WinSetPointer(HWND_DESKTOP, mouseGrbCur->handle()); 1475 mouseGrb = this; 1476 } 1458 1477 } 1459 1478 1460 1479 void QWidget::releaseMouse() 1461 1480 { 1462 // @todo implement 1481 if (!qt_nograb() && mouseGrb == this) { 1482 WinSetCapture(HWND_DESKTOP, 0); 1483 if (mouseGrbCur) { 1484 delete mouseGrbCur; 1485 mouseGrbCur = 0; 1486 } 1487 mouseGrb = 0; 1488 } 1463 1489 } 1464 1490 1465 1491 void QWidget::grabKeyboard() 1466 1492 { 1467 // @todo implement 1493 if (!qt_nograb()) { 1494 if (keyboardGrb) 1495 keyboardGrb->releaseKeyboard(); 1496 keyboardGrb = this; 1497 } 1468 1498 } 1469 1499 1470 1500 void QWidget::releaseKeyboard() 1471 1501 { 1472 // @todo implement 1502 if (!qt_nograb() && keyboardGrb == this) 1503 keyboardGrb = 0; 1473 1504 } 1474 1505 1475 1506 QWidget *QWidget::mouseGrabber() 1476 1507 { 1477 // @todo implement 1478 return 0; 1508 return mouseGrb; 1479 1509 } 1480 1510 1481 1511 QWidget *QWidget::keyboardGrabber() 1482 1512 { 1483 // @todo implement 1484 return 0; 1513 return keyboardGrb; 1485 1514 } 1486 1515 1487 1516 void QWidget::activateWindow() 1488 1517 { 1489 // @todo implement 1518 window()->createWinId(); 1519 WinSetActiveWindow(HWND_DESKTOP, window()->d_func()->frameWinId()); 1490 1520 } 1491 1521 … … 2020 2050 { 2021 2051 // @todo implement 2052 } 2053 2054 HWND QWidgetPrivate::effectiveFrameWinId() const 2055 { 2056 Q_Q(const QWidget); 2057 HWND fid = frameWinId(); 2058 if (fid != NULLHANDLE || !q->testAttribute(Qt::WA_WState_Created)) 2059 return fid; 2060 QWidget *realParent = q->nativeParentWidget(); 2061 Q_ASSERT(realParent); 2062 Q_ASSERT(realParent->d_func()->frameWinId()); 2063 return realParent->d_func()->frameWinId(); 2022 2064 } 2023 2065
Note:
See TracChangeset
for help on using the changeset viewer.