qHexWalker 0.0.1
Hexagonal Grid Pathfinding & Maze Visualization on Interactive Maps
Loading...
Searching...
No Matches
Application Class Referencefinal

Main application class extending QGuiApplication. More...

#include <application.h>

+ Inheritance diagram for Application:
+ Collaboration diagram for Application:

Public Member Functions

 Application (int &argc, char **argv)
 Constructs the Application.
 
auto getApplicationName () const noexcept
 Gets the application name.
 
auto getApplicationVersion () const noexcept
 Gets the application version.
 
auto getLoggerName () const noexcept
 Gets the logger name for spdlog.
 

Protected Member Functions

bool eventFilter (QObject *obj, QEvent *event) override
 Global event filter for the application.
 

Private Attributes

std::string loggerName_
 Logger name for spdlog.
 
QString appName_
 Application name.
 
QString appVersion_
 Application version string.
 

Detailed Description

Main application class extending QGuiApplication.

The Application class provides:

  • Application metadata (name, version, logger name)
  • Global event filtering for the entire application
  • Configuration from build-time settings
Example Usage
int main(int argc, char *argv[]) {
Application app(argc, argv);
qDebug() << app.getApplicationName();
qDebug() << app.getApplicationVersion();
return app.exec();
}
Main application class extending QGuiApplication.
Definition application.h:39
int main(int argc, char *argv[])
Definition main.cpp:16
See also
EntryPoint for UI initialization

Definition at line 39 of file application.h.

Constructor & Destructor Documentation

◆ Application()

Application::Application ( int &  argc,
char **  argv 
)

Constructs the Application.

Initializes application metadata from build configuration (config.h) and sets up the event filter.

Parameters
argcCommand line argument count.
argvCommand line argument values.

Definition at line 4 of file application.cpp.

References appName_, appVersion_, and loggerName_.

Member Function Documentation

◆ eventFilter()

bool Application::eventFilter ( QObject *  obj,
QEvent *  event 
)
overrideprotected

Global event filter for the application.

Filters all events before they reach their target objects. Can be used for global keyboard shortcuts, logging, etc.

Parameters
objThe object receiving the event.
eventThe event being processed.
Returns
true if the event should be filtered out, false otherwise.

Definition at line 10 of file application.cpp.

◆ getApplicationName()

auto Application::getApplicationName ( ) const
inlinenoexcept

Gets the application name.

Returns
Application name from build configuration.

Definition at line 56 of file application.h.

References appName_.

Referenced by main().

+ Here is the caller graph for this function:

◆ getApplicationVersion()

auto Application::getApplicationVersion ( ) const
inlinenoexcept

Gets the application version.

Returns
Version string (e.g., "0.0.1").

Definition at line 62 of file application.h.

References appVersion_.

Referenced by main().

+ Here is the caller graph for this function:

◆ getLoggerName()

auto Application::getLoggerName ( ) const
inlinenoexcept

Gets the logger name for spdlog.

Returns
Logger name string.

Definition at line 68 of file application.h.

References loggerName_.

Referenced by main().

+ Here is the caller graph for this function:

Member Data Documentation

◆ appName_

QString Application::appName_
private

Application name.

Definition at line 85 of file application.h.

Referenced by Application(), and getApplicationName().

◆ appVersion_

QString Application::appVersion_
private

Application version string.

Definition at line 86 of file application.h.

Referenced by Application(), and getApplicationVersion().

◆ loggerName_

std::string Application::loggerName_
private

Logger name for spdlog.

Definition at line 84 of file application.h.

Referenced by Application(), and getLoggerName().


The documentation for this class was generated from the following files: