#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow
::MainWindow(QWidget
*parent
) :
QMainWindow(parent
),
ui(new Ui
::MainWindow
)
{
ui
->setupUi(this);
main_window
=this->geometry().width();
widget_window
=ui
->widget
->geometry().width();
this->setFixedWidth(main_window
-widget_window
);
isshoweidget
=false ;
ui
->widget
->hide();
}
MainWindow
::~MainWindow()
{
delete ui
;
}
void MainWindow
::on_pushButton_clicked()
{
if (isshoweidget
==false)
{
ui
->widget
->show();
ui
->pushButton
->setText("<<");
this->setFixedWidth(main_window
);
isshoweidget
=true;
}
else
{
ui
->widget
->hide();
ui
->pushButton
->setText(">>");
this->setFixedWidth(main_window
-widget_window
);
isshoweidget
=false;
}
}
ui界面
转载请注明原文地址: https://mac.8miu.com/read-502717.html