Slicer  4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerScriptedFileDialog.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Copyright (c) Kitware Inc.
6 
7  See COPYRIGHT.txt
8  or http://www.slicer.org/copyright/copyright.txt for details.
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 
16  This file was originally developed by Julien Finet, Kitware Inc.
17  and was partially funded by NIH grant 3P41RR013218-12S1
18 
19 ==============================================================================*/
20 
21 #ifndef __qSlicerScriptedFileDialog_h
22 #define __qSlicerScriptedFileDialog_h
23 
24 // Slicer includes
25 #include "qSlicerFileDialog.h"
26 #include "qSlicerBaseQTGUIExport.h"
27 
28 // Forward Declare PyObject*
29 #ifndef PyObject_HEAD
30 struct _object;
31 typedef _object PyObject;
32 #endif
33 class qSlicerScriptedFileDialogPrivate;
34 
35 class Q_SLICER_BASE_QTGUI_EXPORT qSlicerScriptedFileDialog
37 {
38  Q_OBJECT
39 
40 public:
42  qSlicerScriptedFileDialog(QObject* parent = nullptr);
43  ~qSlicerScriptedFileDialog() override;
44 
45  QString pythonSource()const;
46 
49  bool setPythonSource(const QString& newPythonSource, const QString& className = QLatin1String(""), bool missingClassIsExpected = true);
50 
52  Q_INVOKABLE PyObject* self() const;
53 
55  bool isMimeDataAccepted(const QMimeData* mimeData)const override;
57  void dropEvent(QDropEvent* event) override;
59  bool exec(const qSlicerIO::IOProperties& ioProperties =
60  qSlicerIO::IOProperties()) override;
61 
64  Q_INVOKABLE const qSlicerIO::IOProperties& ioProperties()const;
67  Q_INVOKABLE const QMimeData* mimeData()const;
70  Q_INVOKABLE QDropEvent* dropEvent()const;
71 
72 public Q_SLOTS:
73  void acceptMimeData(bool accept);
74 
75 protected:
76  QScopedPointer<qSlicerScriptedFileDialogPrivate> d_ptr;
77 
78 private:
79  Q_DECLARE_PRIVATE(qSlicerScriptedFileDialog);
80  Q_DISABLE_COPY(qSlicerScriptedFileDialog);
81 };
82 
83 #endif
_object PyObject
bool exec(const qSlicerIO::IOProperties &ioProperties=qSlicerIO::IOProperties()) override
virtual void dropEvent(QDropEvent *event)
qSlicerStandardFileDialog Superclass
QScopedPointer< qSlicerScriptedFileDialogPrivate > d_ptr
_object PyObject
virtual bool isMimeDataAccepted(const QMimeData *mimeData) const