itom  4.1.0
pythonMessageDockWidget.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2018, Institut fuer Technische Optik (ITO),
5  Universitaet 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 PYTHONMESSAGEDOCKWIDGET_H
24 #define PYTHONMESSAGEDOCKWIDGET_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 
35 namespace ito
36 {
37  class PythonMessageTreeWidget : public QTreeWidget
38  {
39  Q_OBJECT
40 
41  public:
42  PythonMessageTreeWidget(QWidget * parent = 0) : QTreeWidget(parent) {};
43  virtual ~PythonMessageTreeWidget() {};
44 
45  protected:
46  QStringList mimeTypes() const;
47  QMimeData * mimeData(const QList<QTreeWidgetItem *> items) const;
48  };
49 
51  {
52  Q_OBJECT
53 
54  public:
55  PythonMessageDockWidget(const QString &title, const QString &objName, QWidget *parent = NULL, bool docked = true, bool isDockAvailable = true, tFloatingStyle floatingStyle = floatingNone, tMovingStyle movingStyle = movingEnabled);
57 
58  protected:
59  void createActions();
60  void createMenus();
61  void createToolBars();
62  void createStatusBar(){};
63  void updateActions();
64  void updatePythonActions(){ updateActions(); }
65 
66  private:
67  PythonMessageTreeWidget *m_pythonMessageTreeWidget;
68  QMenu* m_pContextMenu;
69  ShortcutAction* m_pActClearList;
70  QTreeWidgetItem *m_pythonTreeWidgetParent;
71  bool m_enabled;
72  QString m_dateColor;
73  QString m_message;
74  bool m_doubleCommand;
75 
76  signals:
77  void runPythonCommand(const QString cmd);
78 
79  private slots:
80  void itemDoubleClicked(QTreeWidgetItem *item, int column);
81  void mnuClearList();
82  void treeWidgetContextMenuRequested(const QPoint &pos);
83 
84  public slots:
85  void addPythonMessage(QString cmd);
86  void propertiesChanged();
87  };
88 
89 } //end namespace ito
90 
91 #endif
Definition: apiFunctionsGraph.cpp:39
Definition: shortcutAction.h:40
abstract dock widget class which inherits QDockWidget. The content of QDockWidget consists of an inst...
Definition: abstractDockWidget.h:54
tFloatingStyle
The floating style of a widget, derived from AbstractDockWidget.
Definition: abstractDockWidget.h:88
Definition: abstractDockWidget.h:90
Definition: abstractDockWidget.h:99
bool docked() const
Definition: abstractDockWidget.h:128
tMovingStyle
The configuration if a docked AbstractDockWidget can be moved from one docking area to another one...
Definition: abstractDockWidget.h:96
Definition: pythonMessageDockWidget.h:37
Definition: pythonMessageDockWidget.h:50