Hi All
I have a small issue where I need to resize the mainwindow using the checkbox. My environment is Linkat( linux) and Qt.
Issue is when I check the checkbox, the window resizes to the size given in isFloating(), but when I uncheck the box, it does not return to isDocked() size
The default size is isDocked();
In the MainWindow class , I have the following code
MainWindow.h
/************************************************** ********/
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow();
~MainWindow();
public slots:
void isDocked();
void isFloated();
public:
Qt::CheckState state;
QCheckBox *m_CheckBox;
}
/************************************************** **/
MainWindow.cpp
/************************************************** ****/
MainWindow::MainWindow()
{
m_CheckBox = new QCheckBox(this);
m_CheckBox->setGeometry(20,460,270,700);
state = Qt::Unchecked;
connect(m_CheckBox,SIGNAL(clicked()),this,SLOT(isD ocked()),Qt::AutoConnection); connect(m_CheckBox,SIGNAL(clicked()),this,SLOT(isF loated()),Qt::AutoConnection);
}
void MainWindow::isDocked()
{
this->setGeometry(20,460,270,700);
state = Qt::Checked;
}
void MainWindow::isFloated()
{
this->setGeometry(0,0,766,566);
state =Qt::Unchecked;
}
Bookmarks