- Timestamp:
- Sep 15, 2015 4:43:21 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/main.cpp
r57768 r57769 325 325 int iResultCode = 1; 326 326 327 #ifdef Q_WS_X11328 /* Make sure multi-threaded environment is safe: */329 if (!MakeSureMultiThreadingIsSafe())330 return iResultCode;331 #endif /* Q_WS_X11 */332 333 327 /* Simulate try-catch block: */ 334 328 do 335 329 { 336 #ifdef Q_WS_MAC337 /* Prevent check in AppKit: */338 PreventCheckInAppKit();339 #endif /* Q_WS_MAC */340 341 330 /* Console help preprocessing: */ 342 331 bool fHelpShown = false; … … 359 348 } 360 349 361 #if defined(Q_WS_X11) && defined(RT_OS_LINUX) && defined(DEBUG)362 /* Install signal handler to backtrace the call stack: */363 InstallSignalHandler();364 #endif /* Q_WS_X11 && RT_OS_LINUX && DEBUG */365 366 350 #ifdef VBOX_WITH_HARDENING 367 351 /* Make sure the image verification code works: */ … … 370 354 371 355 #ifdef Q_WS_MAC 372 /* Apply font fixes: */ 356 /* Prevent check in AppKit: */ 357 PreventCheckInAppKit(); 358 359 /* Apply font fixes (before QApplication get created and instantiated font-hints): */ 373 360 switch (VBoxGlobal::osRelease()) 374 361 { … … 377 364 default: break; 378 365 } 366 379 367 # ifdef QT_MAC_USE_COCOA 380 368 /* Instantiate own NSApplication before QApplication do it for us: */ … … 383 371 #endif /* Q_WS_MAC */ 384 372 373 #ifdef Q_WS_X11 374 /* Make sure multi-threaded environment is safe: */ 375 if (!MakeSureMultiThreadingIsSafe()) 376 break; 377 378 # if defined(RT_OS_LINUX) && defined(DEBUG) 379 /* Install signal handler to backtrace the call stack: */ 380 InstallSignalHandler(); 381 # endif /* RT_OS_LINUX && DEBUG */ 382 #endif /* Q_WS_X11 */ 383 385 384 /* Install Qt console message handler: */ 386 385 qInstallMsgHandler(QtMessageOutput); … … 388 387 /* Create application: */ 389 388 QApplication a(argc, argv); 390 391 #ifdef Q_WS_X11392 /* Make all widget native.393 * We did it to avoid various Qt crashes while testing widget attributes or acquiring winIds.394 * Yes, we aware of note that alien widgets faster to draw but the only widget we need to be fast395 * is viewport of VM which was always native since we are using his id for 3D service needs. */396 a.setAttribute(Qt::AA_NativeWindows);397 #endif /* Q_WS_X11 */398 399 #ifdef Q_WS_MAC400 # ifdef VBOX_GUI_WITH_HIDPI401 /* Enable HiDPI icons.402 * For this we require a patched version of Qt 4.x with403 * the changes from https://codereview.qt-project.org/#change,54636 applied. */404 a.setAttribute(Qt::AA_UseHighDpiPixmaps);405 # endif /* VBOX_GUI_WITH_HIDPI */406 #endif /* Q_WS_MAC */407 408 #ifdef Q_OS_SOLARIS409 /* Use plastique look&feel for Solaris instead of the default motif (Qt 4.7.x): */410 QApplication::setStyle(new QPlastiqueStyle);411 #endif /* Q_OS_SOLARIS */412 413 #ifdef Q_WS_X11414 # ifndef Q_OS_SOLARIS415 /* Apply font fixes: */416 QFontDatabase fontDataBase;417 QString currentFamily(QApplication::font().family());418 bool isCurrentScaleable = fontDataBase.isScalable(currentFamily);419 QString subFamily(QFont::substitute(currentFamily));420 bool isSubScaleable = fontDataBase.isScalable(subFamily);421 if (isCurrentScaleable && !isSubScaleable)422 QFont::removeSubstitution(currentFamily);423 # endif /* !Q_OS_SOLARIS */424 #endif /* Q_WS_X11 */425 389 426 390 #ifdef Q_WS_WIN … … 435 399 436 400 #ifdef Q_WS_MAC 401 # ifdef VBOX_GUI_WITH_HIDPI 402 /* Enable HiDPI icons. 403 * For this we require a patched version of Qt 4.x with 404 * the changes from https://codereview.qt-project.org/#change,54636 applied. */ 405 a.setAttribute(Qt::AA_UseHighDpiPixmaps); 406 # endif /* VBOX_GUI_WITH_HIDPI */ 407 437 408 /* Disable menu icons on MacOS X host: */ 438 409 ::darwinDisableIconsInMenus(); … … 440 411 441 412 #ifdef Q_WS_X11 413 /* Make all widget native. 414 * We did it to avoid various Qt crashes while testing widget attributes or acquiring winIds. 415 * Yes, we aware of note that alien widgets faster to draw but the only widget we need to be fast 416 * is viewport of VM which was always native since we are using his id for 3D service needs. */ 417 a.setAttribute(Qt::AA_NativeWindows); 418 419 # ifdef Q_OS_SOLARIS 420 /* Use plastique look&feel for Solaris instead of the default motif (Qt 4.7.x): */ 421 QApplication::setStyle(new QPlastiqueStyle); 422 # endif /* Q_OS_SOLARIS */ 423 424 # ifndef Q_OS_SOLARIS 425 /* Apply font fixes (after QApplication get created and instantiated font-family): */ 426 QFontDatabase fontDataBase; 427 QString currentFamily(QApplication::font().family()); 428 bool isCurrentScaleable = fontDataBase.isScalable(currentFamily); 429 QString subFamily(QFont::substitute(currentFamily)); 430 bool isSubScaleable = fontDataBase.isScalable(subFamily); 431 if (isCurrentScaleable && !isSubScaleable) 432 QFont::removeSubstitution(currentFamily); 433 # endif /* !Q_OS_SOLARIS */ 434 442 435 /* Qt version check (major.minor are sensitive, fix number is ignored): */ 443 436 if (VBoxGlobal::qtRTVersion() < (VBoxGlobal::qtCTVersion() & 0xFFFF00)) … … 648 641 { 649 642 # ifdef Q_WS_MAC 643 /* Prevent check in AppKit: */ 650 644 PreventCheckInAppKit(); 651 645 # endif /* Q_WS_MAC */
Note:
See TracChangeset
for help on using the changeset viewer.