Skip to content

Commit

Permalink
remove deprecation warnings in Qt 5.15
Browse files Browse the repository at this point in the history
  • Loading branch information
JostMigenda committed May 14, 2024
1 parent 1d9a4e7 commit 303791a
Show file tree
Hide file tree
Showing 14 changed files with 55 additions and 51 deletions.
2 changes: 1 addition & 1 deletion CemrgApp/Modules/CemrgAppModule/src/CemrgCommandLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ CemrgCommandLine::CemrgCommandLine() {

//Setup dialog
layout = new QVBoxLayout();
dial = new QDialog(0,0);
dial = new QDialog(0, Qt::WindowFlags());
dial->setFixedSize(640, 480);
dial->setLayout(layout);
dial->layout()->addWidget(panel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ PURPOSE. See the above copyright notices for more information.

// Qt
#include <QMessageBox>
#include <QDesktopWidget>
#include <QFile>
#include <QGuiApplication>
#include <QScreen>

// CemrgAppModule
#include <CemrgAtriaClipper.h>
Expand Down Expand Up @@ -125,7 +126,7 @@ void AtrialFibresClipperView::CreateQtPartControl(QWidget *parent) {
defaultClipperRadius = 9.0;

MITK_INFO <<"Create GUI widgets";
inputs = new QDialog(0,0);
inputs = new QDialog(0, Qt::WindowFlags());
m_Labels.setupUi(inputs);
connect(m_Labels.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept()));
connect(m_Labels.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject()));
Expand Down Expand Up @@ -714,7 +715,7 @@ void AtrialFibresClipperView::InterPvSpacing(){

int AtrialFibresClipperView::GetUserFixMeshingLabel(){
// returns the label to fix in the corridor (or -1 to cancel)
QDialog* inputs = new QDialog(0,0);
QDialog* inputs = new QDialog(0, Qt::WindowFlags());
m_UICorridor.setupUi(inputs);
connect(m_UICorridor.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept()));
connect(m_UICorridor.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject()));
Expand Down Expand Up @@ -1350,7 +1351,7 @@ void AtrialFibresClipperView::SetAutomaticModeButtons(bool b){

void AtrialFibresClipperView::UserSelectPvLabel(){
int dialogCode = inputs->exec();
QRect screenGeometry = QApplication::desktop()->screenGeometry();
QRect screenGeometry = QGuiApplication::primaryScreen()->geometry();
int x = (screenGeometry.width() - inputs->width()) / 2;
int y = (screenGeometry.height() - inputs->height()) / 2;
inputs->move(x,y);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ PURPOSE. See the above copyright notices for more information.

// Qt
#include <QMessageBox>
#include <QDesktopWidget>
#include <QGuiApplication>
#include <QScreen>

// CemrgAppModule
#include <CemrgAtriaClipper.h>
Expand Down Expand Up @@ -109,12 +110,12 @@ void AtrialFibresLandmarksView::CreateQtPartControl(QWidget *parent) {
}

//Create GUI widgets
inputsRough = new QDialog(0,0);
inputsRough = new QDialog(0, Qt::WindowFlags());
m_Rough.setupUi(inputsRough);
connect(m_Rough.buttonBox, SIGNAL(accepted()), inputsRough, SLOT(accept()));
connect(m_Rough.buttonBox, SIGNAL(rejected()), inputsRough, SLOT(reject()));

inputsRefined = new QDialog(0,0);
inputsRefined = new QDialog(0, Qt::WindowFlags());
m_Refined.setupUi(inputsRefined);
connect(m_Refined.buttonBox, SIGNAL(accepted()), inputsRefined, SLOT(accept()));
connect(m_Refined.buttonBox, SIGNAL(rejected()), inputsRefined, SLOT(reject()));
Expand Down Expand Up @@ -622,7 +623,7 @@ void AtrialFibresLandmarksView::UserSelectPvLabel(bool refinedLandmarks){

void AtrialFibresLandmarksView::UserSelectPvRoughLabel(){
int dialogCode = inputsRough->exec();
QRect screenGeometry = QApplication::desktop()->screenGeometry();
QRect screenGeometry = QGuiApplication::primaryScreen()->geometry();
int x = (screenGeometry.width() - inputsRough->width()) / 2;
int y = (screenGeometry.height() - inputsRough->height()) / 2;
inputsRough->move(x,y);
Expand Down Expand Up @@ -679,7 +680,7 @@ void AtrialFibresLandmarksView::UserSelectPvRoughLabel(){

void AtrialFibresLandmarksView::UserSelectPvRefinedLabel(){
int dialogCode = inputsRefined->exec();
QRect screenGeometry = QApplication::desktop()->screenGeometry();
QRect screenGeometry = QGuiApplication::primaryScreen()->geometry();
int x = (screenGeometry.width() - inputsRefined->width()) / 2;
int y = (screenGeometry.height() - inputsRefined->height()) / 2;
inputsRefined->move(x,y);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1683,7 +1683,7 @@ bool AtrialFibresView::RequestProjectDirectoryFromUser() {
}

bool AtrialFibresView::GetUserConvertFormatInputs(QString inname, QString inext, bool cleanmesh){
QDialog* inputs = new QDialog(0,0);
QDialog* inputs = new QDialog(0, Qt::WindowFlags());
bool userInputAccepted=false;
m_UIFormat.setupUi(inputs);
connect(m_UIFormat.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept()));
Expand Down Expand Up @@ -1748,7 +1748,7 @@ bool AtrialFibresView::GetUserUacOptionsInputs(bool enableFullUiOptions){
}

if(!userInputAccepted){
QDialog* inputs = new QDialog(0,0);
QDialog* inputs = new QDialog(0, Qt::WindowFlags());
m_UIUac.setupUi(inputs);
connect(m_UIUac.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept()));
connect(m_UIUac.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject()));
Expand Down Expand Up @@ -1792,7 +1792,7 @@ bool AtrialFibresView::GetUserEditLabelsInputs(){
bool userInputAccepted=false;

if(!userInputAccepted){
QDialog* inputs = new QDialog(0,0);
QDialog* inputs = new QDialog(0, Qt::WindowFlags());
m_UIEditLabels.setupUi(inputs);
connect(m_UIEditLabels.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept()));
connect(m_UIEditLabels.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject()));
Expand Down Expand Up @@ -1873,7 +1873,7 @@ bool AtrialFibresView::GetUserEditLabelsInputs(){
}

bool AtrialFibresView::GetUserRemeshingInputs(){
QDialog* inputs = new QDialog(0,0);
QDialog* inputs = new QDialog(0, Qt::WindowFlags());
bool userInputAccepted=false;
m_UIRemesh.setupUi(inputs);
connect(m_UIRemesh.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept()));
Expand Down Expand Up @@ -1948,7 +1948,7 @@ bool AtrialFibresView::GetUserAnalysisSelectorInputs(){
}

if(!userInputAccepted){
QDialog* inputs = new QDialog(0,0);
QDialog* inputs = new QDialog(0, Qt::WindowFlags());
m_UISelector.setupUi(inputs);
connect(m_UISelector.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept()));
connect(m_UISelector.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject()));
Expand Down Expand Up @@ -2008,7 +2008,7 @@ bool AtrialFibresView::GetUserMeshingInputs(){
userInputAccepted=true;
}
} else{
QDialog* inputs = new QDialog(0,0);
QDialog* inputs = new QDialog(0, Qt::WindowFlags());
m_UIMeshing.setupUi(inputs);
connect(m_UIMeshing.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept()));
connect(m_UIMeshing.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject()));
Expand Down Expand Up @@ -2047,7 +2047,7 @@ bool AtrialFibresView::GetUserMeshingInputs(){
bool AtrialFibresView::GetUserScarProjectionInputs(){
bool userInputAccepted=false;

QDialog* inputs = new QDialog(0,0);
QDialog* inputs = new QDialog(0, Qt::WindowFlags());
m_UIcemrgnet.setupUi(inputs);
connect(m_UIcemrgnet.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept()));
connect(m_UIcemrgnet.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject()));
Expand Down Expand Up @@ -2103,7 +2103,7 @@ bool AtrialFibresView::GetUserScarProjectionInputs(){
MITK_INFO << "[UI] Creating list of thresholds";
separated_thresh_list.removeLast();
separated_thresh_list.removeLast();
separated_thresh_list = thresh_list.split("," , QString::SkipEmptyParts);
separated_thresh_list = thresh_list.split(",", Qt::SkipEmptyParts);
int listspaces = separated_thresh_list.removeAll(" ");
int listduplicates = separated_thresh_list.removeDuplicates();
std::cout << "Spaces in list: " << listspaces << " Duplicates in list: " << listduplicates << '\n';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ void EASIView::CreateMesh() {
myFile.close();

//Ask for user input to set the parameters
QDialog* inputs = new QDialog(0, 0);
QDialog *inputs = new QDialog(0, Qt::WindowFlags());

m_UIMeshing.setupUi(inputs);
connect(m_UIMeshing.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void QmitkCemrgAppCommonTools::ConvertToCarto() {
}//_if

//Ask for user input to set the parameters
QDialog* inputs = new QDialog(0, 0);
QDialog *inputs = new QDialog(0, Qt::WindowFlags());
m_CartoUIThresholding.setupUi(inputs);
connect(m_CartoUIThresholding.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept()));
connect(m_CartoUIThresholding.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject()));
Expand Down Expand Up @@ -262,7 +262,7 @@ void QmitkCemrgAppCommonTools::PadImageEdgesWithConstant(){
}

//Ask for user input to set the parameters
QDialog* inputs = new QDialog(0,0);
QDialog *inputs = new QDialog(0, Qt::WindowFlags());
m_ImagePadding.setupUi(inputs);
connect(m_ImagePadding.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept()));
connect(m_ImagePadding.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ void MmcwView::CreateSurf() {
return;

//Ask for user input to set the parameters
QDialog* inputs = new QDialog(0, 0);
QDialog *inputs = new QDialog(0, Qt::WindowFlags());
m_UIMeshing.setupUi(inputs);
connect(m_UIMeshing.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept()));
connect(m_UIMeshing.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject()));
Expand Down Expand Up @@ -683,7 +683,7 @@ void MmcwView::Tracking() {
}//_if

//Ask for user input to set the parameters
QDialog* inputs = new QDialog(0, 0);
QDialog* inputs = new QDialog(0, Qt::WindowFlags());
QSignalMapper* signalMapper = new QSignalMapper(this);

m_UITracking.setupUi(inputs);
Expand Down Expand Up @@ -793,7 +793,7 @@ void MmcwView::Applying() {
}//_if

//Ask for user input to set the parameters
QDialog* inputs = new QDialog(0, 0);
QDialog *inputs = new QDialog(0, Qt::WindowFlags());
QSignalMapper* signalMapper = new QSignalMapper(this);

m_UIApplying.setupUi(inputs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ void MmeasurementView::Tracking() {
}//_if

//Ask for user input to set the parameters
QDialog* inputs = new QDialog(0, 0);
QDialog* inputs = new QDialog(0, Qt::WindowFlags());
QSignalMapper* signalMapper = new QSignalMapper(this);

m_UITracking.setupUi(inputs);
Expand Down Expand Up @@ -627,7 +627,7 @@ void MmeasurementView::Applying() {
rr->Convert(directory, node);

//Ask for user input to set the parameters
QDialog* inputs = new QDialog(0, 0);
QDialog* inputs = new QDialog(0, Qt::WindowFlags());
QSignalMapper* signalMapper = new QSignalMapper(this);

m_UIApplying.setupUi(inputs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ void powertransView::MapPowerTop() {
}

void powertransView::ResetRibSpacing() {
QDialog* inputs = new QDialog(0, 0);
QDialog *inputs = new QDialog(0, Qt::WindowFlags());
m_UIRibSpacing.setupUi(inputs);

connect(m_UIRibSpacing.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept()));
Expand Down Expand Up @@ -445,7 +445,7 @@ void powertransView::LandmarkSelection() {
//Ask for user input to set the ribSpacing number
if (ribSpacing==0) {
QDialog* inputs = new QDialog(0,0);
QDialog* inputs = new QDialog(0, Qt::WindowFlags());
m_UIRibSpacing.setupUi(inputs);
connect(m_UIRibSpacing.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept()));
Expand Down Expand Up @@ -501,7 +501,7 @@ void powertransView::MapPowerTransLM() {
}
//Ask for user input to set the ribSpacing number
if (ribSpacing == 0) {
QDialog* inputs = new QDialog(0, 0);
QDialog *inputs = new QDialog(0, Qt::WindowFlags());
m_UIRibSpacing.setupUi(inputs);

connect(m_UIRibSpacing.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept()));
Expand Down Expand Up @@ -575,7 +575,7 @@ void powertransView::MapPowerTransLM() {
}
//Ask for user input to set the ribSpacing number
if (ribSpacing==0) {
QDialog* inputs = new QDialog(0,0);
QDialog* inputs = new QDialog(0, Qt::WindowFlags());
m_UIRibSpacing.setupUi(inputs);
connect(m_UIRibSpacing.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept()));
Expand Down Expand Up @@ -665,7 +665,7 @@ void powertransView::CalculatePower() {
}
//Ask for user input to set the ribSpacing number
if (ribSpacing == 0) {
QDialog* inputs = new QDialog(0, 0);
QDialog *inputs = new QDialog(0, Qt::WindowFlags());
m_UIRibSpacing.setupUi(inputs);

connect(m_UIRibSpacing.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept()));
Expand Down Expand Up @@ -760,7 +760,7 @@ void powertransView::AHALandmarkSelection() {
void powertransView::MapAHAfromInput() {

//Ask for user input to set the parameters
QDialog* inputs = new QDialog(0, 0);
QDialog *inputs = new QDialog(0, Qt::WindowFlags());
QSignalMapper* signalMapper = new QSignalMapper(this);

m_UIAhaInput.setupUi(inputs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ PURPOSE. See the above copyright notices for more information.

// Qt
#include <QMessageBox>
#include <QDesktopWidget>
#include <QGuiApplication>
#include <QScreen>

// CemrgAppModule
#include <CemrgAtriaClipper.h>
Expand All @@ -73,7 +74,7 @@ QString AtrialScarClipperView::directory;
const std::string AtrialScarClipperView::VIEW_ID = "org.mitk.views.scarclipper";

AtrialScarClipperView::AtrialScarClipperView(){
this->inputs = new QDialog(0, 0);
this->inputs = new QDialog(0, Qt::WindowFlags());
}

void AtrialScarClipperView::CreateQtPartControl(QWidget *parent) {
Expand All @@ -88,7 +89,7 @@ void AtrialScarClipperView::CreateQtPartControl(QWidget *parent) {
connect(m_Controls.comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(CtrLinesSelector(int)));

//Create GUI widgets
inputs = new QDialog(0, 0);
inputs = new QDialog(0, Qt::WindowFlags());
m_Labels.setupUi(inputs); //QDialogButtonBox
connect(m_Labels.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept()));
connect(m_Labels.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject()));
Expand Down Expand Up @@ -180,7 +181,7 @@ void AtrialScarClipperView::iniPreSurf() {
}//_if

//Ask for user input to set the parameters
QDialog* inputs = new QDialog(0, 0);
QDialog* inputs = new QDialog(0, Qt::WindowFlags());
m_UIMeshing.setupUi(inputs);
connect(m_UIMeshing.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept()));
connect(m_UIMeshing.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject()));
Expand Down Expand Up @@ -630,7 +631,7 @@ void AtrialScarClipperView::KeyCallBackFunc(vtkObject*, long unsigned int, void*
//Ask the labels
self->PickCallBack();
int dialogCode = self->inputs->exec();
QRect screenGeometry = QApplication::desktop()->screenGeometry();
QRect screenGeometry = QGuiApplication::primaryScreen()->geometry();
int x = (screenGeometry.width() - self->inputs->width()) / 2;
int y = (screenGeometry.height() - self->inputs->height()) / 2;
self->inputs->move(x, y);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ void AtrialScarView::AutomaticAnalysis() {
}
}//_while

QDialog* inputs = new QDialog(0, 0);
QDialog* inputs = new QDialog(0, Qt::WindowFlags());
m_UIcemrgnet.setupUi(inputs);
connect(m_UIcemrgnet.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept()));
connect(m_UIcemrgnet.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject()));
Expand Down Expand Up @@ -420,7 +420,7 @@ void AtrialScarView::AutomaticAnalysis() {
MITK_INFO << "[UI] Creating list of thresholds";
separated_thresh_list.removeLast();
separated_thresh_list.removeLast();
separated_thresh_list = thresh_list.split(",", QString::SkipEmptyParts);
separated_thresh_list = thresh_list.split(",", Qt::SkipEmptyParts);
int listspaces = separated_thresh_list.removeAll(" ");
int listduplicates = separated_thresh_list.removeDuplicates();
separated_thresh_list.sort();
Expand Down Expand Up @@ -1167,7 +1167,7 @@ void AtrialScarView::CreateSurf() {
}//_if

//Ask for user input to set the parameters
QDialog* inputs = new QDialog(0, 0);
QDialog* inputs = new QDialog(0, Qt::WindowFlags());
m_UIMeshing.setupUi(inputs);
connect(m_UIMeshing.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept()));
connect(m_UIMeshing.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject()));
Expand Down Expand Up @@ -1421,7 +1421,7 @@ void AtrialScarView::ScarMap() {
if (scar) {

//Ask for user input to set the parameters
QDialog* inputs = new QDialog(0, 0);
QDialog* inputs = new QDialog(0, Qt::WindowFlags());
m_UIScar.setupUi(inputs);
connect(m_UIScar.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept()));
connect(m_UIScar.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject()));
Expand Down Expand Up @@ -1650,7 +1650,7 @@ void AtrialScarView::Threshold() {
}//_data

//Ask for user input to set the parameters
QDialog* inputs = new QDialog(0, 0);
QDialog* inputs = new QDialog(0, Qt::WindowFlags());
m_UISQuant.setupUi(inputs);
connect(m_UISQuant.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept()));
connect(m_UISQuant.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ QString ScarCalculationsView::postScarFile;
const std::string ScarCalculationsView::VIEW_ID = "org.mitk.views.scarcalculations";

ScarCalculationsView::ScarCalculationsView() {
this->inputs = new QDialog(0, 0);
this->inputs = new QDialog(0, Qt::WindowFlags());
this->method = -1;
this->value = -1;
this->mean = -1;
Expand Down Expand Up @@ -863,7 +863,7 @@ void ScarCalculationsView::GapMeasurement() {

MITK_INFO << "Creating shortest path and corridor.";
// Choose parameters: neighbourhood size, left/right prefix
QDialog* inputs = new QDialog(0, 0);
QDialog* inputs = new QDialog(0, Qt::WindowFlags());
m_UICorridor.setupUi(inputs);
connect(m_UICorridor.buttonBox, SIGNAL(accepted()), inputs, SLOT(accept()));
connect(m_UICorridor.buttonBox, SIGNAL(rejected()), inputs, SLOT(reject()));
Expand Down
Loading

0 comments on commit 303791a

Please sign in to comment.