SET(DEAL_II_EXECUTABLE_RELDIR "bin")
ENDIF()
-FIND_PACKAGE(Qt4 REQUIRED QtCore QtGui QtXml)
-MARK_AS_ADVANCED(QT_QMAKE_EXECUTABLE)
+FIND_PACKAGE(Qt5 COMPONENTS Core Gui Xml Widgets)
+
+IF(${Qt5_FOUND})
+ELSE()
+ FIND_PACKAGE(Qt4 REQUIRED QtCore QtGui QtXml)
+ INCLUDE(${QT_USE_FILE})
+ENDIF()
-INCLUDE(${QT_USE_FILE})
+MARK_AS_ADVANCED(QT_QMAKE_EXECUTABLE)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
-QT4_WRAP_CPP(SOURCE_MOC
- browse_lineedit.h
- info_message.h
- settings_dialog.h
- mainwindow.h
- parameter_delegate.h
- )
+IF(${Qt5_FOUND})
+ QT5_WRAP_CPP(SOURCE_MOC
+ browse_lineedit.h
+ info_message.h
+ settings_dialog.h
+ mainwindow.h
+ parameter_delegate.h
+ )
+
+ QT5_ADD_RESOURCES(SOURCE_RCC
+ application.qrc
+ )
+ELSE()
+ QT4_WRAP_CPP(SOURCE_MOC
+ browse_lineedit.h
+ info_message.h
+ settings_dialog.h
+ mainwindow.h
+ parameter_delegate.h
+ )
+
+ QT4_ADD_RESOURCES(SOURCE_RCC
+ application.qrc
+ )
+ENDIF()
-QT4_ADD_RESOURCES(SOURCE_RCC
- application.qrc
- )
ADD_EXECUTABLE(parameter_gui_exe
browse_lineedit.cpp
${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Targets.cmake
APPEND
)
+
+IF(${Qt5_FOUND})
+ QT5_USE_MODULES(parameter_gui_exe Core Gui Xml Widgets)
+ENDIF()
//
// ---------------------------------------------------------------------
-
-#include <QtGui>
-
#include "browse_lineedit.h"
+#if QT_VERSION >= 0x050000
+#include <QtWidgets>
+#else
+#include <QtGui>
+#endif
namespace dealii
{
// ---------------------------------------------------------------------
-#include <QtGui>
-
#include "info_message.h"
+#if QT_VERSION >= 0x050000
+#include <QtWidgets>
+#else
+#include <QtGui>
+#endif
namespace dealii
{
// ---------------------------------------------------------------------
-#include <QtGui>
-
#include "mainwindow.h"
#include "parameter_delegate.h"
#include "xml_parameter_reader.h"
#include "xml_parameter_writer.h"
#include "prm_parameter_writer.h"
+#if QT_VERSION >= 0x050000
+#include <QtWidgets>
+#else
+#include <QtGui>
+#endif
namespace dealii
{
tree_widget = new QTreeWidget;
// Setup the tree and the window first:
+#if QT_VERSION >= 0x050000
+ tree_widget->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
+#else
tree_widget->header()->setResizeMode(QHeaderView::ResizeToContents);
+#endif
tree_widget->setHeaderLabels(QStringList() << tr("(Sub)Sections/Parameters")
<< tr("Value"));
// ---------------------------------------------------------------------
-#include <QtGui>
-
#include "parameter_delegate.h"
#include <limits>
+#if QT_VERSION >= 0x050000
+#include <QtWidgets>
+#else
+#include <QtGui>
+#endif
namespace dealii
{
// ---------------------------------------------------------------------
-#include <QtGui>
-
#include "prm_parameter_writer.h"
+#if QT_VERSION >= 0x050000
+#include <QtWidgets>
+#else
+#include <QtGui>
+#endif
namespace dealii
{
for (int i = 0; i < tree_widget->topLevelItemCount(); ++i)
{
const QString item_string = item_to_string(tree_widget->topLevelItem(i),0);
- device->write(item_string.toAscii());
+ device->write(item_string.toLatin1());
}
return true;
if (!item_string.isEmpty())
{
- item_string.push_front("subsection " + item->text(0).toAscii() + "\n");
+ item_string.push_front("subsection " + item->text(0).toLatin1() + "\n");
for (unsigned int i=0; i<indentation_level;++i)
item_string.push_front(" ");
// ---------------------------------------------------------------------
-#include <QtGui>
-
#include "settings_dialog.h"
+#if QT_VERSION >= 0x050000
+#include <QtWidgets>
+#else
+#include <QtGui>
+#endif
namespace dealii
{
// ---------------------------------------------------------------------
-#include <QtGui>
-
#include "xml_parameter_reader.h"
+#if QT_VERSION >= 0x050000
+#include <QtWidgets>
+#else
+#include <QtGui>
+#endif
namespace dealii
{
// ---------------------------------------------------------------------
-#include <QtGui>
-
#include "xml_parameter_writer.h"
+#if QT_VERSION >= 0x050000
+#include <QtWidgets>
+#else
+#include <QtGui>
+#endif
namespace dealii
{