Slicer 5.6
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
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
30struct _object;
31typedef _object PyObject;
32#endif
33class qSlicerScriptedFileDialogPrivate;
34
35class Q_SLICER_BASE_QTGUI_EXPORT qSlicerScriptedFileDialog
37{
38 Q_OBJECT
39
40public:
42 qSlicerScriptedFileDialog(QObject* parent = nullptr);
44
45 QString pythonSource()const;
46
49 bool setPythonSource(const QString& filePath, 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
72public Q_SLOTS:
73 void acceptMimeData(bool accept);
74
75protected:
76 QScopedPointer<qSlicerScriptedFileDialogPrivate> d_ptr;
77
78private:
79 Q_DECLARE_PRIVATE(qSlicerScriptedFileDialog);
80 Q_DISABLE_COPY(qSlicerScriptedFileDialog);
81};
82
83#endif
void dropEvent(QDropEvent *event) override
Reimplemented to propagate to python methods.
bool setPythonSource(const QString &filePath, const QString &className=QLatin1String(""), bool missingClassIsExpected=true)
bool isMimeDataAccepted(const QMimeData *mimeData) const override
Reimplemented to propagate to python methods.
bool exec(const qSlicerIO::IOProperties &ioProperties=qSlicerIO::IOProperties()) override
Reimplemented to propagate to python methods.
QScopedPointer< qSlicerScriptedFileDialogPrivate > d_ptr
Q_INVOKABLE const QMimeData * mimeData() const
Q_INVOKABLE const qSlicerIO::IOProperties & ioProperties() const
Q_INVOKABLE QDropEvent * dropEvent() const
~qSlicerScriptedFileDialog() override
void acceptMimeData(bool accept)
Q_INVOKABLE PyObject * self() const
Convenience method allowing to retrieve the associated scripted instance.
qSlicerScriptedFileDialog(QObject *parent=nullptr)
QString pythonSource() const
qSlicerStandardFileDialog Superclass
_object PyObject