ImagingTools Core SDK
CQuickApplicationComp.h
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ImtCore-Commercial
2#pragma once
3
4
5// ImtCore includes
6#include <imtqml/CQuickApplicationCompBase.h>
7
8
9namespace imtqml
10{
11
12
13class CQuickApplicationComp:
14 public QObject,
15 public CQuickApplicationCompBase
16{
17 Q_OBJECT
18public:
19 typedef imtqml::CQuickApplicationCompBase BaseClass;
20
21 I_BEGIN_COMPONENT(CQuickApplicationComp);
22 I_REGISTER_INTERFACE(ibase::IApplication);
23 I_ASSIGN(m_mainQuickCompPtr, "MainQuickWindow", "QuickWindow object shown as main window", false, "MainGui");
24 I_ASSIGN(m_windowWidthAttrPtr, "WindowWidth", "Window width", false, 800);
25 I_ASSIGN(m_windowHeightAttrPtr, "WindowHeight", "Window height", false, 600);
26 I_ASSIGN(m_minimumWindowWidthAttrPtr, "MinimumWindowWidth", "Minimum window width", false, 800);
27 I_ASSIGN(m_minimumWindowHeightAttrPtr, "MinimumWindowHeight", "Minimum window height", false, 600);
28 I_ASSIGN(m_visibilityAttrPtr, "Visibility", "The screen-occupation state of the window:\n0 - Hidden;\n1 - AutomaticVisibility;\n2 - Windowed;\n3 - Minimized;\n4 - Maximized;\n5 - FullScreen", false, 1);
29 I_END_COMPONENT;
30
31 CQuickApplicationComp();
32
33 // reimplemented (ibase::IGuiApplication)
34 virtual const imtqml::IQuickObject* GetApplicationItem() const;
35
36 // reimplemented (ibase::IApplication)
37 virtual bool InitializeApplication(int argc, char** argv) override;
38 virtual int Execute(int argc, char** argv) override;
39 virtual QString GetHelpText() const override;
40
41protected:
42 // reimplemented (icomp::CComponentBase)
43 virtual void OnComponentDestroyed() override;
44
45private Q_SLOTS:
46 void OnQuit();
47 void OnEventLoopStarted();
48
49protected:
50 I_REF(imtqml::IQuickObject, m_mainQuickCompPtr);
51 I_ATTR(int, m_windowWidthAttrPtr);
52 I_ATTR(int, m_windowHeightAttrPtr);
53 I_ATTR(int, m_minimumWindowWidthAttrPtr);
54 I_ATTR(int, m_minimumWindowHeightAttrPtr);
55 I_ATTR(int, m_visibilityAttrPtr);
56};
57
58
59} // namespace imtqml
60
61