Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QT5 migration for QT based GUI apps #263

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion HEN_HOUSE/egs++/view/clippingplanes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ ClippingPlanesWidget::ClippingPlanesWidget(QWidget *parent, const char *name)
: QWidget(parent) {
setObjectName(name);
setupUi(this);
planeTable->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
planeTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
}

ClippingPlanesWidget::~ClippingPlanesWidget() {
Expand Down
3 changes: 2 additions & 1 deletion HEN_HOUSE/egs++/view/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
*/


#include <qapplication.h>
#include <QApplication>
#include <QtWidgets>
#include <qfile.h>
#include <qstring.h>
#include <qfiledialog.h>
Expand Down
2 changes: 2 additions & 0 deletions HEN_HOUSE/egs++/view/view.pro
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ LANGUAGE = C++

INCLUDEPATH += . .. ../../lib/$$my_machine

QT += widgets

HEADERS += egs_visualizer.h image_window.h egs_light.h \
clippingplanes.h viewcontrol.h geometryview.ui.h \
saveimage.h egs_user_color.h egs_track_view.h \
Expand Down
3 changes: 2 additions & 1 deletion HEN_HOUSE/gui/egs_configure/egs_beam_install.pro
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ win32 {

unix {
CONFIG += qt thread warn_on debug_and_release $$my_build
#LIBS += -lz #Needed if not using Qt own zlib
LIBS += -lz #Needed if not using Qt own zlib, in QT5 using Qtzlibh is not recommended according to documentation
#message("CONFIG = $$CONFIG")
contains( CONFIG, shared ):message( "Dynamic build..." )
contains( CONFIG, static ){
Expand All @@ -91,3 +91,4 @@ RESOURCES = egs_beam_install.qrc # resource collection file to store images in t
TEMPLATE = app
LANGUAGE = C++
QT += xml
QT += widgets
2 changes: 1 addition & 1 deletion HEN_HOUSE/gui/egs_configure/egs_wizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

using namespace std;

EGS_Wizard::EGS_Wizard(QWidget *parent, Qt::WFlags f)
EGS_Wizard::EGS_Wizard(QWidget *parent, Qt::WindowFlags f)
: QWizard(parent,f),
the_year("0000?"),version("0?"),
custom(false)
Expand Down
6 changes: 3 additions & 3 deletions HEN_HOUSE/gui/egs_configure/egs_wizard.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#ifndef EGS_WIZARD_H
#define EGS_WIZARD_H

#include <QWidget>
#include <QtWidgets>
#include <QString>
#include <QPixmap>
#include <QWizard>
Expand All @@ -56,7 +56,7 @@ class EGS_Wizard : public QWizard
enum { Page_Intro, Page_Location, Page_Compiler,
Page_Licence, Page_Install, Page_Conclusion };

EGS_Wizard(QWidget * parent = 0, Qt::WFlags f = 0);
EGS_Wizard(QWidget * parent = 0, Qt::WindowFlags f = 0);
~EGS_Wizard(){}

public slots:
Expand Down Expand Up @@ -95,4 +95,4 @@ void processCustomButtonClick(int id);

};

#endif
#endif
4 changes: 2 additions & 2 deletions HEN_HOUSE/gui/egs_gui/egs_compile_page.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ const QSizePolicy preferred(QSizePolicy::Preferred,QSizePolicy::Preferred);
using namespace Qt;

EGS_CompilePage::EGS_CompilePage(QWidget *parent, const char *name,
WFlags f) : EGS_GUI_Widget(parent,name,f) { make(); }
WindowFlags f) : EGS_GUI_Widget(parent,name,f) { make(); }

EGS_CompilePage::EGS_CompilePage(EGS_ConfigReader *cr, QWidget *parent,
const char *name, WFlags f) : EGS_GUI_Widget(cr,parent,name,f) { make(); }
const char *name, WindowFlags f) : EGS_GUI_Widget(cr,parent,name,f) { make(); }

void EGS_CompilePage::make() {

Expand Down
4 changes: 2 additions & 2 deletions HEN_HOUSE/gui/egs_gui/egs_compile_page.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ class EGS_CompilePage : public EGS_GUI_Widget {

public:

EGS_CompilePage(QWidget *parent = 0, const char * name = 0, Qt::WFlags f = 0);
EGS_CompilePage(QWidget *parent = 0, const char * name = 0, Qt::WindowFlags f = 0);
EGS_CompilePage(EGS_ConfigReader *,
QWidget *parent = 0, const char * name = 0, Qt::WFlags f = 0);
QWidget *parent = 0, const char * name = 0, Qt::WindowFlags f = 0);
~EGS_CompilePage(){}

void sendSignals();
Expand Down
4 changes: 2 additions & 2 deletions HEN_HOUSE/gui/egs_gui/egs_configuration_page.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@
using namespace Qt;

EGS_ConfigurationPage::EGS_ConfigurationPage(QWidget *parent,
const char *name, WFlags f) : EGS_GUI_Widget(parent,name,f) {
const char *name, WindowFlags f) : EGS_GUI_Widget(parent,name,f) {
make();
}

EGS_ConfigurationPage::EGS_ConfigurationPage(EGS_ConfigReader *cr,
QWidget *parent, const char *name, WFlags f) :
QWidget *parent, const char *name, WindowFlags f) :
EGS_GUI_Widget(cr,parent,name,f) { make(); }

void EGS_ConfigurationPage::make() {
Expand Down
4 changes: 2 additions & 2 deletions HEN_HOUSE/gui/egs_gui/egs_configuration_page.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ class EGS_ConfigurationPage : public EGS_GUI_Widget {

public:

EGS_ConfigurationPage(QWidget *parent=0, const char *name=0, Qt::WFlags f=0);
EGS_ConfigurationPage(QWidget *parent=0, const char *name=0, Qt::WindowFlags f=0);
EGS_ConfigurationPage(EGS_ConfigReader *cr,
QWidget *parent=0, const char *name=0, Qt::WFlags f=0);
QWidget *parent=0, const char *name=0, Qt::WindowFlags f=0);
~EGS_ConfigurationPage(){}
public slots:

Expand Down
2 changes: 2 additions & 0 deletions HEN_HOUSE/gui/egs_gui/egs_gui.pro
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ HEADERS += main_widget.h \
egs_configuration_page.h \
egs_config_reader.h

QT += widgets

MOC_DIR = .moc/$$my_machine
OBJECTS_DIR = .obj/$$my_machine
DESTDIR = ../../bin/$$my_machine
Expand Down
4 changes: 2 additions & 2 deletions HEN_HOUSE/gui/egs_gui/egs_gui_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@
using namespace std;
using namespace Qt;

EGS_GUI_Widget::EGS_GUI_Widget(QWidget *parent, const char *name,WFlags f) :
EGS_GUI_Widget::EGS_GUI_Widget(QWidget *parent, const char *name,WindowFlags f) :
QWidget(parent,f), the_name(name)
{
config_reader = 0; killed = false;
}

EGS_GUI_Widget::EGS_GUI_Widget(EGS_ConfigReader *cr, QWidget *parent, const char *name, WFlags f) :
EGS_GUI_Widget::EGS_GUI_Widget(EGS_ConfigReader *cr, QWidget *parent, const char *name, WindowFlags f) :
QWidget(parent,f), the_name(name)
{
config_reader = cr; killed = false;
Expand Down
4 changes: 2 additions & 2 deletions HEN_HOUSE/gui/egs_gui/egs_gui_widget.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ class EGS_GUI_Widget : public QWidget {

public:

EGS_GUI_Widget(QWidget *parent=0, const char *name=0, Qt::WFlags f=0);
EGS_GUI_Widget(QWidget *parent=0, const char *name=0, Qt::WindowFlags f=0);
EGS_GUI_Widget(EGS_ConfigReader *, QWidget *parent=0,
const char *name=0, Qt::WFlags f=0);
const char *name=0, Qt::WindowFlags f=0);

virtual ~EGS_GUI_Widget(){}

Expand Down
4 changes: 2 additions & 2 deletions HEN_HOUSE/gui/egs_gui/egs_run_page.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@

using namespace Qt;

EGS_RunPage::EGS_RunPage(QWidget *parent, const char *name, WFlags f) :
EGS_RunPage::EGS_RunPage(QWidget *parent, const char *name, WindowFlags f) :
EGS_GUI_Widget(parent,name,f) { make(); }

EGS_RunPage::EGS_RunPage(EGS_ConfigReader *cr,
QWidget *parent, const char *name, WFlags f) :
QWidget *parent, const char *name, WindowFlags f) :
EGS_GUI_Widget(cr,parent,name,f) { make(); }

void EGS_RunPage::make() {
Expand Down
4 changes: 2 additions & 2 deletions HEN_HOUSE/gui/egs_gui/egs_run_page.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ class EGS_RunPage : public EGS_GUI_Widget {

public:

EGS_RunPage(QWidget *parent=0, const char *name=0, Qt::WFlags f=0);
EGS_RunPage(QWidget *parent=0, const char *name=0, Qt::WindowFlags f=0);
EGS_RunPage(EGS_ConfigReader *cr,
QWidget *parent=0, const char *name=0, Qt::WFlags f=0);
QWidget *parent=0, const char *name=0, Qt::WindowFlags f=0);
~EGS_RunPage(){}
public slots:

Expand Down
2 changes: 1 addition & 1 deletion HEN_HOUSE/gui/egs_gui/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@


#include "main_widget.h"
#include <QtGui>
#include <QtWidgets>
#include <QMainWindow>

#include <qapplication.h>
Expand Down
2 changes: 1 addition & 1 deletion HEN_HOUSE/gui/egs_gui/main_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ bool configLibExists(const QString& lib );

using namespace std;

EGS_MainWidget::EGS_MainWidget(QWidget *parent, Qt::WFlags f)
EGS_MainWidget::EGS_MainWidget(QWidget *parent, Qt::WindowFlags f)
: QWidget(parent,f)
{

Expand Down
2 changes: 1 addition & 1 deletion HEN_HOUSE/gui/egs_gui/main_widget.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class EGS_MainWidget : public QWidget

public:

EGS_MainWidget(QWidget * parent = 0, Qt::WFlags f = 0);
EGS_MainWidget(QWidget * parent = 0, Qt::WindowFlags f = 0);
~EGS_MainWidget(){}
public slots:

Expand Down
3 changes: 2 additions & 1 deletion HEN_HOUSE/gui/egs_gui/pegs_page.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <QItemSelectionModel>
#include <QMessageBox>
#include <QTextStream>
#include <QtWidgets>

#include <qstringlist.h>
#include <qfiledialog.h>
Expand Down Expand Up @@ -837,7 +838,7 @@ bool TableEventHandler::eventFilter(QObject *o, QEvent *e) {
return true;
}
else
to->eventFilter(o, e);
return false;
}
return false;
}
5 changes: 5 additions & 0 deletions HEN_HOUSE/gui/egs_inprz/egs_inprz.pro
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ HEADERS += include/cavinputs.h \
include/varinputs.h \
include/tools.h \
../egs_gui/egs_config_reader.h

QT += widgets \
printsupport


######################################################################
# Automatically generated by qmake (1.03a) Thu Dec 5 10:07:20 2002
######################################################################
Expand Down
2 changes: 1 addition & 1 deletion HEN_HOUSE/gui/egs_inprz/include/executiondlgImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class ExecutiondlgImpl : public QDialog, public Ui::MExecutionDialog

public:

ExecutiondlgImpl( QWidget* parent, const char* name, bool modal, Qt::WFlags f );
ExecutiondlgImpl( QWidget* parent, const char* name, bool modal, Qt::WindowFlags f );

~ExecutiondlgImpl();

Expand Down
2 changes: 1 addition & 1 deletion HEN_HOUSE/gui/egs_inprz/include/inputRZImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class inputRZImpl : public QWidget, public Ui::InputRZForm
public:

inputRZImpl( QWidget* parent, const char* name,
bool modal, Qt::WFlags f );
bool modal, Qt::WindowFlags f );

~inputRZImpl();

Expand Down
2 changes: 1 addition & 1 deletion HEN_HOUSE/gui/egs_inprz/include/tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#define TOOLS_H

#include <qfile.h>
#include <qlabel.h>
#include <QLabel>
#include <qstringlist.h>
#include <fstream>
//qt3to4 -- BW
Expand Down
2 changes: 1 addition & 1 deletion HEN_HOUSE/gui/egs_inprz/src/eventfilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ bool TableEvents::eventFilter( QObject *o, QEvent *e)
}
}
}
return to->eventFilter( o, e ) ;
return false;
}

