Reference documentation for deal.II version 8.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
mainwindow.h
1 // ---------------------------------------------------------------------
2 // @f$Id: mainwindow.h 31527 2013-11-03 09:58:45Z maier @f$
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 MAINWINDOW_H
19 #define MAINWINDOW_H
20 
21 #include <QMainWindow>
22 #include <QTreeWidget>
23 #include <QDialog>
24 #include <QSettings>
25 
26 #include "info_message.h"
27 
28 
29 namespace dealii
30 {
34  namespace ParameterGui
35  {
50  class MainWindow : public QMainWindow
51  {
52  Q_OBJECT
53 
54  public:
61  MainWindow(const QString &filename = "");
62 
63  protected:
68  void closeEvent(QCloseEvent *event);
69 
70  private slots:
71 
75  void open();
79  bool save();
83  bool save_as();
87  void about();
88 
93  void tree_was_modified();
94 
95  private:
100  void show_message ();
104  void create_actions();
108  void create_menus();
115  bool maybe_save ();
119  bool save_file (const QString &filename);
123  void load_file (const QString &filename);
127  void set_current_file (const QString &filename);
131  QTreeWidget * tree_widget;
136  QMenu * file_menu;
141  QMenu * help_menu;
145  QAction * open_act;
149  QAction * save_act;
153  QAction * save_as_act;
157  QAction * exit_act;
161  QAction * about_act;
165  QAction * about_qt_act;
169  QString current_file;
177  QSettings * gui_settings;
178  };
179  }
181 }
182 
183 
184 #endif
void load_file(const QString &filename)
MainWindow(const QString &filename="")
void set_current_file(const QString &filename)
void closeEvent(QCloseEvent *event)
bool save_file(const QString &filename)