What do you mean you can't "attach it" to an object? If you have an object in ui file, you don't need any extra variables, you can (and should) use the one from the ui file. If you have a "plot" variable in Ui::Form and you have class MyPlot that inherits QWidget and uses the Ui::Form object:
public:
ui.setupUi(this);
}
private:
Ui::Form ui;
};
class MyPlot: public QWidget {
public:
MyPlot(QWidget *parent = 0) : QWidget(parent) {
ui.setupUi(this);
}
private:
Ui::Form ui;
};
To copy to clipboard, switch view to plain text mode
then just use the variable:
void MyPlot::someMethod() {
doSomethingWith(ui.plot);
}
void MyPlot::someMethod() {
doSomethingWith(ui.plot);
}
To copy to clipboard, switch view to plain text mode
Bookmarks