c++ - QDialog remove title bar -
the net flooded similar questions, have seen nothing suits solve problem @ hand.
in qt-c++ app, have mainwindow form functions, there qpushbutton, pressing qdialog opens. now, functionalities in forms work fine, want final application without top title bar. i.e. no close / minimize / maximize button.
in main.cpp have done --
int main(int argc, char *argv[]) { qapplication a(argc, argv); mainwindow w; w.setwindowflags(qt::window | qt::framelesswindowhint); w.show(); return a.exec(); }
as result mainwindow has become -
for dialog.cpp window, have set -
dialog::dialog(qwidget *parent) : qdialog(parent), ui(new ui::dialog) { ui->setupui(this); //qdialog dialog(0, qt::customizewindowhint|qt::windowtitlehint); --- used also; no use qdialog dialog(0, qt::framelesswindowhint | qt::dialog);
but title bar of qdialog remains, looks -
where going wrong ??? ideas on how remove close button , title bar ???
i needed same thing question dialogs wanted border on dialog without window bar. solution quite simple. set dialog's flags qt::customizewindowhint:
dialog.setwindowflags(qt::customizewindowhint);
you can or specific flags further customize windows appearance noted in documentation.
Comments
Post a Comment