From 43f74f3a840c3ffe182f26556231e380179cd9bf Mon Sep 17 00:00:00 2001 From: "Eshan Roy (Eshanized)" Date: Fri, 10 May 2024 03:34:34 +0530 Subject: [PATCH] docs(reform): reformat the files with explanation --- qt/main.cpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/qt/main.cpp b/qt/main.cpp index 0a92433..a96848f 100644 --- a/qt/main.cpp +++ b/qt/main.cpp @@ -1,14 +1,31 @@ -//main function of the application, responsible for starting the Qt application and -//creating an instance of the SnigdhaOSAssistant class. +/* +* main function of the application, responsible for starting the Qt application and +* creating an instance of the SnigdhaOSAssistant class. +*/ #include "snigdhaosassistant.h" #include - +/* +* creates a QApplication object, which manages the GUI application's control flow and main settings. +*/ int main(int argc, char* argv[]) { QApplication a(argc, argv); + /* + * creates an instance of the SnigdhaOSAssistant class named w. + * it passes nullptr as the parent widget and either the second command line argument (argv[1]) + * or an empty string as the initial state of the application. + */ SnigdhaOSAssistant w(nullptr, a.arguments().length() > 1 ? a.arguments()[1] : ""); + /* + * displays the main window of the application (w) on the screen. + */ w.show(); + /* + * starts the event loop of the application by calling the exec() function of the QApplication object (a). + * the event loop waits for events to occur and dispatches them to event handlers. + * the function will return when the application exits, typically after the main window is closed. + */ return a.exec(); }