Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
QmitkGnuplotWidget.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef QmitkGnuplotWidget_h
14 #define QmitkGnuplotWidget_h
15 
17 #include <QProcess>
18 #include <QScopedPointer>
19 #include <QWidget>
20 #include <itkTimeStamp.h>
21 
22 class QAction;
23 class QMenu;
24 
25 namespace Ui
26 {
27  class QmitkGnuplotWidget;
28 }
29 
31 {
32  Q_OBJECT
33 
34 public:
35  explicit QmitkGnuplotWidget(QWidget *parent = nullptr);
36  ~QmitkGnuplotWidget() override;
37 
38  QString GetGnuplotPath() const;
39  void SetGnuplotPath(const QString &path);
40 
41  QStringList GetCommands() const;
42  void SetCommands(const QStringList &commands);
43 
44  void Update();
45 
46  QSize sizeHint() const override;
47 
48 protected:
49  void contextMenuEvent(QContextMenuEvent *event) override;
50  void resizeEvent(QResizeEvent *event) override;
51 
52 private slots:
53  void OnProcessStateChanged(QProcess::ProcessState state);
54  void OnProcessError(QProcess::ProcessError error);
55  void OnProcessFinished(int exitCode, QProcess::ExitStatus exitStatus);
56  void OnCopyPlot();
57  void OnCopyScript();
58 
59 private:
60  void CreateContextMenu();
61  QString CreateSetTermCommand() const;
62 
63  QScopedPointer<Ui::QmitkGnuplotWidget> m_Ui;
64  QMenu *m_ContextMenu;
65  QAction *m_CopyPlotAction;
66  QAction *m_CopyScriptAction;
67  QProcess *m_Process;
68  QString m_GnuplotPath;
69  QStringList m_Commands;
70  itk::TimeStamp m_ModifiedTime;
71  itk::TimeStamp m_UpdateTime;
72 };
73 
74 #endif
MITKQTWIDGETSEXT_EXPORT
#define MITKQTWIDGETSEXT_EXPORT
Definition: MitkQtWidgetsExtExports.h:15
QmitkGnuplotWidget
Definition: QmitkGnuplotWidget.h:30
Ui
Definition: BlueBerryExampleLauncherDialog.h:21
MitkQtWidgetsExtExports.h