Tomasz
22nd July 2010, 15:51
Hello!
I'm creating simple measurement application which has some windows showing measured data. I'm concern about my device resources. What happening when I'm closing that extra windows? Are they still in memory?
One of my simple window looks like this (the others are alike):
class Pomiary : public QDialog
{
Q_OBJECT
public:
Pomiary(QWidget* parent=NULL);
private:
void setupUI(); //layout of the window
//some varialbles
};
That windows have a lot of variables (each one). On my main window I've got QPushButtons that opens that extra windows like this:
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
setWindowFlags(Qt::CustomizeWindowHint);
OknoPomiary = new Pomiary;
QPushButton *button = new QPushButton;
ui->appLayout->addWidget(button,0,0,Qt::AlignHCenter);
connect(button,SIGNAL(clicked()),OknoPomiary,SLOT( show()));
Is it correct way to save my resources? Or maybe application with extra windows should be done in other way? Maybe creating my widow in some kind of extra slot invoked by clicking on button?
thanks in advance
best regards
Tomasz
I'm creating simple measurement application which has some windows showing measured data. I'm concern about my device resources. What happening when I'm closing that extra windows? Are they still in memory?
One of my simple window looks like this (the others are alike):
class Pomiary : public QDialog
{
Q_OBJECT
public:
Pomiary(QWidget* parent=NULL);
private:
void setupUI(); //layout of the window
//some varialbles
};
That windows have a lot of variables (each one). On my main window I've got QPushButtons that opens that extra windows like this:
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
setWindowFlags(Qt::CustomizeWindowHint);
OknoPomiary = new Pomiary;
QPushButton *button = new QPushButton;
ui->appLayout->addWidget(button,0,0,Qt::AlignHCenter);
connect(button,SIGNAL(clicked()),OknoPomiary,SLOT( show()));
Is it correct way to save my resources? Or maybe application with extra windows should be done in other way? Maybe creating my widow in some kind of extra slot invoked by clicking on button?
thanks in advance
best regards
Tomasz