我正在尝试做一些看起来很容易的事情,但我无法让它发挥作用。我想让 QWizard 中的按钮变大。这是代码:
#include "wizard.h"
#include "ui_wizard.h"
#include "QAbstractButton"
Wizard::Wizard(QWidget *parent) :
QWizard(parent),
ui(new Ui::Wizard)
{
ui->setupUi(this);
QRect rect = this->button(QWizard::NextButton)->geometry();
this->button(QWizard::NextButton)->setGeometry(rect.x(), rect.y(), rect.width(), 40);
rect = this->button(QWizard::CancelButton)->geometry();
this->button(QWizard::CancelButton)->setGeometry(rect.x(), rect.y(), rect.width(), 40);
rect = this->button(QWizard::BackButton)->geometry();
this->button(QWizard::BackButton)->setGeometry(rect.x(), rect.y(), rect.width(), 40);
}
Wizard::~Wizard()
{
delete ui;
}
这段代码什么都不做。是否可以更改按钮的几何形状?还是被禁止?
谢谢