|
@@ -9,6 +9,7 @@
|
9
|
9
|
#include <QtCore/qmath.h>
|
10
|
10
|
#include <QMessageBox>
|
11
|
11
|
#include "functions.h"
|
|
12
|
+#include <QDesktopWidget>
|
12
|
13
|
|
13
|
14
|
MainWindow::MainWindow(QWidget *parent) :
|
14
|
15
|
QMainWindow(parent),
|
|
@@ -39,6 +40,13 @@ MainWindow::MainWindow(QWidget *parent) :
|
39
|
40
|
|
40
|
41
|
window = new secondwindow;
|
41
|
42
|
|
|
43
|
+ QDesktopWidget desktop;
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+ window->move( ( desktop.screenGeometry().width() - window->width() )/2,
|
|
47
|
+ ( desktop.screenGeometry().height()- window->height() ) /2);
|
|
48
|
+
|
|
49
|
+
|
42
|
50
|
// We need to know whenever the second window is closed to show the
|
43
|
51
|
// main window, or to hide when the second one is showed
|
44
|
52
|
connect(window, SIGNAL(cerrado(bool)), this, SLOT(mostrar(bool)));
|
|
@@ -79,6 +87,14 @@ void MainWindow::mostrar(bool si){
|
79
|
87
|
|
80
|
88
|
// Create the new window and connecting it again with the signal
|
81
|
89
|
window = new secondwindow;
|
|
90
|
+
|
|
91
|
+ QDesktopWidget desktop;
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+ window->move( ( desktop.screenGeometry().width() - window->width() )/2,
|
|
95
|
+ ( desktop.screenGeometry().height()- window->height() ) /2);
|
|
96
|
+
|
|
97
|
+
|
82
|
98
|
connect(window, SIGNAL(cerrado(bool)), this, SLOT(mostrar(bool)));
|
83
|
99
|
}
|
84
|
100
|
else hide();
|
|
@@ -534,6 +550,13 @@ void MainWindow::on_SortsButton_clicked()
|
534
|
550
|
//notify when it was closed so we can shor the main-window
|
535
|
551
|
window->setLayout(layout);
|
536
|
552
|
mostrar(false);
|
|
553
|
+
|
|
554
|
+ QDesktopWidget desktop;
|
|
555
|
+
|
|
556
|
+
|
|
557
|
+ window->move( ( desktop.screenGeometry().width() - window->width() )/2,
|
|
558
|
+ ( desktop.screenGeometry().height()- window->height() ) /2);
|
|
559
|
+
|
537
|
560
|
window->show();
|
538
|
561
|
}
|
539
|
562
|
|
|
@@ -721,6 +744,6 @@ void MainWindow::on_ZuluButton_clicked()
|
721
|
744
|
//and show the new one. The new-window has a signal that
|
722
|
745
|
//notify when it was closed so we can shor the main-window
|
723
|
746
|
window->setLayout(layout);
|
|
747
|
+ mostrar(false);
|
724
|
748
|
window->show();
|
725
|
749
|
}
|
726
|
|
-
|