itom
Loading...
Searching...
No Matches
lastCommandDockWidget.h
1/* ********************************************************************
2 itom software
3 URL: http://www.uni-stuttgart.de/ito
4 Copyright (C) 2020, 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#ifndef LASTCOMMANDDOCKWIDGET_H
24#define LASTCOMMANDDOCKWIDGET_H
25
26#include "abstractDockWidget.h"
27
28#include <qwidget.h>
29#include <qaction.h>
30#include <qtoolbar.h>
31#include <qpoint.h>
32
33#include <qtreewidget.h>
34
35namespace ito
36{
37 class LastCommandTreeWidget : public QTreeWidget
38 {
39 Q_OBJECT
40
41 public:
42 LastCommandTreeWidget(QWidget * parent = 0) : QTreeWidget(parent) {};
43 virtual ~LastCommandTreeWidget() {};
44
45 protected:
46 QStringList mimeTypes() const;
47#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
48 QMimeData* mimeData(const QList<QTreeWidgetItem*> items) const;
49#else
50 QMimeData* mimeData(const QList<QTreeWidgetItem*>& items) const;
51#endif
52 };
53
55 {
56 Q_OBJECT
57
58 public:
59 LastCommandDockWidget(const QString &title, const QString &objName, QWidget *parent = NULL, bool docked = true, bool isDockAvailable = true, tFloatingStyle floatingStyle = floatingNone, tMovingStyle movingStyle = movingEnabled);
61
62 protected:
63 void createActions();
64 void createMenus();
65 void createToolBars();
66 void createStatusBar(){};
67 void updateActions();
68 void updatePythonActions(){ updateActions(); }
69
70 private:
71 LastCommandTreeWidget *m_lastCommandTreeWidget;
72 QMenu* m_pContextMenu;
73 ShortcutAction* m_pActClearList;
74 QTreeWidgetItem *m_lastTreeWidgetParent;
75 bool m_enabled;
76 QString m_dateColor;
77 bool m_hideDuplicatedCommands;
78
79 signals:
80 void runPythonCommand(const QString cmd);
81
82 private slots:
83 void itemDoubleClicked(QTreeWidgetItem *item, int column);
84 void mnuClearList();
85 void treeWidgetContextMenuRequested(const QPoint &pos);
86
87 public slots:
88 void addLastCommand(QString cmd);
89 void propertiesChanged();
90 };
91
92} //end namespace ito
93
94#endif
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
Definition lastCommandDockWidget.h:55
void addLastCommand(QString cmd)
adds a command string 'cmd' to the list of recently executed commands
Definition lastCommandDockWidget.cpp:226
Definition lastCommandDockWidget.h:38
Definition shortcutAction.h:41
Definition apiFunctionsGraph.cpp:40