Changeset View
Changeset View
Standalone View
Standalone View
src/qt/bitcoin.cpp
Show First 20 Lines • Show All 167 Lines • ▼ Show 20 Lines | try { | ||||
Q_EMIT shutdownResult(); | Q_EMIT shutdownResult(); | ||||
} catch (const std::exception &e) { | } catch (const std::exception &e) { | ||||
handleRunawayException(&e); | handleRunawayException(&e); | ||||
} catch (...) { | } catch (...) { | ||||
handleRunawayException(nullptr); | handleRunawayException(nullptr); | ||||
} | } | ||||
} | } | ||||
BitcoinApplication::BitcoinApplication(interfaces::Node &node, int &argc, | static int qt_argc = 1; | ||||
char **argv) | static const char *qt_argv = "bitcoin-qt"; | ||||
: QApplication(argc, argv), coreThread(nullptr), m_node(node), | |||||
optionsModel(nullptr), clientModel(nullptr), window(nullptr), | BitcoinApplication::BitcoinApplication(interfaces::Node &node) | ||||
pollShutdownTimer(nullptr), returnValue(0), platformStyle(nullptr) { | : QApplication(qt_argc, const_cast<char **>(&qt_argv)), coreThread(nullptr), | ||||
m_node(node), optionsModel(nullptr), clientModel(nullptr), | |||||
window(nullptr), pollShutdownTimer(nullptr), returnValue(0), | |||||
platformStyle(nullptr) { | |||||
setQuitOnLastWindowClosed(false); | setQuitOnLastWindowClosed(false); | ||||
} | } | ||||
void BitcoinApplication::setupPlatformStyle() { | void BitcoinApplication::setupPlatformStyle() { | ||||
// UI per-platform customization | // UI per-platform customization | ||||
// This must be done inside the BitcoinApplication constructor, or after it, | // This must be done inside the BitcoinApplication constructor, or after it, | ||||
// because PlatformStyle::instantiate requires a QApplication. | // because PlatformStyle::instantiate requires a QApplication. | ||||
std::string platformName; | std::string platformName; | ||||
▲ Show 20 Lines • Show All 343 Lines • ▼ Show 20 Lines | #endif | ||||
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); | QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); | ||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) | #if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) | ||||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); | QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); | ||||
#endif | #endif | ||||
#ifdef Q_OS_MAC | #ifdef Q_OS_MAC | ||||
QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); | QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); | ||||
#endif | #endif | ||||
BitcoinApplication app(*node, argc, argv); | BitcoinApplication app(*node); | ||||
// Register meta types used for QMetaObject::invokeMethod | // Register meta types used for QMetaObject::invokeMethod | ||||
qRegisterMetaType<bool *>(); | qRegisterMetaType<bool *>(); | ||||
#ifdef ENABLE_WALLET | #ifdef ENABLE_WALLET | ||||
qRegisterMetaType<WalletModel *>(); | qRegisterMetaType<WalletModel *>(); | ||||
#endif | #endif | ||||
// Need to pass name here as Amount is a typedef (see | // Need to pass name here as Amount is a typedef (see | ||||
// http://qt-project.org/doc/qt-5/qmetatype.html#qRegisterMetaType) | // http://qt-project.org/doc/qt-5/qmetatype.html#qRegisterMetaType) | ||||
▲ Show 20 Lines • Show All 208 Lines • Show Last 20 Lines |