
Originally Posted by
Brecht
My solution now is to copy-paste the generated code into my own class, and using InsertWidget instead.
This way I can keep using the designer for the other parts of the window, just not that one frame on the toolbar...
Why are you not doing it the proper way?
public:
ui->setupUi(this);
ui
->toolBar
->insertWidget
(new QPushButton("Hey"), ui
->someAction
);
}
~MyWidget() { delete ui; }
private:
Ui::MyWidget *ui;
};
class MyWidget: public QMainWindow {
public:
MyWidget(QWidget *parent = 0) : QMainWindow(parent) {
ui->setupUi(this);
ui->toolBar->insertWidget(new QPushButton("Hey"), ui->someAction);
}
~MyWidget() { delete ui; }
private:
Ui::MyWidget *ui;
};
To copy to clipboard, switch view to plain text mode
No need to copy & paste anything anywhere.
Bookmarks