itom
Loading...
Searching...
No Matches
AIManagerWidget.h
1/* ********************************************************************
2 itom software
3 URL: http://www.uni-stuttgart.de/ito
4 Copyright (C) 2024, Institut für Technische Optik (ITO),
5 Universität Stuttgart, Germany
6
7 This file is part of itom.
8
9 itom is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Library General Public Licence as published by
11 the Free Software Foundation; either version 2 of the Licence, or (at
12 your option) any later version.
13
14 itom is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
17 General Public Licence for more details.
18
19 You should have received a copy of the GNU Library General Public License
20 along with itom. If not, see <http://www.gnu.org/licenses/>.
21*********************************************************************** */
22
23#pragma once
24
25#include "../organizer/uiOrganizer.h"
26#include "../../common/addInInterface.h"
27#include "abstractDockWidget.h"
28#include "../ui/helpTreeDockWidget.h"
29
30#include <qdockwidget.h>
31#include <qtreeview.h>
32#include <qmenu.h>
33#include <qaction.h>
34#include <qsortfilterproxymodel.h>
35
36namespace ito
37{
38 class PlugInModel; //forward declaration
39
41 {
42 Q_OBJECT
43
44 Q_PROPERTY(QColor backgroundColorInstancesWithPythonRef READ backgroundColorInstancesWithPythonRef WRITE setBackgroundColorInstancesWithPythonRef)
45
46 public:
47// AIManagerWidget();
48 AIManagerWidget(const QString &title, const QString &objName, QWidget *parent = NULL, bool docked = true, bool isDockAvailable = true, tFloatingStyle floatingStyle = floatingNone, tMovingStyle movingStyle = movingEnabled);
50
52 QColor backgroundColorInstancesWithPythonRef() const;
53 void setBackgroundColorInstancesWithPythonRef(const QColor &bgColor);
54
55 protected:
56// QList<QAction*> getAlgoWidgetActions(const ito::AddInInterfaceBase *aib);
57 // void closeEvent(QCloseEvent *event) {};
58 QMenu* m_pContextMenu;
59 QMenu* m_pAIManagerViewSettingMenu;
60
61 QToolBar* m_pMainToolbar;
62
63 QAction *m_pShowConfDialog;
64 QAction *m_pActDockWidget;
65 QAction *m_pActDockWidgetToolbar;
66 QAction *m_pActNewInstance;
67 QAction *m_pActCloseInstance;
68 QAction *m_pActCloseAllInstances;
69 QAction *m_pActSendToPython;
70 QAction *m_pActLiveImage;
71 QAction *m_pActSnapDialog;
72 QAction *m_pActAutoGrabbing;
73 QAction *m_pActInfo;
74 QAction *m_pActOpenWidget;
75 QAction *m_pMainToolbarSeparator1;
76 QAction *m_pMainToolbarSeparator2;
77
78 ShortcutAction* m_pViewList;
79 ShortcutAction* m_pViewDetails;
80
81 void createActions();
82 void createMenus();
83 void createToolBars();
84 void createStatusBar(){}
85 void updateActions();
86 void updatePythonActions(){ updateActions(); }
87 void closeInstance(const QModelIndex index);
88
89 private:
90 void treeViewHideOrShowColumns(const bool& hide);
91
92 QTreeView *m_pAIManagerView;
93 QSortFilterProxyModel *m_pSortFilterProxyModel;
94 bool m_showColumnDetails;
95 QList<int> m_detailColumnsWidth;
96 PlugInModel *m_pPlugInModel;
97
98 public slots:
99
100 private slots:
101 void treeViewContextMenuRequested(const QPoint &pos);
102 void selectionChanged(const QItemSelection& newSelection, const QItemSelection& oldSelection);
103 void mnuShowConfdialog();
104 void mnuToggleDockWidget();
105 void mnuCreateNewInstance();
106 void mnuCloseInstance();
107 void mnuCloseAllInstances();
108 void mnuSendToPython();
109 void mnuShowAlgoWidget(ito::AddInAlgo::AlgoWidgetDef* awd);
110 void mnuOpenWidget();
111 void mnuToggleView();
112 void mnuShowLiveImage();
113 void mnuSnapDialog();
114 void mnuToggleAutoGrabbing();
115 void showList();
116 void showDetails();
117 void mnuShowInfo();
118
119 signals:
120 void showPluginInfo(QString name, HelpTreeDockWidget::HelpItemType type);
121 void showDockWidget();
122 };
123
124}; // namespace ito
Definition AIManagerWidget.h:41
~AIManagerWidget()
returns the background color for instances, that have been created by Python or which have at least o...
Definition AIManagerWidget.cpp:196
abstract dock widget class which inherits QDockWidget. The content of QDockWidget consists of an inst...
Definition abstractDockWidget.h:55
tMovingStyle
The configuration if a docked AbstractDockWidget can be moved from one docking area to another one.
Definition abstractDockWidget.h:97
@ movingEnabled
Definition abstractDockWidget.h:99
tFloatingStyle
The floating style of a widget, derived from AbstractDockWidget.
Definition abstractDockWidget.h:89
@ floatingNone
Definition abstractDockWidget.h:90
container for publishing widgets provided by any plugin
Definition addInInterface.h:1046
class for visualizing the available (loaded) plugins
Definition pluginModel.h:78
Definition shortcutAction.h:41
Definition apiFunctionsGraph.cpp:40