How to resize the main window again after setFixedSize
Unsolved
General and Desktop
-
In my code I set fixed size for main window If i open .mp3 file,now I need to resize main window if i open another file format. how to enable resize if I open any other file format
this is my code.
void MainWindow::on_actionOpen_triggered() { QString filename= QFileDialog::getOpenFileName(this,"Open Folder","","Open a File(*.*)"); on_actionStop_triggered(); player->setMedia(QUrl::fromLocalFile(filename)); on_actionPlay_triggered(); if(filename.endsWith(".mp3")){ qDebug() << " file is mp3"; this->setFixedSize(648,425); }else{ this->setFixedSize(this->sizeHint()); //this not working. } }
-
Hi
It does work. check your values :)just tested this
ctor { ui->setupUi(this); setFixedSize(300,300); } void MainWindow::on_pushButton_released() { setFixedSize(500,500); }
and it goes to 500x500 when i click