Hiding parts of QDialog
-
I changed from Qt 4.8.4 to 5.0.2, when I execute my application I get a warning about setGeometry: violating constraints of window,but the code doesnt even use setGeometry. The idea is that when I click a certain button parts of my dialog should hide, and the dialog size should change to suit the needs of the remaining contents. PLEASE HELP
Here is the code,its actually a custom slot:
@
void KeyBoardDialog::showHideKeyboard(){
if(ui->MainFrame->isVisible()){
ui->MainFrame->hide();
this->setFixedHeight(this->height()-320);
ui->pushButtonHideKeyBoard->setText("Show Keyboard");
}else { ui->MainFrame->show(); this->setFixedHeight(this->height()+320); ui->pushButtonHideKeyBoard->setText("Hide Keyboard"); }
}
@ -
welcome to devnet
I have added code tags for increased readability. Please check out the "forum guidelines":http://qt-project.org/wiki/ForumHelp#e3f82045ad0f480d3fb9e0ac2d58fb01 and use code tags next time.
-
maybe this may help you:
@
this->setFixedSize( QLayout::closestAcceptableSize ( this, this->size()-QSize(0,320) ) );
@