tuchulcha  0.10.1
Graphical Workflow Configuration Editor
QDirEdit.h
Go to the documentation of this file.
1 /* Copyright (C) 2009 Jens-Malte Gottfried
2 
3  This file is part of Tuchulcha.
4 
5  Tuchulcha is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  Tuchulcha is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with Tuchulcha. If not, see <http://www.gnu.org/licenses/>.
17 */
24 #ifndef QDIREDIT_H
25 #define QDIREDIT_H
26 
27 #include <QLineEdit>
28 class QToolButton;
29 
31 class QDirEdit : public QLineEdit
32 {
33  Q_OBJECT
34 private:
36  QToolButton* _browseButton;
38  bool _files;
40  bool _writeFile;
41 
43  void _init();
44 
45 protected:
47  void resizeEvent(QResizeEvent* e );
48 
49 public:
51  explicit QDirEdit(QWidget* parent = 0 );
52 
54  explicit QDirEdit(
55  const QString& content ,
56  QWidget* parent = 0 );
57 
58 signals:
60 
61  void dialogOpen(bool status );
62 
63 public slots:
65  void fileDialog();
66 
68  void acceptFiles(
69  bool files=true ,
70  bool write=true );
71 };
72 
73 #endif // QDIREDIT_H
bool _files
look for files instead of directories
Definition: QDirEdit.h:38
QDirEdit(QWidget *parent=0)
inherited constructor
Definition: QDirEdit.cpp:53
Line edit with completer for directories and dialog option.
Definition: QDirEdit.h:31
void resizeEvent(QResizeEvent *e)
handle resize events
Definition: QDirEdit.cpp:99
bool _writeFile
use saveFile dialog instead of openFile dialog
Definition: QDirEdit.h:40
void acceptFiles(bool files=true, bool write=true)
allow files instead of directories
Definition: QDirEdit.cpp:86
void _init()
set initial values
Definition: QDirEdit.cpp:31
void dialogOpen(bool status)
emit status of file dialog
QToolButton * _browseButton
browse button
Definition: QDirEdit.h:36
void fileDialog()
show open dialog and use the selected directory as entry
Definition: QDirEdit.cpp:63