Hello, I have some problem - I cannot use a variable from other class.
For example I have in class Setts QSpinBox SB1 and int i. I would like to check value of 'i' and set value of SB1 in method in class Pac.
I tried Setts::set_ui->SB1->setValue(1); but I got error: object missing in reference to 'Setts::set_ui'
setts.h
#include <QSpinBox>
#include "ui_setts.h>
namespace Ui {
class Setts;
}
Q_OBJECT
public:
~Setts();
Ui::Setts *set_ui;
protected:
private:
int i;
}
#include <QSpinBox>
#include "ui_setts.h>
namespace Ui {
class Setts;
}
class Setts : public QDialog {
Q_OBJECT
public:
Setts(QWidget *parent = 0);
~Setts();
Ui::Setts *set_ui;
protected:
void changeEvent(QEvent *e);
private:
QSpinBox *SB1;
int i;
}
To copy to clipboard, switch view to plain text mode
setts.cpp
#include "setts.h"
#include "ui_setts.h"
set_ui(new Ui::Setts)
{
set_ui->setupUi(this);
this->showFullScreen();
}
#include "setts.h"
#include "ui_setts.h"
Setts::Setts(QWidget *parent) :
QDialog(parent),
set_ui(new Ui::Setts)
{
set_ui->setupUi(this);
this->showFullScreen();
}
To copy to clipboard, switch view to plain text mode
Thanks in advanced
Przemek
Bookmarks