refactor: use UI file for main window
- main window now use UI file for layout. - remove all manual computed widget position code. use full Qt layout implementation instead. - remove useless functions in main window - change style changed slot as private
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
#include <QVBoxLayout>
|
||||
#include <QDebug>
|
||||
|
||||
BottomButtonGroup::BottomButtonGroup(const std::vector<QAction *> &actionList, QWidget *parent)
|
||||
BottomButtonGroup::BottomButtonGroup(QWidget *parent)
|
||||
: QGroupBox (parent)
|
||||
{
|
||||
QHBoxLayout * mainLayout = new QHBoxLayout(this);
|
||||
@@ -25,7 +25,9 @@ QToolButton {
|
||||
border-style: none;
|
||||
}
|
||||
)#");
|
||||
}
|
||||
|
||||
void BottomButtonGroup::addActions(const std::vector<QAction *> & actionList) {
|
||||
for (QAction * action : actionList) {
|
||||
// Create button
|
||||
QToolButton * btn = new QToolButton(this);
|
||||
@@ -37,3 +39,7 @@ QToolButton {
|
||||
}
|
||||
updateGeometry();
|
||||
}
|
||||
|
||||
void BottomButtonGroup::addAction(QAction* action) {
|
||||
addActions({action});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user