int main(int argc, char *argv[]) { #if QT_VERSION > QT_VERSION_CHECK(5, 6, 0) QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true); #ifdef Q_OS_WIN32 SetProcessDPIAware(); HDC screen = GetDC(0); qreal dpix = GetDeviceCaps(screen, LOGPIXELSX); qreal dpiy = GetDeviceCaps(screen, LOGPIXELSY); qreal scale = dpiy / qreal(96); qputenv("QT_SCALE_FACTOR", QByteArray::number(scale)); ReleaseDC(NULL, screen); qDebug() << "Current DPI x: " << dpix << " y: " << dpiy << " setting scale:" << scale; #else QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true); #endif #endif CliApplication cliApp( argc, argv, APP ); if( cliApp.isDiagnosticRun() ) { return cliApp.run(); } Common app( argc, argv, APP, ":/images/id_icon_128x128.png" ); #ifndef Q_OS_MAC if( app.isRunning() ) { app.sendMessage( "" ); return 0; } #endif SSL_library_init(); MainWindow w; Configuration::instance().checkVersion("QESTEIDUTIL"); #ifndef Q_OS_MAC QObject::connect( &app, SIGNAL(messageReceived(QString)), &w, SLOT(raiseAndRead()) ); #endif w.show(); if(QWidget *data = w.findChild<QWidget*>("dataWidget")) data->setFixedSize(data->geometry().size()); // Hack for avoiding Qt Resize window IB-4242 return app.exec(); }
int main(int argc, char *argv[]) { #ifdef Q_OS_MAC QFont::insertSubstitution(".Lucida Grande UI", "Lucida Grande"); //Mac 10.9 fix #endif Common app( argc, argv ); app.setApplicationName( APP ); app.setApplicationVersion( QString( "%1.%2.%3.%4" ) .arg( MAJOR_VER ).arg( MINOR_VER ).arg( RELEASE_VER ).arg( BUILD_VER ) ); app.setOrganizationDomain( DOMAINURL ); app.setOrganizationName( ORG ); app.setWindowIcon( QIcon( ":/images/id_icon_128x128.png" ) ); app.detectPlugins(); #ifdef BREAKPAD if( QBreakPad::isCrashReport( argc, argv ) ) { QBreakPadDialog d( app.applicationName() ); d.setProperty( "User-Agent", QString( "%1/%2 (%3)" ) .arg( app.applicationName(), app.applicationVersion(), app.applicationOs() ).toUtf8() ); d.show(); return app.exec(); } QBreakPad breakpad; #endif #ifndef Q_OS_MAC if( app.isRunning() ) { app.sendMessage( "" ); return 0; } #endif SSL_library_init(); MainWindow w; #ifndef Q_OS_MAC QObject::connect( &app, SIGNAL(messageReceived(QString)), &w, SLOT(raiseAndRead()) ); #endif w.show(); return app.exec(); }
int main(int argc, char *argv[]) { Common app(argc, argv); app.setApplicationName( APP ); app.setApplicationVersion( VER_STR( FILE_VER_DOT ) ); app.setOrganizationDomain( DOMAINURL ); app.setOrganizationName( ORG ); app.setWindowIcon( QIcon( ":/images/id_icon_big.png" ) ); if( app.isRunning() ) { app.sendMessage( "" ); return 0; } SSL_library_init(); MainWindow w; QObject::connect( &app, SIGNAL(messageReceived(QString)), &w, SLOT(raiseAndRead()) ); w.show(); return app.exec(); }