ComboEvents::ComboEvents( QWidget *parent, const char *name )
Expand Down
2 changes: 1 addition & 1 deletion HEN_HOUSE/gui/egs_inprz/src/executiondlgImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
//qt3to4 -- BW
#include <qdir.h>

ExecutiondlgImpl::ExecutiondlgImpl( QWidget* parent, const char* name, bool modal, Qt::WFlags f )
ExecutiondlgImpl::ExecutiondlgImpl( QWidget* parent, const char* name, bool modal, Qt::WindowFlags f )
//qt3to4 -- BW
// : MExecutionDialog( parent, name, modal, f )
: QDialog(parent)
Expand Down
26 changes: 13 additions & 13 deletions HEN_HOUSE/gui/egs_inprz/src/inputRZForm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -584,19 +584,19 @@ void inputRZImpl::UpDateInputRZForm( const MInputRZ* Input )

switch ( usercode ) {
case cavrznrc:
cavrzRadioButton->setChecked( TRUE );
cavrzRadioButton->setChecked( true );
usercodename = "cavrznrc";
break;
case dosrznrc:
dosrzRadioButton->setChecked( TRUE );
dosrzRadioButton->setChecked( true );
usercodename = "dosrznrc";
break;
case sprrznrc:
sprrzRadioButton->setChecked( TRUE );
sprrzRadioButton->setChecked( true );
usercodename = "sprrznrc";
break;
case flurznrc:
flurzRadioButton->setChecked( TRUE );
flurzRadioButton->setChecked( true );
usercodename = "flurznrc";
break;
}
Expand Down Expand Up @@ -2848,7 +2848,7 @@ void inputRZImpl::set_data_area()
QString tmpDir;
//qt3to4 -- BW
//char s = QDir::separator();
char s = QDir::separator().toAscii();
char s = QDir::separator().toLatin1();

