ADTF Qt5
Loading...
Searching...
No Matches
adtf::ui::testing::v2::cInitQt Class Reference

A RAII utility class for automatic Qt Application initialization. More...

#include <qt_test_tools.h>

Public Member Functions

 cInitQt ()
 Constructor that checks for and initializes the Qt environment.
 
 cInitQt (const cInitQt &)=delete
 Deleted copy constructor to prevent multiple ownership of the QApplication.
 
cInitQtoperator= (const cInitQt &)=delete
 Deleted assignment operator.
 

Detailed Description

A RAII utility class for automatic Qt Application initialization.

  • This class ensures that a QApplication instance exists before any Qt-related operations (like creating UI components or using signals/slots) are performed. It is particularly useful in environments like unit tests where the host process may not have initialized the Qt event loop.

Constructor & Destructor Documentation

◆ cInitQt()

adtf::ui::testing::v2::cInitQt::cInitQt ( )
inline

Constructor that checks for and initializes the Qt environment.

  • If the global pointer qApp is null, this constructor creates a new
  • Warning
    This class should ideally be instantiated on the Main/GUI thread.

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