ICF 3.1.1.10
Technical documentation of ICF Libraries
CMultiBitmapSupplierGuiComp.h
Go to the documentation of this file.
1/********************************************************************************
2** This file is part of the ICF Framework. Copyright (C) Witold Gantzke & Kirill Lepskiy
3** ICF Framework may be used under the terms of the LGPL License v. 2.1 by the Free Software Foundation.
4********************************************************************************/
5
6#pragma once
7
8
9// Qt includes
10#include <QtCore/QTimer>
11
12// ICF includes
13#include <iimg/CBitmap.h>
17#include <GeneratedFiles/icamgui/ui_CMultiBitmapSupplierGuiComp.h>
18
19
20namespace icamgui
21{
22
23
25 public iinspgui::TSupplierGuiCompBase<Ui::CMultiBitmapSupplierGuiComp>
26{
27 Q_OBJECT
28
29public:
31
32 I_BEGIN_COMPONENT(CMultiBitmapSupplierGuiComp);
33 I_ASSIGN(m_singleBitmapPersistenceCompPtr, "SingleBitmapPersistence", "Persistence for saving a single bitmap", false, "SingleBitmapPersistence");
34 I_ASSIGN(m_multiBitmapPersistenceCompPtr, "MultiBitmapPersistence", "Persistence for saving all camera images in a document", false, "MultiBitmapPersistence");
35 I_ASSIGN(m_iconSizeAttrPtr, "IconSize", "Maximum icon size in preview in px. Use 0 if you want to disable bitmap preview", true, 48);
36 I_ASSIGN(m_filePathFormatAttrPtr, "FilePathFormat", "Format of file path used to save bitmap, used only if save folder is used.\n\t- %1 will be replaced with current date\n\t- %2 with time\n\t- %3 with channel index\n\t- %4 with image resolution", true, "%1%2_%3.png");
37 I_END_COMPONENT;
38
40
41protected Q_SLOTS:
43 void on_LiveImageButton_toggled(bool checked);
46 void on_BitmapPreview_currentItemChanged(QListWidgetItem* current, QListWidgetItem* previous);
50
51protected:
52 // reimplemented (istdgui::CGuiComponentBase)
53 void OnGuiCreated() override;
54 void OnGuiHidden() override;
55
56 // reimplemented (iinspgui::TSupplierGuiCompBase)
57 QWidget* GetParamsWidget() const override;
58
59 // reimplemented (i2dgui::TViewExtenderCompBase)
60 void CreateShapes(int sceneId, Shapes& result) override;
61
62 // reimplemented (istdgui::TGuiObserverWrap)
63 void OnGuiModelAttached() override;
64 void UpdateGui(const istd::IChangeable::ChangeSet& changeSet) override;
65
66private:
70 void SelectBitmap(int bitmapIdx);
71
72 void ExportSelectedBitmap(const QString& filePath = QString());
73 void ExportBitmapDocument(const QString& filePath = QString());
74 void UpdateCommands();
75
76 static QString CreateFileFilterForPersistence(const ifile::IFilePersistence& persistence);
77
78private:
79 I_REF(ifile::IFilePersistence, m_singleBitmapPersistenceCompPtr);
80 I_REF(ifile::IFilePersistence, m_multiBitmapPersistenceCompPtr);
81 I_ATTR(int, m_iconSizeAttrPtr);
82 I_TEXTATTR(m_filePathFormatAttrPtr);
83
86
87 QList<QIcon>m_icons;
88
89 QTimer m_timer;
90};
91
92
93} // namespace icamgui
94
95
void OnGuiHidden() override
Called from widget event filter when slave widget is hidden.
void on_LiveImageButton_toggled(bool checked)
void CreateShapes(int sceneId, Shapes &result) override
QWidget * GetParamsWidget() const override
void on_BitmapPreview_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous)
iinspgui::TSupplierGuiCompBase< Ui::CMultiBitmapSupplierGuiComp > BaseClass
void OnGuiCreated() override
Called just after GUI is initialized.
void UpdateGui(const istd::IChangeable::ChangeSet &changeSet) override
Interface providing loading and saving of data objects.
Generic implementation of a multi-page bitmap.
This model wrapper provides a simple connection between a concrete istd::IChangeable implementation a...
Definition TModelWrap.h:28
Set of change flags (its IDs).
Definition IChangeable.h:38
This package contains Qt based camera implementations.

© Witold Gantzke and Kirill Lepskiy