Reference documentation for deal.II version 8.4.2
mainwindow.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2010 - 2013 by Martin Steigemann and Wolfgang Bangerth
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE at
12 // the top level of the deal.II distribution.
13 //
14 // ---------------------------------------------------------------------
15 
16 
17 #ifndef MAINWINDOW_H
18 #define MAINWINDOW_H
19 
20 #include <QMainWindow>
21 #include <QTreeWidget>
22 #include <QDialog>
23 #include <QSettings>
24 
25 #include "info_message.h"
26 
27 
28 namespace dealii
29 {
33  namespace ParameterGui
34  {
49  class MainWindow : public QMainWindow
50  {
51  Q_OBJECT
52 
53  public:
60  MainWindow(const QString &filename = "");
61 
62  protected:
67  void closeEvent(QCloseEvent *event);
68 
69  private slots:
70 
74  void open();
78  bool save();
82  bool save_as();
86  void about();
87 
92  void tree_was_modified();
93 
94  private:
99  void show_message ();
103  void create_actions();
107  void create_menus();
114  bool maybe_save ();
118  bool save_file (const QString &filename);
122  void load_file (const QString &filename);
126  void set_current_file (const QString &filename);
130  QTreeWidget * tree_widget;
135  QMenu * file_menu;
140  QMenu * help_menu;
144  QAction * open_act;
148  QAction * save_act;
152  QAction * save_as_act;
156  QAction * exit_act;
160  QAction * about_act;
164  QAction * about_qt_act;
168  QString current_file;
176  QSettings * gui_settings;
177  };
178  }
180 }
181 
182 
183 #endif
void load_file(const QString &filename)
Definition: mainwindow.cpp:325
MainWindow(const QString &filename="")
Definition: mainwindow.cpp:29
void set_current_file(const QString &filename)
Definition: mainwindow.cpp:360
void closeEvent(QCloseEvent *event)
Definition: mainwindow.cpp:211
bool save_file(const QString &filename)
Definition: mainwindow.cpp:299