Commit 97b960a6 authored by Johnny Jazeix's avatar Johnny Jazeix

source code modified for compiling with both qt4 and qt5 (conf not yet commited)

parent a3880fd2
......@@ -44,24 +44,24 @@
**
****************************************************************************/
#include <QtGui/QApplication>
#include <QtGui/QDesktopWidget>
#include <QtGui/QPainter>
#include <QtGui/QPushButton>
#include <QtGui/QColorDialog>
#include <QtCore/QMap>
#include <QtGui/QLayout>
#include <QtGui/QStyle>
#include <QtGui/QLabel>
#include <QtGui/QToolTip>
#include <QtGui/QPixmap>
#include <QtGui/QFocusEvent>
#include <QtGui/QPaintEvent>
#include <QtGui/QGridLayout>
#include <QtGui/QHideEvent>
#include <QtGui/QKeyEvent>
#include <QtGui/QShowEvent>
#include <QtGui/QMouseEvent>
#include <QApplication>
#include <QDesktopWidget>
#include <QPainter>
#include <QPushButton>
#include <QColorDialog>
#include <QMap>
#include <QLayout>
#include <QStyle>
#include <QLabel>
#include <QToolTip>
#include <QPixmap>
#include <QFocusEvent>
#include <QPaintEvent>
#include <QGridLayout>
#include <QHideEvent>
#include <QKeyEvent>
#include <QShowEvent>
#include <QMouseEvent>
#include <math.h>
#include "qtcolorpicker.h"
......
......@@ -47,13 +47,13 @@
#ifndef QTCOLORPICKER_H
#define QTCOLORPICKER_H
#include <QObject>
#include <QtGui/QPushButton>
#include <QtCore/QString>
#include <QtGui/QColor>
#include <QPushButton>
#include <QString>
#include <QColor>
#include <QtGui/QLabel>
#include <QtCore/QEvent>
#include <QtGui/QFocusEvent>
#include <QLabel>
#include <QEvent>
#include <QFocusEvent>
class QEventLoop;
class QGridLayout;
......
......@@ -160,8 +160,9 @@ Core::Core(int &argc, char ** argv)
console_app = NULL;
/* Qt uses the default system encoding for QString (used when opening a file) */
#if QT_VERSION < 0x050000
QTextCodec::setCodecForCStrings(QTextCodec::codecForLocale());
#endif
/*
* Store application name and current directory
*/
......
......@@ -57,11 +57,11 @@
#include <QtUiTools>/* for the run-time loading .ui file */
#include <QCloseEvent>
#include <QDir>
#include <QtGui/QFileDialog>
#include <QtGui/QRadioButton>
#include <QtGui/QTextEdit>
#include <QtGui/QCheckBox>
#include <QtGui/QMessageBox>
#include <QFileDialog>
#include <QRadioButton>
#include <QTextEdit>
#include <QCheckBox>
#include <QMessageBox>
#include <QProgressDialog>
/* -- */
#include "interface/resource.hpp"
......@@ -205,7 +205,7 @@ void Interface_graphic::load_windows(){
if ( file_counter_to_export.exists() ) {
file_counter_to_export.open(QFile::ReadOnly);
CKFP(_ui_counter_choice_to_export = loader.load(&file_counter_to_export, this), "Cannot open the .ui file : " << ":/window/list_of_counter_to_export.ui");
CKFP(_counter_list_names = qFindChild<QComboBox*>(_ui_counter_choice_to_export, "combobox"), "Cannot find the svg export button in the .ui file");
CKFP(_counter_list_names = _ui_counter_choice_to_export->findChild<QComboBox*>("combobox"), "Cannot find the svg export button in the .ui file");
file_counter_to_export.close();
} else {
cerr << __FILE__ << ":" << __LINE__ << ": The following .ui file doesn't exist: " << ":/window/list_of_counter_to_export.ui" << endl;
......@@ -225,9 +225,9 @@ void Interface_graphic::load_windows(){
/* Load the export combo box choice from a .ui file */
/* file_kind_of_export.open(QFile::ReadOnly);
CKFP(_ui_kind_of_export_choice = loader.load(&file_kind_of_export, this), "Cannot open the .ui file : " << ":/window/kind_of_export.ui");
CKFP(_ui_svg_export_button = qFindChild<QRadioButton*>(_ui_kind_of_export_choice, "svg_export"), "Cannot find the svg export button in the .ui file");
CKFP(_ui_png_export_button = qFindChild<QRadioButton*>(_ui_kind_of_export_choice, "png_export"), "Cannot find the png export button in the .ui file");
CKFP(_ui_counter_export_button = qFindChild<QRadioButton*>(_ui_kind_of_export_choice, "counter_export"), "Cannot find the svg export button in the .ui file");
CKFP(_ui_svg_export_button = this->findChild(QRadioButton*), _ui_kind_of_export_choice, "svg_export"), "Cannot find the svg export button in the .ui file");
CKFP(_ui_png_export_button = this->findChild(QRadioButton*), _ui_kind_of_export_choice, "png_export"), "Cannot find the png export button in the .ui file");
CKFP(_ui_counter_export_button = this->findChild(QRadioButton*), _ui_kind_of_export_choice, "counter_export"), "Cannot find the svg export button in the .ui file");
file_kind_of_export.close();*/
/* Set some windows properties */
......@@ -235,26 +235,26 @@ void Interface_graphic::load_windows(){
_ui_time_selection_export->setWindowFlags(_ui_time_selection_export->windowFlags() | Qt::WindowStaysOnTopHint);
/* Load widget from the .ui file */
CKFP(_ui_render_area_layout = qFindChild<QVBoxLayout*>(this, "render_area_layout"), "Cannot find the render_area layout in the .ui file");
CKFP(_ui_render_area_layout = this->findChild<QVBoxLayout*>("render_area_layout"), "Cannot find the render_area layout in the .ui file");
CKFP(_ui_fullscreen_menu = qFindChild<QAction*>(this, "fullscreen"), "Cannot find the fullscreen menu in the .ui file");
CKFP(_ui_info_trace_text = qFindChild<QTextEdit*>(_ui_info_window, "info_trace_text"), "Cannot find the info_trace_text QTextEdit widget in the .ui file");
CKFP(_ui_info_selection_text = qFindChild<QTextEdit*>(_ui_info_window, "info_selection_text"), "Cannot find the info_selection_text QTextEdit widget in the .ui file");
CKFP(_ui_toolbar = qFindChild<QToolBar*>(this, "toolBar"), "Cannot find the tool bar in the .ui file");
CKFP(_ui_fullscreen_menu = this->findChild<QAction*>("fullscreen"), "Cannot find the fullscreen menu in the .ui file");
CKFP(_ui_info_trace_text = _ui_info_window->findChild<QTextEdit*>("info_trace_text"), "Cannot find the info_trace_text QTextEdit widget in the .ui file");
CKFP(_ui_info_selection_text = _ui_info_window->findChild<QTextEdit*>("info_selection_text"), "Cannot find the info_selection_text QTextEdit widget in the .ui file");
CKFP(_ui_toolbar = this->findChild<QToolBar*>("toolBar"), "Cannot find the tool bar in the .ui file");
CKFP(_ui_x_scroll = qFindChild<QScrollBar*>(this, "x_scroll"), "Cannot find the horizontal scroll bar in the .ui file");
CKFP(_ui_y_scroll = qFindChild<QScrollBar*>(this, "y_scroll"), "Cannot find the vertical scroll bar in the .ui file");
CKFP(_ui_x_scroll = this->findChild<QScrollBar*>("x_scroll"), "Cannot find the horizontal scroll bar in the .ui file");
CKFP(_ui_y_scroll = this->findChild<QScrollBar*>("y_scroll"), "Cannot find the vertical scroll bar in the .ui file");
CKFP(_ui_zoom_box = qFindChild<QComboBox*>(this, "zoom_box"), "Cannot find the zoom box in the .ui file");
CKFP(_ui_zoom_box = this->findChild<QComboBox*>("zoom_box"), "Cannot find the zoom box in the .ui file");
CKFP(_ui_recent_files_menu = qFindChild<QMenu*>(this, "menuRecent_Files"), "Cannot find the button \"menuRecent_Files\" in the .ui file");
CKFP(_ui_recent_files_menu = this->findChild<QMenu*>("menuRecent_Files"), "Cannot find the button \"menuRecent_Files\" in the .ui file");
// CKFP(Info::Render::_ui_render_min_value = qFindChild<QLabel*>(this, "render_min_value"), "Cannot find the render_min_value label in the .ui file");
// CKFP(Info::Render::_ui_render_max_value = qFindChild<QLabel*>(this, "render_max_value"), "Cannot find the render_max_value label in the .ui file");
// CKFP(Info::Render::_ui_render_min_value = this->findChild<QLabel*>("render_min_value"), "Cannot find the render_min_value label in the .ui file");
// CKFP(Info::Render::_ui_render_max_value = this->findChild<QLabel*>("render_max_value"), "Cannot find the render_max_value label in the .ui file");
/* Help window */
CKFP(_ui_help_ok_button = qFindChild<QPushButton*>(_ui_help_window, "help_ok"), "Cannot find the ok push button in the help dialog .ui file");
CKFP(_ui_help_ok_button = _ui_help_window->findChild<QPushButton*>("help_ok"), "Cannot find the ok push button in the help dialog .ui file");
connect(_ui_counter_choice_to_export, SIGNAL(accepted()),
......
......@@ -58,9 +58,9 @@ class QProgressDialog;
/* Includes needed by the moc */
#include <QGLWidget>
#include <QtGui/QTextEdit>
#include <QtGui/QRadioButton>
#include <QtGui/QPushButton>
#include <QTextEdit>
#include <QRadioButton>
#include <QPushButton>
/* -- */
#include "common/common.hpp"
#include "common/Session.hpp"
......
#include "interface/viteqtreewidget.hpp"
#include <QDropEvent>
#include <QDragMoveEvent>
#include <QDragEnterEvent>
#include <QMimeData>
#include<QList>
#include "viteqtreewidget.hpp"
#include "stdio.h"
#include <QTreeWidget>
viteQTreeWidget::viteQTreeWidget(QWidget *parent)
: QTreeWidget(parent)
......
#ifndef VITETREEWIDGET_H
#define VITETREEWIDGET_H
#include <QtGui>
#include <QTreeWidget>
#include <QObject>
class viteQTreeWidget : public QTreeWidget
......
......@@ -84,18 +84,18 @@ using namespace std;
Command_window::Command_window( QWidget *parent, Interface_graphic * i) : QMainWindow(parent){
setupUi(this);
// _trace = T;
// CKFP(_ui_layout = qFindChild<QVBoxLayout *>(this,"verticalLayout_5"),"Cannot find the vertical layout in the ui file");
// CKFP(_ui_layout = this->findChild<QVBoxLayout *>("verticalLayout_5"),"Cannot find the vertical layout in the ui file");
_console = i;
CKFP(_ui_cmd_box = qFindChild<QLineEdit*>(this, "command"), "Cannot find the command box in the .ui file");
CKFP(_ui_cmd_box = this->findChild<QLineEdit*>("command"), "Cannot find the command box in the .ui file");
CKFP(_ui_start_box = qFindChild<QLineEdit*>(this, "startTime"), "Cannot find the beginning argument box in the .ui file");
CKFP(_ui_start_box = this->findChild<QLineEdit*>("startTime"), "Cannot find the beginning argument box in the .ui file");
CKFP(_ui_end_box = qFindChild<QLineEdit*>(this, "endTime"), "Cannot find the end argument box in the .ui file");
CKFP(_ui_end_box = this->findChild<QLineEdit*>("endTime"), "Cannot find the end argument box in the .ui file");
CKFP(_ui_filter_box = qFindChild<QLineEdit*>(this, "filter"), "Cannot find the filter argument box in the .ui file");
CKFP(_ui_filter_box = this->findChild<QLineEdit*>("filter"), "Cannot find the filter argument box in the .ui file");
CKFP(_ui_tree_box = qFindChild<QTreeWidget*>(this, "_nodes_selected"), "Cannot find the tree argument box in the .ui file");
CKFP(_ui_tree_box = this->findChild<QTreeWidget*>("_nodes_selected"), "Cannot find the tree argument box in the .ui file");
}
void Command_window::set_trace( Trace * t){
......
......@@ -82,7 +82,7 @@ using namespace std;
Stats_window::Stats_window(QWidget *parent) : Plugin(parent) {
setupUi(this);
CKFP(_ui_stats_area_layout = qFindChild<QVBoxLayout *>(this, "stats_area"), QObject::tr("Cannot find the stats_area_layout in the .ui file").toStdString());
CKFP(_ui_stats_area_layout = this->findChild<QVBoxLayout *>("stats_area"), QObject::tr("Cannot find the stats_area_layout in the .ui file").toStdString());
_ui_stats_area = new Render_stats_opengl(this);
_ui_stats_area_layout->addWidget(_ui_stats_area);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment