![]() IMPORTANT if it is no longer a typedef use the normal variant above Need to pass name here as CAmount is a typedef (see ) Register meta types used for QMetaObject::invokeMethod So the notifications and GUI updates are made async. > Here several object types are registered with the Qt system so they can > BitcoinApplication is a Qt QApplication derived class. BitcoinApplication class is discussed in qt/bitcoin.h. The node pointer that was instantiated earlier > The main BitcoinApplication is created. QApplication::setAttribute(Qt::AA_DontShowIconsInMenus) QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling) QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps) Basic Qt initialization (not dependent on parameters or configuration) Do not refer to data directory yet, this can be overridden by Intro::pickDataDirectory Std::unique_ptr handler_init_message = node->handleInitMessage(noui_InitMessage) Std::unique_ptr handler_question = node->handleQuestion(noui_ThreadSafeQuestion) Std::unique_ptr handler_message_box = node->handleMessageBox(noui_ThreadSafeMessageBox) > interfaces::Handler is just a thin wrapper around boost::signals2::connection The boost::signals2 library is used to handle these. > Here several pointers to event handlers are instantiated to handle Std::unique_ptr node = interfaces::MakeNode() > that bitcoind does as a daemon offering an entry point to several services. A Node is an interface offered by the Bitcoin node. > Instantiates interfaces::Node using the interfaces::MakeNode() factory > calls pthread_set_name_np and on MacOSX it calls pthread_setname_np > ThreadRename(std::string name) calls into util/threadnames.cpp and sets > On Windows it sets the charset to UTF8. It then sets the locale for POSIX systems. > It starts by configuring the memory allocator so that 32 bit systems only > SetupEnvironment() sets up memory allocation and locale. > in C++ you need a function to turn a rvalue tuple (a,b) into ![]() > While std::tie(argc, argv) may look intuitive to python programmers, > to return a std::pair via the get() method. > If being compiled on Windows, uses the WinCmdLineArgs from util/system.h > Compile-time conditional checks for Windows32 API: I left most original comments unchanged, unless when I could provide additional information or edit for clarity. Note: My comments start with a > while original source code comments start with //. Returning from GuiMain means exiting the program, since it’s the second call in our stack, right after main() When exec() returns, the application begins its shutdown procedure. GuiMain gets the GUI set up, connects Qt signals/slots, starts up a Node (wrapper around bitcoind functionality) and gets the Qt event loop running via the exec() call. So, by sticking to our strategy, I’ll step into the call stack which now has GuiMain() at the top. Main.cpp, the Bitcoin Qt application entry point, is basically just a stub that calls GuiMain() at qt/bitcoin.cpp Qt/bitcoin.cpp is where Bitcoin Core initialization leads us next.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |