File: fakeqtconfigarguments.h

package info (click to toggle)
martchus-cpp-utilities 5.28.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,352 kB
  • sloc: cpp: 12,471; awk: 18; ansic: 12; makefile: 10
file content (52 lines) | stat: -rw-r--r-- 1,162 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef APPLICATION_UTILITIES_FAKEQTCONFIGARGUMENTS_H
#define APPLICATION_UTILITIES_FAKEQTCONFIGARGUMENTS_H

#include "./argumentparser.h"

namespace CppUtilities {

class CPP_UTILITIES_EXPORT FakeQtConfigArguments {
public:
    FakeQtConfigArguments();

    Argument &qtWidgetsGuiArg();
    Argument &qtQuickGuiArg();

    bool areQtGuiArgsPresent() const;

private:
    Argument m_qtWidgetsGuiArg;
    Argument m_qtQuickGuiArg;
};

/*!
 * \brief Returns the argument to show the Qt-widgets-based GUI.
 */
inline Argument &FakeQtConfigArguments::qtWidgetsGuiArg()
{
    return m_qtWidgetsGuiArg;
}

/*!
 * \brief Returns the argument to show the Qt-quick-based GUI.
 */
inline Argument &FakeQtConfigArguments::qtQuickGuiArg()
{
    return m_qtQuickGuiArg;
}

/*!
 * \brief Returns whether at least one of the arguments is present.
 */
inline bool FakeQtConfigArguments::areQtGuiArgsPresent() const
{
    return m_qtWidgetsGuiArg.isPresent() || m_qtQuickGuiArg.isPresent();
}

} // namespace CppUtilities

#ifndef QT_CONFIG_ARGUMENTS
#define QT_CONFIG_ARGUMENTS CppUtilities::FakeQtConfigArguments
#endif

#endif // APPLICATION_UTILITIES_FAKEQTCONFIGARGUMENTS_H