OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
browse_lineedit.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 // $Id: browse_lineedit.h 2226 2014-04-04 21:21:00Z secanell $
3 //
4 // Copyright (C) 2010 - 2013 by Martin Steigemann and Wolfgang Bangerth
5 //
6 // This file is part of the deal.II library.
7 //
8 // The deal.II library is free software; you can use it, redistribute
9 // it, and/or modify it under the terms of the GNU Lesser General
10 // Public License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 // The full text of the license can be found in the file LICENSE at
13 // the top level of the deal.II distribution.
14 //
15 // ---------------------------------------------------------------------
16 
17 
18 #ifndef BROWSELINEEDIT_H
19 #define BROWSELINEEDIT_H
20 
21 #include <QFrame>
22 #include <QLineEdit>
23 #include <QFileDialog>
24 #include <QPushButton>
25 
26 
27 namespace dealii
28 {
32  namespace ParameterGui
33  {
48  class BrowseLineEdit : public QFrame
49  {
50  Q_OBJECT
51 
52  public:
58  enum BrowseType {file = 0, directory = 1};
63  BrowseLineEdit (const BrowseType type = file,
64  QWidget *parent = 0);
65 
70  QSize sizeHint() const;
74  QSize minimumSizeHint() const;
78  QString text() const;
83 
84  public slots:
88  void setText(const QString &str);
89 
90  signals:
94  void editingFinished();
95 
96  private slots:
100  void editing_finished();
105  void browse();
106 
107  private:
111  QLineEdit * line_editor;
115  QPushButton * browse_button;
116  };
117  }
119 }
120 
121 
122 #endif
void editing_finished()
This slot should be always called, if editing is finished.
void browse()
This function opens a file- or a directory dialog as specified in the constructor.
BrowseLineEdit(const BrowseType type=file, QWidget *parent=0)
Constructor.
QPushButton * browse_button
The browse button.
Definition: browse_lineedit.h:115
QLineEdit * line_editor
The line editor.
Definition: browse_lineedit.h:111
QSize sizeHint() const
Reimplemented from the QWidget class.
BrowseType
The browse button opens a file or a directory dialog.
Definition: browse_lineedit.h:58
void editingFinished()
This signal will be emitted, if editing is finished.
Definition: browse_lineedit.h:58
The BrowseLineEdit class provides a special line editor for the parameterGUI.
Definition: browse_lineedit.h:48
Definition: browse_lineedit.h:58
void setText(const QString &str)
A slot to set str as text of the line editor.
BrowseType browse_type
This pattern stores the type of the browse dialog.
Definition: browse_lineedit.h:82
QSize minimumSizeHint() const
Reimplemented from the QWidget class.
QString text() const
Returns the text of the line editor.