Changeset 72678 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jun 25, 2018 2:25:49 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 123193
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QISplitter.cpp
r71900 r72678 261 261 { 262 262 m_fHandleGrabbed = true; 263 setCursor(Qt::SplitHCursor);263 VBoxGlobal::setCursor(this, Qt::SplitHCursor); 264 264 qApp->postEvent(pHandle, new QMouseEvent(newME)); 265 265 return true; … … 273 273 && pMouseEvent->buttons().testFlag(Qt::LeftButton))) 274 274 { 275 setCursor(Qt::SplitHCursor);275 VBoxGlobal::setCursor(this, Qt::SplitHCursor); 276 276 qApp->postEvent(pHandle, new QMouseEvent(newME)); 277 277 return true; … … 281 281 /* If not, reset the state. */ 282 282 m_fHandleGrabbed = false; 283 setCursor(Qt::ArrowCursor);283 VBoxGlobal::setCursor(this, Qt::ArrowCursor); 284 284 } 285 285 } … … 292 292 { 293 293 m_fHandleGrabbed = false; 294 setCursor(Qt::ArrowCursor);294 VBoxGlobal::setCursor(this, Qt::ArrowCursor); 295 295 break; 296 296 } -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r72628 r72678 24 24 # include <QDir> 25 25 # include <QFileDialog> 26 # include <QGraphicsWidget> 26 27 # include <QLocale> 27 28 # include <QMenu> … … 76 77 # ifdef VBOX_WS_X11 77 78 # include "UIHostComboEditor.h" 79 # include "VBoxX11Helper.h" 78 80 # endif 79 81 # ifdef VBOX_WS_MAC … … 346 348 347 349 /* static */ 350 uint VBoxGlobal::qtRTMajorVersion() 351 { 352 QString rt_ver_str("5.11");// = VBoxGlobal::qtRTVersionString(); 353 return rt_ver_str.section ('.', 0, 0).toInt(); 354 } 355 356 /* static */ 357 uint VBoxGlobal::qtRTMinorVersion() 358 { 359 QString rt_ver_str("5.11");// = VBoxGlobal::qtRTVersionString(); 360 return rt_ver_str.section ('.', 1, 1).toInt(); 361 } 362 363 /* static */ 364 uint VBoxGlobal::qtRTRevisionNumber() 365 { 366 QString rt_ver_str("5.11");// = VBoxGlobal::qtRTVersionString(); 367 return rt_ver_str.section ('.', 2, 2).toInt(); 368 } 369 370 /* static */ 348 371 QString VBoxGlobal::qtRTVersionString() 349 372 { … … 1784 1807 1785 1808 /* static */ 1809 void VBoxGlobal::setCursor(QWidget *pWidget, const QCursor &cursor) 1810 { 1811 if (!pWidget) 1812 return; 1813 1814 #ifdef VBOX_WS_X11 1815 /* As reported in #9197, in X11 QWidget::setCursor(..) call uses RENDER 1816 * extension. Qt (before 5.11) fails to handle the case where the mentioned extension 1817 * is missing. Please see https://codereview.qt-project.org/#/c/225665/ for Qt patch: */ 1818 if ((VBoxGlobal::qtRTMajorVersion() < 5) || 1819 (VBoxGlobal::qtRTMajorVersion() == 5 && VBoxGlobal::qtRTMinorVersion() < 11)) 1820 { 1821 if (X11CheckExtension("RENDER")) 1822 pWidget->setCursor(cursor); 1823 } 1824 else 1825 { 1826 pWidget->setCursor(cursor); 1827 } 1828 #else 1829 pWidget->setCursor(cursor); 1830 #endif 1831 } 1832 1833 /* static */ 1834 void VBoxGlobal::setCursor(QGraphicsWidget *pWidget, const QCursor &cursor) 1835 { 1836 1837 if (!pWidget) 1838 return; 1839 1840 #ifdef VBOX_WS_X11 1841 /* As reported in #9197, in X11 QGraphicsWidget::setCursor(..) call uses RENDER 1842 * extension. Qt (before 5.11) fails to handle the case where the mentioned extension 1843 * is missing. Please see https://codereview.qt-project.org/#/c/225665/ for Qt patch: */ 1844 if ((VBoxGlobal::qtRTMajorVersion() < 5) || 1845 (VBoxGlobal::qtRTMajorVersion() == 5 && VBoxGlobal::qtRTMinorVersion() < 11)) 1846 { 1847 if (X11CheckExtension("RENDER")) 1848 pWidget->setCursor(cursor); 1849 } 1850 else 1851 { 1852 pWidget->setCursor(cursor); 1853 } 1854 #else 1855 pWidget->setCursor(cursor); 1856 #endif 1857 } 1858 1859 1860 /* static */ 1786 1861 bool VBoxGlobal::supportsFullScreenMonitorsProtocolX11() 1787 1862 { -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r72628 r72678 45 45 46 46 /* Forward declarations: */ 47 class QGraphicsWidget; 47 48 class QMenu; 48 class QToolButton;49 49 class QSessionManager; 50 50 class QSpinBox; 51 class QToolButton; 51 52 class CHostVideoInputDevice; 52 53 class CMachine; … … 150 151 /** Returns Qt runtime version. */ 151 152 static uint qtRTVersion(); 153 /** Returns Qt runtime major version. */ 154 static uint qtRTMajorVersion(); 155 /** Returns Qt runtime minor version. */ 156 static uint qtRTMinorVersion(); 157 /** Returns Qt runtime revision number. */ 158 static uint qtRTRevisionNumber(); 159 152 160 /** Returns Qt compiled version string. */ 153 161 static QString qtCTVersionString(); … … 360 368 /** @} */ 361 369 362 /** @name Window/widget geometrystuff.370 /** @name Window/widget stuff. 363 371 * @{ */ 364 372 /** Search position for @a rectangle to make sure it is fully contained @a boundRegion. */ … … 383 391 /** Activates the specified window with given @a wId. Can @a fSwitchDesktop if requested. */ 384 392 static bool activateWindow(WId wId, bool fSwitchDesktop = true); 393 /** Does some checks on certain platforms before calling QWidget::setCursor(...). */ 394 static void setCursor(QWidget *pWidget, const QCursor &cursor); 395 static void setCursor(QGraphicsWidget *pWidget, const QCursor &cursor); 385 396 386 397 #ifdef VBOX_WS_X11 -
trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxX11Helper.cpp
r71544 r72678 147 147 } 148 148 149 SHARED_LIBRARY_STUFF bool X11CheckExtension(const char *extensionName) 150 { 151 Display *pDisplay = QX11Info::display(); 152 int major_opcode; 153 int first_event; 154 int first_error; 155 return XQueryExtension(pDisplay, extensionName, &major_opcode, &first_event, &first_error); 156 } -
trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxX11Helper.h
r71630 r72678 48 48 /** X11: Restores previously saved screen saver settings. */ 49 49 SHARED_LIBRARY_STUFF void X11ScreenSaverSettingsRestore(); 50 50 /** X11: Returns true if XLib extension with name @p extensionName is avaible, false otherwise. */ 51 SHARED_LIBRARY_STUFF bool X11CheckExtension(const char *extensionName); 51 52 52 53 #endif /* !___VBoxX11Helpers_h___ */ 53 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp
r71074 r72678 68 68 /* External includes: */ 69 69 #ifdef VBOX_WS_X11 70 #include "VBoxX11Helper.h" 70 71 # include <xcb/xcb.h> 71 72 #endif … … 474 475 QList<ulong> screenIds = m_viewports.keys(); 475 476 for (int i = 0; i < screenIds.size(); ++i) 476 m_viewports[screenIds[i]]->setCursor(Qt::BlankCursor);477 VBoxGlobal::setCursor(m_viewports[screenIds[i]], Qt::BlankCursor); 477 478 } 478 479 … … 488 489 QList<ulong> screenIds = m_viewports.keys(); 489 490 for (int i = 0; i < screenIds.size(); ++i) 490 m_viewports[screenIds[i]]->setCursor(uisession()->cursor());491 VBoxGlobal::setCursor(m_viewports[screenIds[i]], uisession()->cursor()); 491 492 } 492 493 … … 1251 1252 } 1252 1253 #endif /* VBOX_WS_WIN */ 1253 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISnapshotDetailsWidget.cpp
r72224 r72678 417 417 setWindowModality(Qt::ApplicationModal); 418 418 /* With the pointing-hand cursor: */ 419 setCursor(Qt::PointingHandCursor);419 VBoxGlobal::setCursor(this, Qt::PointingHandCursor); 420 420 /* And it's being deleted when closed: */ 421 421 setAttribute(Qt::WA_DeleteOnClose); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElement.cpp
r69639 r72678 681 681 { 682 682 if (m_fNameHovered) 683 setCursor(Qt::PointingHandCursor);683 VBoxGlobal::setCursor(this, Qt::PointingHandCursor); 684 684 else 685 685 unsetCursor(); … … 699 699 m_pButton->setAnimationRange(0, iAdditionalHeight); 700 700 } 701 -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupStack.cpp
r71521 r72678 253 253 { 254 254 /* Configure scroll-area: */ 255 m_pScrollArea->setCursor(Qt::ArrowCursor);255 VBoxGlobal::setCursor(m_pScrollArea, Qt::ArrowCursor); 256 256 m_pScrollArea->setWidgetResizable(true); 257 257 m_pScrollArea->setFrameStyle(QFrame::NoFrame | QFrame::Plain); … … 265 265 { 266 266 /* Configure scroll-viewport: */ 267 m_pScrollViewport->setCursor(Qt::ArrowCursor);267 VBoxGlobal::setCursor(m_pScrollViewport, Qt::ArrowCursor); 268 268 /* Connect scroll-viewport: */ 269 269 connect(this, &UIPopupStack::sigProposeStackViewportSize, -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/graphics/UIGraphicsTextPane.cpp
r69500 r72678 31 31 # include "UIGraphicsTextPane.h" 32 32 # include "UIRichTextString.h" 33 # include "VBoxGlobal.h" 33 34 34 35 /* Other VBox includes: */ … … 392 393 unsetCursor(); 393 394 else 394 setCursor(Qt::PointingHandCursor);395 VBoxGlobal::setCursor(this, Qt::PointingHandCursor); 395 396 396 397 /* Update text-layout: */ … … 522 523 return QString(); 523 524 } 524
Note:
See TracChangeset
for help on using the changeset viewer.