mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
Make MachineInfo a singleton class
Because on windows MachineInfo take a little time to init, we make it to a singleton. MachineInfo is build the first time in main.cpp. Now all other places where we use MachineInfo (aboutqetdialog and configdialog) gui don't hang anymore in waiting to MachineInfo finish to build.
This commit is contained in:
@@ -35,7 +35,7 @@ ConfigDialog::ConfigDialog(QWidget *parent) : QDialog(parent) {
|
||||
// liste des pages
|
||||
pages_list = new QListWidget();
|
||||
pages_list -> setViewMode(QListView::IconMode);
|
||||
if(MachineInfo::i_max_screen_height()<1000){
|
||||
if(MachineInfo::instance()->i_max_screen_height()<1000){
|
||||
pages_list -> setIconSize(QSize(64, 64));
|
||||
} else {
|
||||
pages_list -> setIconSize(QSize(128, 128));
|
||||
@@ -79,7 +79,8 @@ ConfigDialog::ConfigDialog(QWidget *parent) : QDialog(parent) {
|
||||
connect(pages_list, SIGNAL(currentRowChanged(int)),
|
||||
pages_widget, SLOT(setCurrentIndex(int)));
|
||||
|
||||
setMaximumSize(MachineInfo::i_max_screen_width(), MachineInfo::i_max_screen_height());
|
||||
setMaximumSize(MachineInfo::instance()->i_max_screen_width(),
|
||||
MachineInfo::instance()->i_max_screen_height());
|
||||
resize(1400,1000);
|
||||
|
||||
#ifdef Q_OS_MACOS
|
||||
|
||||
Reference in New Issue
Block a user