Changeset 13041 for OpenSceneGraph/trunk/src/osgQt/QGraphicsViewAdapter.cpp
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgQt/QGraphicsViewAdapter.cpp
r12597 r13041 276 276 { 277 277 QWidget* childAt = _graphicsView->childAt(pos); 278 if(childAt) 278 if(childAt) 279 279 { 280 280 return childAt; 281 281 } 282 282 283 283 QGraphicsItem* item = _graphicsView->itemAt(pos); 284 284 if(item && item->contains(item->mapFromScene(pos))) … … 286 286 QGraphicsProxyWidget* p = dynamic_cast<QGraphicsProxyWidget*>(item); 287 287 if(p) 288 { 288 { 289 289 childAt = p->widget(); 290 290 QWidget* c; … … 303 303 _previousQtMouseX = x; 304 304 _previousQtMouseY = _graphicsView->size().height() - y; 305 305 306 306 QPoint pos(_previousQtMouseX, _previousQtMouseY); 307 307 308 308 if (getWidgetAt(pos) != NULL || (_previousSentEvent && buttonMask != 0)) 309 309 { … … 313 313 return true; 314 314 } 315 315 316 316 OSG_INFO<<"sendPointerEvent("<<x<<", "<<y<<") not sent"<<std::endl; 317 317 _previousSentEvent = false; … … 343 343 344 344 const QPoint globalPos(x, y); 345 345 346 346 if (buttonMask != _previousButtonMask) 347 347 { … … 365 365 { 366 366 QWidget* targetWidget = getWidgetAt(globalPos); 367 if(targetWidget) 367 if(targetWidget) 368 368 { 369 369 QPoint localPos = targetWidget->mapFromGlobal(globalPos); 370 370 QContextMenuEvent* cme = new QContextMenuEvent(QContextMenuEvent::Mouse, localPos, globalPos); 371 371 QCoreApplication::postEvent(targetWidget, cme); 372 } 372 } 373 373 } 374 374 } 375 375 376 376 if (eventType==QEvent::MouseButtonPress) 377 377 { … … 510 510 OSG_INFO << "render image " << _currentWrite << " with size (" << _width << "," << _height << ")" <<std::endl; 511 511 } 512 512 513 513 #if 1 514 514 // paint the image with the graphics view … … 568 568 569 569 // Save the new width and height which will take effect on the next render() (in the Qt thread). 570 570 571 571 { 572 572 OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_qresizeMutex);
