2
/******************************************************************************
3
* MODULE : QTMFileDialog.hpp
4
* DESCRIPTION: QT file choosers
5
* COPYRIGHT : (C) 2009 David MICHEL
6
*******************************************************************************
7
* This software falls under the GNU general public license version 3 or later.
8
* It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
9
* in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
10
******************************************************************************/
12
#ifndef QTMFILEDIALOG_HPP
13
#define QTMFILEDIALOG_HPP
15
#include <QFileDialog>
18
#include <QHBoxLayout>
21
class QMyFileDialog : public QFileDialog
25
QMyFileDialog (QWidget* parent= 0, const QString & caption = QString(),
26
const QString & directory = QString(), const QString & filter = QString())
27
: QFileDialog(parent, caption, directory, filter) {}
30
class QTMFileDialog : public QDialog
39
QTMFileDialog (QWidget* parent= 0, const QString & caption = QString(),
40
const QString & directory = QString(), const QString & filter = QString());
41
QStringList selectedFiles () { return file->selectedFiles (); };
42
#if (defined(Q_WS_MAC) && (QT_VERSION >= 0x040600))
43
void setOptions (QFileDialog::Options opts) { return file->setOptions (opts); };
45
void setViewMode (QFileDialog::ViewMode mode) { return file->setViewMode (mode); };
46
void setFileMode (QFileDialog::FileMode mode) { return file->setFileMode (mode); };
47
void setLabelText (QFileDialog::DialogLabel label, const QString& text) { return file->setLabelText (label, text); };
50
class QTMImagePreview : public QWidget
65
void setImage (const QString&);
68
QTMImagePreview (QWidget* parent= 0);
71
class QTMImageDialog : public QTMFileDialog
75
QTMImagePreview* preview;
78
QTMImageDialog (QWidget* parent= 0, const QString& caption= QString (),
79
const QString& directory= QString (), const QString& filter= QString ());
80
string getParamsAsString ();
83
#endif // defined QTMFILEDIALOG_HPP