if ( HOMEPegsRadioButton->isChecked() )
tmpDir = ironIt( EGS_HOME + s + "pegs4" + s + "data" + s);
Expand Down Expand Up @@ -3346,7 +3346,7 @@ QString inputRZImpl::getExecutable()

//qt3to4 -- BW
//char s = QDir::separator();
char s = QDir::separator().toAscii();
char s = QDir::separator().toLatin1();

QString executable = usercodename;
if ( DebugradioButton->isChecked() )
Expand Down Expand Up @@ -3690,7 +3690,7 @@ void inputRZImpl::InitializeTable( QTableWidget* t, const QStringList& s)
t->setHorizontalHeaderLabels(s);
t->horizontalHeader()->setUpdatesEnabled( true );
//Proper way to resize table columns to fit the table -- EMH July 2015
t->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
t->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
t->installEventFilter(this);}

//qt3to4 -- BW
Expand Down Expand Up @@ -3731,7 +3731,7 @@ void inputRZImpl::InitializeTable( QTableWidget* t, const QString& s0, const QSt
t->setHorizontalHeaderItem(1,new QTableWidgetItem(s1));
t->horizontalHeader()->setUpdatesEnabled( true );
//Proper way to resize table columns to fit the table -- EMH July 2015
t->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
t->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);

