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):
{
Q_OBJECT
public:
private:
void setupUI(); //layout of the window
//some varialbles
};
class Pomiary : public QDialog
{
Q_OBJECT
public:
Pomiary(QWidget* parent=NULL);
private:
void setupUI(); //layout of the window
//some varialbles
};
To copy to clipboard, switch view to plain text mode
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
) : ui(new Ui::MainWindow)
{
ui->setupUi(this);
setWindowFlags(Qt::CustomizeWindowHint);
OknoPomiary = new Pomiary;
ui->appLayout->addWidget(button,0,0,Qt::AlignHCenter);
connect(button,SIGNAL(clicked()),OknoPomiary,SLOT(show()));
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()));
To copy to clipboard, switch view to plain text mode
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
Bookmarks