diff --git a/HEN_HOUSE/egs++/view/clippingplanes.cpp b/HEN_HOUSE/egs++/view/clippingplanes.cpp index 85798a0e0..e7f8fce29 100644 --- a/HEN_HOUSE/egs++/view/clippingplanes.cpp +++ b/HEN_HOUSE/egs++/view/clippingplanes.cpp @@ -28,6 +28,7 @@ ############################################################################### */ +#include #include "clippingplanes.h" #include "egs_libconfig.h" @@ -43,7 +44,11 @@ ClippingPlanesWidget::ClippingPlanesWidget(QWidget *parent, const char *name) : QWidget(parent) { setObjectName(name); setupUi(this); +#if QT_VERSION >= 0x050000 + planeTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); +#else planeTable->horizontalHeader()->setResizeMode(QHeaderView::Stretch); +#endif } ClippingPlanesWidget::~ClippingPlanesWidget() { diff --git a/HEN_HOUSE/egs++/view/main.cpp b/HEN_HOUSE/egs++/view/main.cpp index e5db1310a..7d1a7d197 100644 --- a/HEN_HOUSE/egs++/view/main.cpp +++ b/HEN_HOUSE/egs++/view/main.cpp @@ -29,7 +29,13 @@ */ -#include +#include +#include +#if QT_VERSION >= 0x050000 + #include +#else + #include +#endif #include #include #include diff --git a/HEN_HOUSE/egs++/view/view.pro b/HEN_HOUSE/egs++/view/view.pro index 29cbdf94d..d9e1bd7bc 100644 --- a/HEN_HOUSE/egs++/view/view.pro +++ b/HEN_HOUSE/egs++/view/view.pro @@ -32,6 +32,8 @@ LANGUAGE = C++ INCLUDEPATH += . .. ../../lib/$$my_machine +greaterThan(QT_MAJOR_VERSION, 4): 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 \ diff --git a/HEN_HOUSE/gui/egs_configure/egs_beam_install.pro b/HEN_HOUSE/gui/egs_configure/egs_beam_install.pro index a82022918..296c5fcf4 100644 --- a/HEN_HOUSE/gui/egs_configure/egs_beam_install.pro +++ b/HEN_HOUSE/gui/egs_configure/egs_beam_install.pro @@ -60,13 +60,14 @@ win32 { QMAKE_CXXFLAGS += -fpermissive #################################################### CONFIG += qt thread warn_off release windows + greaterThan(QT_MAJOR_VERSION, 4): LIBS += -lz -lole32 -luuid DESTDIR = ../../pieces/windows RC_FILE = egs_beam_install.rc } 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 ){ @@ -91,3 +92,5 @@ RESOURCES = egs_beam_install.qrc # resource collection file to store images in t TEMPLATE = app LANGUAGE = C++ QT += xml +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + diff --git a/HEN_HOUSE/gui/egs_configure/egs_install_env.cpp b/HEN_HOUSE/gui/egs_configure/egs_install_env.cpp index 7a8db0087..577ec4119 100644 --- a/HEN_HOUSE/gui/egs_configure/egs_install_env.cpp +++ b/HEN_HOUSE/gui/egs_configure/egs_install_env.cpp @@ -277,9 +277,9 @@ void QInstallPage::createEGSFolders(){ else desc = "EGSnrc GUI for egs++ geometries"; lnk = DESKTOP + *it + (QString)".lnk"; if( *it != "egs_view" ) - target = QDir::convertSeparators( egsBinDir + s + *it + ".exe" ); + target = QDir::toNativeSeparators( egsBinDir + s + *it + ".exe" ); else{ - target = QDir::convertSeparators( henHouse() + "egs++" + s + "dso" + s + "win-static" + s + *it + ".exe"); + target = QDir::toNativeSeparators( henHouse() + "egs++" + s + "dso" + s + "win-static" + s + *it + ".exe"); icon = henHouse() + "egs++" + s + "view" + s + *it + ".ico"; } if ( ! fileExists( target ) ) { diff --git a/HEN_HOUSE/gui/egs_configure/egs_wizard.cpp b/HEN_HOUSE/gui/egs_configure/egs_wizard.cpp index 8a46fbaf3..da01ab85f 100644 --- a/HEN_HOUSE/gui/egs_configure/egs_wizard.cpp +++ b/HEN_HOUSE/gui/egs_configure/egs_wizard.cpp @@ -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) diff --git a/HEN_HOUSE/gui/egs_configure/egs_wizard.h b/HEN_HOUSE/gui/egs_configure/egs_wizard.h index add89825f..47ee34bc7 100644 --- a/HEN_HOUSE/gui/egs_configure/egs_wizard.h +++ b/HEN_HOUSE/gui/egs_configure/egs_wizard.h @@ -32,7 +32,12 @@ #ifndef EGS_WIZARD_H #define EGS_WIZARD_H -#include +#include +#if QT_VERSION >= 0x050000 + #include +#else + #include +#endif #include #include #include @@ -56,7 +61,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: @@ -95,4 +100,4 @@ void processCustomButtonClick(int id); }; -#endif \ No newline at end of file +#endif diff --git a/HEN_HOUSE/gui/egs_gui/egs_compile_page.cpp b/HEN_HOUSE/gui/egs_gui/egs_compile_page.cpp index ee8ff2e0e..4a5faf4f0 100644 --- a/HEN_HOUSE/gui/egs_gui/egs_compile_page.cpp +++ b/HEN_HOUSE/gui/egs_gui/egs_compile_page.cpp @@ -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() { diff --git a/HEN_HOUSE/gui/egs_gui/egs_compile_page.h b/HEN_HOUSE/gui/egs_gui/egs_compile_page.h index ee62ca90d..32ac35b8c 100644 --- a/HEN_HOUSE/gui/egs_gui/egs_compile_page.h +++ b/HEN_HOUSE/gui/egs_gui/egs_compile_page.h @@ -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(); diff --git a/HEN_HOUSE/gui/egs_gui/egs_configuration_page.cpp b/HEN_HOUSE/gui/egs_gui/egs_configuration_page.cpp index acd2ce95b..cc1100b8b 100644 --- a/HEN_HOUSE/gui/egs_gui/egs_configuration_page.cpp +++ b/HEN_HOUSE/gui/egs_gui/egs_configuration_page.cpp @@ -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() { diff --git a/HEN_HOUSE/gui/egs_gui/egs_configuration_page.h b/HEN_HOUSE/gui/egs_gui/egs_configuration_page.h index a0a23720d..69b02c44c 100644 --- a/HEN_HOUSE/gui/egs_gui/egs_configuration_page.h +++ b/HEN_HOUSE/gui/egs_gui/egs_configuration_page.h @@ -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: diff --git a/HEN_HOUSE/gui/egs_gui/egs_gui.pro b/HEN_HOUSE/gui/egs_gui/egs_gui.pro index e0fe3ed7b..f95c9be6d 100644 --- a/HEN_HOUSE/gui/egs_gui/egs_gui.pro +++ b/HEN_HOUSE/gui/egs_gui/egs_gui.pro @@ -48,6 +48,8 @@ HEADERS += main_widget.h \ egs_configuration_page.h \ egs_config_reader.h +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + MOC_DIR = .moc/$$my_machine OBJECTS_DIR = .obj/$$my_machine DESTDIR = ../../bin/$$my_machine diff --git a/HEN_HOUSE/gui/egs_gui/egs_gui_widget.cpp b/HEN_HOUSE/gui/egs_gui/egs_gui_widget.cpp index 2ab780b54..bc5051509 100644 --- a/HEN_HOUSE/gui/egs_gui/egs_gui_widget.cpp +++ b/HEN_HOUSE/gui/egs_gui/egs_gui_widget.cpp @@ -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; diff --git a/HEN_HOUSE/gui/egs_gui/egs_gui_widget.h b/HEN_HOUSE/gui/egs_gui/egs_gui_widget.h index bd432d7ad..bd79072bb 100644 --- a/HEN_HOUSE/gui/egs_gui/egs_gui_widget.h +++ b/HEN_HOUSE/gui/egs_gui/egs_gui_widget.h @@ -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(){} diff --git a/HEN_HOUSE/gui/egs_gui/egs_run_page.cpp b/HEN_HOUSE/gui/egs_gui/egs_run_page.cpp index a95129ec6..6a1397803 100644 --- a/HEN_HOUSE/gui/egs_gui/egs_run_page.cpp +++ b/HEN_HOUSE/gui/egs_gui/egs_run_page.cpp @@ -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() { diff --git a/HEN_HOUSE/gui/egs_gui/egs_run_page.h b/HEN_HOUSE/gui/egs_gui/egs_run_page.h index b2c5f03bf..e2f1d70c1 100644 --- a/HEN_HOUSE/gui/egs_gui/egs_run_page.h +++ b/HEN_HOUSE/gui/egs_gui/egs_run_page.h @@ -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: diff --git a/HEN_HOUSE/gui/egs_gui/main.cpp b/HEN_HOUSE/gui/egs_gui/main.cpp index 2e6fd9f09..fcc1d9c0c 100644 --- a/HEN_HOUSE/gui/egs_gui/main.cpp +++ b/HEN_HOUSE/gui/egs_gui/main.cpp @@ -30,7 +30,12 @@ #include "main_widget.h" -#include +#include +#if QT_VERSION >= 0x050000 + #include +#else + #include +#endif #include #include diff --git a/HEN_HOUSE/gui/egs_gui/main_widget.cpp b/HEN_HOUSE/gui/egs_gui/main_widget.cpp index af450fa8e..eb1cff9b4 100644 --- a/HEN_HOUSE/gui/egs_gui/main_widget.cpp +++ b/HEN_HOUSE/gui/egs_gui/main_widget.cpp @@ -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) { diff --git a/HEN_HOUSE/gui/egs_gui/main_widget.h b/HEN_HOUSE/gui/egs_gui/main_widget.h index 334fe4cd2..eb51f2f19 100644 --- a/HEN_HOUSE/gui/egs_gui/main_widget.h +++ b/HEN_HOUSE/gui/egs_gui/main_widget.h @@ -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: diff --git a/HEN_HOUSE/gui/egs_gui/pegs_page.cpp b/HEN_HOUSE/gui/egs_gui/pegs_page.cpp index 2acd2935c..1e1fbeed1 100644 --- a/HEN_HOUSE/gui/egs_gui/pegs_page.cpp +++ b/HEN_HOUSE/gui/egs_gui/pegs_page.cpp @@ -37,6 +37,12 @@ #include #include #include +#include +#if QT_VERSION >= 0x050000 + #include +#else + #include +#endif #include #include @@ -837,7 +843,7 @@ bool TableEventHandler::eventFilter(QObject *o, QEvent *e) { return true; } else - to->eventFilter(o, e); + return false; } return false; } diff --git a/HEN_HOUSE/gui/egs_inprz/egs_inprz.pro b/HEN_HOUSE/gui/egs_inprz/egs_inprz.pro index 39deb1793..936e66053 100644 --- a/HEN_HOUSE/gui/egs_inprz/egs_inprz.pro +++ b/HEN_HOUSE/gui/egs_inprz/egs_inprz.pro @@ -30,7 +30,6 @@ SOURCES += src/cavinputs.cpp \ - src/comboboxtooltip.cpp \ src/commandManager.cpp \ src/de_parser.cpp \ src/errordlg.cpp \ @@ -59,7 +58,6 @@ SOURCES += src/cavinputs.cpp \ src/tools.cpp \ src/egs_config_reader.cpp HEADERS += include/cavinputs.h \ - include/comboboxtooltip.h \ include/commandManager.h \ include/datainp.h \ include/de_parser.h \ @@ -86,6 +84,10 @@ HEADERS += include/cavinputs.h \ include/varinputs.h \ include/tools.h \ ../egs_gui/egs_config_reader.h + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport + + ###################################################################### # Automatically generated by qmake (1.03a) Thu Dec 5 10:07:20 2002 ###################################################################### diff --git a/HEN_HOUSE/gui/egs_inprz/include/comboboxtooltip.h b/HEN_HOUSE/gui/egs_inprz/include/comboboxtooltip.h deleted file mode 100644 index a34c6ecb4..000000000 --- a/HEN_HOUSE/gui/egs_inprz/include/comboboxtooltip.h +++ /dev/null @@ -1,76 +0,0 @@ -/* -############################################################################### -# -# EGSnrc egs_inprz combo box tooltip headers -# Copyright (C) 2015 National Research Council Canada -# -# This file is part of EGSnrc. -# -# EGSnrc is free software: you can redistribute it and/or modify it under -# the terms of the GNU Affero General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# EGSnrc is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for -# more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with EGSnrc. If not, see . -# -############################################################################### -# -# Author: Ernesto Mainegra-Hing, 2002 -# -# Contributors: Blake Walters -# -############################################################################### -*/ - - -#ifndef COMBOBOXTOOLTIP_H -#define COMBOBOXTOOLTIP_H -#include "datainp.h" -#include "eventfilter.h" - -//qt3to4 -- BW -//#include -#include -#include - -#define zap(x) if(x){delete(x); x=0;} - -/*! - // This class implements a tool tip for ListBoxItems inside combo boxes - // created from scratch since ListBoxItems ain't widgets -*/ -class ComboBoxToolTip : public QWidget -{ - Q_OBJECT - -public: - - ComboBoxToolTip(QWidget *parent, const char *name, const char* rtips[], const int& r_size ); - ~ComboBoxToolTip(); - - QLabel* tipLabel; - MEventFilter* eFilter; - //qt3to4 -- BW - //QListBox* lb; - QComboBox* lb; - const char** tips; - uint tipSize; - -public slots: - - void setTips( const char** rtips, const int& r_size ); -virtual void showTipLabel( int index ); - //qt3to4 -- BW - //void ShowHideTip( int index, QLabel* tipL, Q3ListBox* lb, const QString& text ); - void ShowHideTip( int index, QLabel* tipL, QComboBox* lb, const QString& text ); - void MovingMouseOnBox( ); - void PressingMouseButton(); -}; -#endif - diff --git a/HEN_HOUSE/gui/egs_inprz/include/executiondlgImpl.h b/HEN_HOUSE/gui/egs_inprz/include/executiondlgImpl.h index 1fe52b0d1..434e7dbc3 100644 --- a/HEN_HOUSE/gui/egs_inprz/include/executiondlgImpl.h +++ b/HEN_HOUSE/gui/egs_inprz/include/executiondlgImpl.h @@ -38,7 +38,6 @@ //qt3to4 -- BW #include "commandManager.h" -#include "comboboxtooltip.h" //qt3to4 -- BW //#include #include @@ -53,15 +52,13 @@ 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(); //QLabel* tipLabel; //MEventFilter* eFilter; -ComboBoxToolTip* ctt; - //qt3to4 -- BW QString the_hen_house; QString the_command; diff --git a/HEN_HOUSE/gui/egs_inprz/include/inputRZImpl.h b/HEN_HOUSE/gui/egs_inprz/include/inputRZImpl.h index 0a4bdfa23..0180adc4d 100644 --- a/HEN_HOUSE/gui/egs_inprz/include/inputRZImpl.h +++ b/HEN_HOUSE/gui/egs_inprz/include/inputRZImpl.h @@ -40,7 +40,6 @@ #include "datainp.h" #include "inputs.h" #include "eventfilter.h" -#include "comboboxtooltip.h" #include "beamsrcdlg.h" #include #include @@ -83,7 +82,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(); @@ -127,19 +126,6 @@ QString queue; //public access stuff for PEGSless inputs PEGSLESSInputs* Ppgls; -// my own tool tips for Combo Box list items - -ComboBoxToolTip* srcTip; -ComboBoxToolTip* ifullTip; -ComboBoxToolTip* iwatchTip; -ComboBoxToolTip* irestartTip; -ComboBoxToolTip* etransportTip; -ComboBoxToolTip* outputTip; -ComboBoxToolTip* mediaTip; -ComboBoxToolTip* imodeTip; -ComboBoxToolTip* iprimaryTip; -ComboBoxToolTip* compilationTip; - // a push button for the beam source QPushButton* beamButton; diff --git a/HEN_HOUSE/gui/egs_inprz/include/tools.h b/HEN_HOUSE/gui/egs_inprz/include/tools.h index ad97f2895..5584d8039 100644 --- a/HEN_HOUSE/gui/egs_inprz/include/tools.h +++ b/HEN_HOUSE/gui/egs_inprz/include/tools.h @@ -33,7 +33,7 @@ #define TOOLS_H #include -#include +#include #include #include //qt3to4 -- BW diff --git a/HEN_HOUSE/gui/egs_inprz/src/comboboxtooltip.cpp b/HEN_HOUSE/gui/egs_inprz/src/comboboxtooltip.cpp deleted file mode 100644 index 2c6c0bdf9..000000000 --- a/HEN_HOUSE/gui/egs_inprz/src/comboboxtooltip.cpp +++ /dev/null @@ -1,170 +0,0 @@ -/* -############################################################################### -# -# EGSnrc egs_inprz combo box tooltip -# Copyright (C) 2015 National Research Council Canada -# -# This file is part of EGSnrc. -# -# EGSnrc is free software: you can redistribute it and/or modify it under -# the terms of the GNU Affero General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# EGSnrc is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for -# more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with EGSnrc. If not, see . -# -############################################################################### -# -# Author: Ernesto Mainegra-Hing, 2002 -# -# Contributors: Blake Walters -# -############################################################################### -*/ - - -#include "comboboxtooltip.h" -#include -#include -#include -//qt3to4 -- BW -#include -#include - -//Added by qt3to4: -//#include -#include -//#include -//qt3to4 -- BW -//#include - -ComboBoxToolTip::ComboBoxToolTip(QWidget *parent, const char *name, const char* rtips[], const int& r_size ) - : QWidget( parent ) -{ - - // tool tip for ListBoxItems inside combo boxes - // created from scratch since ListBoxItems ain't widgets - -//qt3to4 -- BW -//tipLabel = new QLabel( QApplication::desktop(), "toolTipTip",Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::WStyle_Tool | Qt::WX11BypassWM ); -tipLabel = new QLabel("toolTipTip",parent,Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint |Qt::Tool | Qt::X11BypassWindowManagerHint ); - - tipLabel->setPalette( QToolTip::palette()); - tipLabel->hide(); - hide(); - -//qt3to4 -- BW - if ( parent->inherits( "QComboBox" ) ){ -//if ( parent->inherits( "Q3ComboBox" ) ){ - //qt3to4 -- BW - //lb = ((QComboBox*)parent)->listBox(); - //lb = ((Q3ComboBox*)parent)->listBox(); - lb = (QComboBox*)parent; - eFilter = new MEventFilter( lb , 0); - } - else { - eFilter = new MEventFilter( parent, 0); - } - -connect( eFilter, SIGNAL( mouseMoving() ), this, SLOT( MovingMouseOnBox() ) ); -connect( eFilter, SIGNAL( hideEvent() ), tipLabel, SLOT( hide() ) ); -//connect( parent, SIGNAL( activated(int) ), this, SLOT( showTipLabel( int) ) ); -//qt3to4 -- BW -- this causes a bus error and is actually not a QComboBox signal -//connect( lb, SIGNAL( selected(int) ), this, SLOT( showTipLabel( int) ) ); -connect( eFilter, SIGNAL( mouseButRelease() ), tipLabel, SLOT( hide() ) ); -//connect( eFilter, SIGNAL( mouseButPress() ), this, SLOT( MovingMouseOnBox() ) ); -tips = rtips; -tipSize = r_size;; - -// this gives you the name of the object <= useful for debugging -//cout << "No. of tips for "<< parent->name()<< " : " << tipSize << endl; - -} - -ComboBoxToolTip::~ComboBoxToolTip() -{ - zap(eFilter); - zap(tipLabel); -} - -void ComboBoxToolTip::setTips( const char** rtips, const int& r_size ) -{ - tips = rtips; - tipSize = r_size; -} - -void ComboBoxToolTip::PressingMouseButton() -{ - tipLabel->hide(); -} - -void ComboBoxToolTip::MovingMouseOnBox( ) -{ - int index = lb->currentIndex(); - index = ( index >= tipSize ) ? tipSize : index; - - QString text; - QTextStream( &text ) << tips[index]; - ShowHideTip( index, tipLabel, lb, text ); -} - -void ComboBoxToolTip::showTipLabel( int index ) -{ - index = ( index >= tipSize ) ? tipSize : index; - QString text; - QTextStream( &text ) << tips[index]; - ShowHideTip( index, tipLabel, lb, text ); -} - -//qt3to4 -- BW -//void ComboBoxToolTip::ShowHideTip( int index, QLabel* tipL, Q3ListBox* lb, const QString& text ) -void ComboBoxToolTip::ShowHideTip( int index, QLabel* tipL, QComboBox* lb, const QString& text ) -{ - - //if ( lb->isVisible() && !lb->isHidden() && lb->hasMouse() ) - if ( lb->isVisible() && !lb->isHidden() ) - { - //qt3to4 -- BW - QAbstractItemView* qv = lb->view(); - //qt3to4 -- BW - //QRect rect = lb->itemRect ( lb->item( index ) ); - QRect rect = qv->visualRect(lb->rootModelIndex()); - tipL->setMargin(1); - tipL->setIndent(0); - //qt3to4 -- BW - //tipL->setAutoMask( FALSE ); - tipL->setFrameStyle( QFrame::Plain | QFrame::Box ); - tipL->setLineWidth( 1 ); - tipL->setAlignment( Qt::AlignLeft | Qt::AlignTop ); - //tipL->polish(); - tipL->setText(text); - tipL->adjustSize(); - QPoint pos; - pos.setX( rect.right() + 15 ); - pos.setY( rect.top() ); - pos = lb->mapToGlobal( pos ); - tipL->move( pos.x(), pos.y() ); - tipL->show(); - tipL->raise(); - return; - } - else{ - if (!tipL->isHidden() ) - tipL->hide(); - } - - /* - if ( !lb->isVisible() || lb->isHidden() || - !lb->hasMouse()) { - tipL->hide(); - } - */ - - -} diff --git a/HEN_HOUSE/gui/egs_inprz/src/eventfilter.cpp b/HEN_HOUSE/gui/egs_inprz/src/eventfilter.cpp index e7c0e5a62..91226f7d1 100644 --- a/HEN_HOUSE/gui/egs_inprz/src/eventfilter.cpp +++ b/HEN_HOUSE/gui/egs_inprz/src/eventfilter.cpp @@ -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 ) diff --git a/HEN_HOUSE/gui/egs_inprz/src/executiondlgImpl.cpp b/HEN_HOUSE/gui/egs_inprz/src/executiondlgImpl.cpp index e9da26d69..f5eb76eaa 100644 --- a/HEN_HOUSE/gui/egs_inprz/src/executiondlgImpl.cpp +++ b/HEN_HOUSE/gui/egs_inprz/src/executiondlgImpl.cpp @@ -41,7 +41,7 @@ //qt3to4 -- BW #include -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) @@ -78,15 +78,11 @@ ExecutiondlgImpl::ExecutiondlgImpl( QWidget* parent, const char* name, bool moda // For specific settings of the BATCH SUBMISSION SYSTEM getQueueingSystemOptions(); - // tool tip for ListBoxItems inside combo boxes -// created from scratch since ListBoxItems ain't widgets - ctt = new ComboBoxToolTip( QueueComboBox, 0, queues, sizeof queues / sizeof(char *) ); - } ExecutiondlgImpl::~ExecutiondlgImpl() { - zap(ctt); + } //qt3to4 -- BW diff --git a/HEN_HOUSE/gui/egs_inprz/src/inputRZForm.cpp b/HEN_HOUSE/gui/egs_inprz/src/inputRZForm.cpp index 781fac5d7..cceafc5f0 100644 --- a/HEN_HOUSE/gui/egs_inprz/src/inputRZForm.cpp +++ b/HEN_HOUSE/gui/egs_inprz/src/inputRZForm.cpp @@ -30,7 +30,7 @@ ############################################################################### */ - +#include #include "tooltips.h" #include "inputRZImpl.h" #include "errordlg.h" @@ -288,23 +288,7 @@ geoErrors = ""; sloteFluTable->setWhatsThis(TOP_BIN_FLU ); sloteFluTable->setToolTip(TOP_BIN_FLU ); -outputTip = new ComboBoxToolTip( outoptComboBox, 0, out_dos, - sizeof out_dos / sizeof(char *) ); - -iprimaryTip = new ComboBoxToolTip( IPRIMARYComboBox, 0, spectrum_type, - sizeof spectrum_type / sizeof(char *) ); -etransportTip = new ComboBoxToolTip( etransportComboBox, 0, electron_transport, - sizeof electron_transport / sizeof(char *) ); -irestartTip = new ComboBoxToolTip( irestartComboBox, 0, irestart, - sizeof irestart / sizeof(char *) ); -iwatchTip = new ComboBoxToolTip( iwatchComboBox, 0, iwatch, - sizeof iwatch / sizeof(char *) ); - - // Tool tips for MC input Tab - -ifullTip = new ComboBoxToolTip( ifullComboBox, 0, ifull_dos, - sizeof ifull_dos / sizeof(char *) ); maxCPUEdit->setWhatsThis(CPU_TIME ); maxCPULabel->setWhatsThis(CPU_TIME ); @@ -360,24 +344,15 @@ cavityRadioButton->setToolTip(CAVITY ); CavityInfoLabel->hide(); -mediaTip = new ComboBoxToolTip( mediaComboBox, 0, - media_regions, sizeof media_regions / sizeof(char *) ); - // Tool tips for source input Tab //tool tip for source number combo box sourceComboBox->setToolTip("select source number" ); -srcTip = new ComboBoxToolTip( sourceComboBox, 0, - sources, sizeof sources / sizeof(char *) ); - imodeComboBox->addItem( tr( "No ZLAST" ) ); imodeComboBox->addItem( tr( "With ZLAST" ) ); imodeComboBox->hide(); -imodeTip = new ComboBoxToolTip( imodeComboBox, 0, - imode, sizeof imode / sizeof(char *) ); - localRadioButton->setWhatsThis( RAD_DIS_LOCAL); externalRadioButton->setWhatsThis(RAD_DIS_EXTERNAL); localRadioButton->setToolTip( RAD_DIS_LOCAL); @@ -584,19 +559,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; } @@ -2570,15 +2545,10 @@ void inputRZImpl::update_usercode() ifullComboBox->addItem( tr( "Ap" ) ); ifullComboBox->addItem( tr( "Afl and g/w" ) ); - ifullTip->setTips(ifull_cav, sizeof ifull_cav / sizeof(char *)); - outoptComboBox->clear(); outoptComboBox->addItem( tr( "short" ) ); outoptComboBox->addItem( tr( "cavity details" ) ); - outputTip->setTips( out_cav, sizeof out_cav / sizeof(char *)); - - TabWidgetRZ->setTabEnabled(TabWidgetRZ->indexOf(CItab), true ); @@ -2630,8 +2600,6 @@ void inputRZImpl::update_usercode() ifullComboBox->addItem( tr( "pulse height distribution" ) ); ifullComboBox->addItem( tr( "scatter fraction" ) ); - ifullTip->setTips(ifull_dos, sizeof ifull_dos / sizeof(char *)); - outoptComboBox->clear(); outoptComboBox->addItem( tr( "short" ) ); outoptComboBox->addItem( tr( "dose summary" ) ); @@ -2639,8 +2607,6 @@ void inputRZImpl::update_usercode() outoptComboBox->addItem( tr( "material and dose summary" ) ); outoptComboBox->addItem( tr( "long" ) ); - outputTip->setTips( out_dos, sizeof out_dos / sizeof(char *)); - //Q3WhatsThis::add( CSEnhancementGroupBox, CS_ENHANCEMENT_DOSRZNRC ); CSEnhancementGroupBox->setWhatsThis(CS_ENHANCEMENT_DOSRZNRC ); CSEnhancementGroupBox->setToolTip(CS_ENHANCEMENT_DOSRZNRC ); @@ -2848,7 +2814,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); @@ -3346,7 +3312,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() ) @@ -3690,7 +3656,11 @@ 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); + #if QT_VERSION >= 0x050000 + t->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); + #else + t->horizontalHeader()->setResizeMode(QHeaderView::Stretch); + #endif t->installEventFilter(this);} //qt3to4 -- BW @@ -3731,7 +3701,11 @@ 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); + #if QT_VERSION >= 0x050000 + t->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); + #else + t->horizontalHeader()->setResizeMode(QHeaderView::Stretch); + #endif t->installEventFilter(this); } @@ -3749,7 +3723,11 @@ 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); + #if QT_VERSION >= 0x050000 + t->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); + #else + t->horizontalHeader()->setResizeMode(QHeaderView::Stretch); + #endif t->installEventFilter(this); } @@ -3765,7 +3743,11 @@ 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); + #if QT_VERSION >= 0x050000 + table->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); + #else + table->horizontalHeader()->setResizeMode(QHeaderView::Stretch); + #endif table->installEventFilter(this); } @@ -3781,7 +3763,11 @@ 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); + #if QT_VERSION >= 0x050000 + table->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); + #else + table->horizontalHeader()->setResizeMode(QHeaderView::Stretch); + #endif table->installEventFilter(this); } @@ -3961,8 +3947,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; diff --git a/HEN_HOUSE/gui/egs_inprz/src/inputRZImpl.cpp b/HEN_HOUSE/gui/egs_inprz/src/inputRZImpl.cpp index 4c63e548e..517fd5276 100644 --- a/HEN_HOUSE/gui/egs_inprz/src/inputRZImpl.cpp +++ b/HEN_HOUSE/gui/egs_inprz/src/inputRZImpl.cpp @@ -65,7 +65,7 @@ using namespace std; #define zapM(x) cout<<"deleting "<< string(x->metaObject()->className())<< endl;if(x){delete(x);x=0;} inputRZImpl::inputRZImpl( QWidget* parent, const char* name, - bool modal, Qt::WFlags f ) + bool modal, Qt::WindowFlags f ) : QWidget(parent) { @@ -78,15 +78,6 @@ inputRZImpl::inputRZImpl( QWidget* parent, const char* name, inputRZImpl::~inputRZImpl() { - zapM( srcTip ); - zapM( ifullTip ); - zapM( iwatchTip ); - zapM( irestartTip ); - zapM( etransportTip ); - zapM( outputTip ); - zapM( mediaTip ); - zapM( imodeTip ); - zapM( iprimaryTip ); zap( mediaTable ); } @@ -97,7 +88,7 @@ void inputRZImpl::compile_userCode() { //qt3to4 //char s = QDir::separator(); - char s = QDir::separator().toAscii(); + char s = QDir::separator().toLatin1(); QString egs_compiler = readVarFromConf("make_prog"); if ( egs_compiler.isEmpty() ) egs_compiler = "make";// default is GNU make @@ -143,7 +134,7 @@ void inputRZImpl::run_userCode() QString inpf = EGSfileName; //qt3to4 -- BW //char s = QDir::separator(); - char s = QDir::separator().toAscii(); + char s = QDir::separator().toLatin1(); QString the_user_code_area = ironIt( EGS_HOME+s+usercodename+s ); if ( EGSdir != the_user_code_area ){ @@ -406,7 +397,7 @@ void inputRZImpl::checkCompilationAbility(){ //qt3to4 -- BW //char s = QDir::separator(); - char s = QDir::separator().toAscii(); + char s = QDir::separator().toLatin1(); QString missing_files = QString(); @@ -517,7 +508,7 @@ void inputRZImpl::SetInpfileName( QString inp_name ) QString tmpDir = EGSdir; //qt3to4 -- BW //char s = QDir::separator(); - char s = QDir::separator().toAscii(); + char s = QDir::separator().toLatin1(); if ( !inp_name.isEmpty() ) { EGSfileName = ironIt( inp_name ); // may be a full path name QFileInfo fi( EGSfileName ); @@ -561,7 +552,7 @@ void inputRZImpl::OpenEGSInpFile() QString tmpDir = EGSdir; //qt3to4 -- BW //char s = QDir::separator(); - char s = QDir::separator().toAscii(); + char s = QDir::separator().toLatin1(); QDir d(tmpDir); if ( !d.exists() ) { tmpDir = GetCurrentDir( usercodename, EGS_HOME, HEN_HOUSE ); @@ -729,7 +720,7 @@ void inputRZImpl::customFFTable_singleclicked( int row, int col) { void inputRZImpl::GetMDfile() { QString tmpDir; - char s = QDir::separator().toAscii(); + char s = QDir::separator().toLatin1(); //try EGS_HOME/pegs4/data, then HEN_HOUSE/pegs4/data then $HOME/pegs4/data tmpDir = GetCurrentDir( "pegs4/data", EGS_HOME, HEN_HOUSE ); QDir d(tmpDir); @@ -746,7 +737,7 @@ void inputRZImpl::GetMDfile() void inputRZImpl::GetDFfile() { QString start_dir; - char s = QDir::separator().toAscii(); + char s = QDir::separator().toLatin1(); if(DFSearchComboBox->currentText() == "HEN_HOUSE") start_dir = ironIt(HEN_HOUSE + s + "pegs4" + s + "density_corrections" + s); else start_dir = ironIt(EGS_HOME + s + "pegs4" + s + "density_corrections" + s); @@ -973,7 +964,7 @@ void inputRZImpl::GetPEGSfile() QString tmpDir = PEGSdir; //qt3to4 -- BW //char s = QDir::separator(); - char s = QDir::separator().toAscii(); + char s = QDir::separator().toLatin1(); QDir d(tmpDir); if ( !d.exists() ) { tmpDir = GetCurrentDir( "pegs4/data", EGS_HOME, HEN_HOUSE ); @@ -1036,7 +1027,9 @@ void inputRZImpl::GetSPECfile() //qt3to4 -- BW //Q3FileDialog* fd = new Q3FileDialog(SPECdir, QString::null, this); QFileDialog* fd = new QFileDialog(this,"",SPECdir, QString()); - fd->setFilter( "SPEC files (*.spectrum *.ensrc)" ); + QStringList filters; + filters << "*.spectrum" << "*.ensrc"; + fd->setNameFilters( filters ); QString f; QStringList flst; if ( fd->exec() == QDialog::Accepted ) diff --git a/HEN_HOUSE/gui/egs_inprz/src/mainRZ.cpp b/HEN_HOUSE/gui/egs_inprz/src/mainRZ.cpp index 5f943de4e..2c2200186 100644 --- a/HEN_HOUSE/gui/egs_inprz/src/mainRZ.cpp +++ b/HEN_HOUSE/gui/egs_inprz/src/mainRZ.cpp @@ -39,7 +39,7 @@ int main( int argc, char* argv[] ) QApplication app( argc, argv); - inputRZImpl* inputRZ = new inputRZImpl(0,"egs_inprz",FALSE,0); + inputRZImpl* inputRZ = new inputRZImpl(0,"egs_inprz",false,0); inputRZ->show(); diff --git a/HEN_HOUSE/specs/windows.spec b/HEN_HOUSE/specs/windows.spec index c9d6034f0..fad41d395 100644 --- a/HEN_HOUSE/specs/windows.spec +++ b/HEN_HOUSE/specs/windows.spec @@ -103,5 +103,5 @@ endif # This is only relevant at NRC. For now we are using the # nmake-msvc qt configuration => gui_make must be set to nmake. # -gui_make = nmake /NOLOGO -#gui_make = nmake +gui_make = mingw32-make +