t->installEventFilter(this);
}
Expand All @@ -3749,7 +3749,7 @@ void inputRZImpl::InitializeTable( QTableWidget* t, const QString& s0,
t->setHorizontalHeaderItem(2, new QTableWidgetItem(s2) );
t->horizontalHeader()->setUpdatesEnabled( true );
//Proper way to resize table columns to fit the table -- EMH July 2015
t->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
t->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);

t->installEventFilter(this);
}
Expand All @@ -3765,7 +3765,7 @@ void inputRZImpl::InitializeTwoColumnTable( QTableWidget* table)
table->setHorizontalHeaderItem(1, new QTableWidgetItem("stop"));
table->horizontalHeader()->setUpdatesEnabled( true );
//Proper way to resize table columns to fit the table -- EMH July 2015
table->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
table->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);

table->installEventFilter(this);
}
Expand All @@ -3781,7 +3781,7 @@ void inputRZImpl::InitializeThreeColumnTable( QTableWidget* table, const QString
table->setHorizontalHeaderItem(2, new QTableWidgetItem("stop"));
table->horizontalHeader()->setUpdatesEnabled( true );
//Proper way to resize table columns to fit the table -- EMH July 2015
table->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
table->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);

table->installEventFilter(this);
}
Expand Down Expand Up @@ -3958,8 +3958,8 @@ bool inputRZImpl::eventFilter(QObject *o, QEvent *e){
return true;
}
}
return to->eventFilter(o, e) ;
//return false;
//return to->eventFilter(o, e) ;
return false;
}
else{
return false;
Expand Down
Loading