|
QT5中让如何让窗口上的控件进行重绘,问题是这样的我在窗口上添加了两个按钮控件分别为MAX何MIN,当单击MAX时窗口可以在变大一点 再次点击MAX上窗口还原到原来大小。代码如下
testFace::testFace(QWidget *parent)
: QWidget(parent)
{
ui.setupUi(this);
connect(ui.faceButton, SIGNAL(clicked()), this, SLOT(on_cliked_faceButton()));
connect(ui.minButton, SIGNAL(clicked()), this, SLOT(on_cliked_minButton()));
max = false;
}
testFace::~testFace()
{
delete facewnd;
}
void testFace::on_cliked_faceButton()
{
if(max == false)
{
this->resize(465 , 706);
max = true;
}
}
void testFace::on_cliked_minButton()
{
if(max == true)
{
this->resize(465 , 289);
max = false;
}
}
功能可以实现 但在此窗口上的两个textEdit没有进行重绘 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|