I put QwtPlot in QTabWidget, then QMainWindow::showMaximized when construct MainWindow doesn't fill the whole screen. although it looks like Maximized by the Maximize button. Is there any way to solve this problem?
I put QwtPlot in QTabWidget, then QMainWindow::showMaximized when construct MainWindow doesn't fill the whole screen. although it looks like Maximized by the Maximize button. Is there any way to solve this problem?
You'll need to be a bit more forthcoming with details.
Did the main window not show maximized?
Did the tabwidget not fill the window?
Did the plot not fill the tabwidget?
Cheers,
_
Thank you for your reply. Details:
tt.jpgQt Code:
ui(new Ui::MainWindow) { ui->setupUi(this); tw->insertTab(0, pt, "pt"); bar->addWidget(detailLabel, 1); setCentralWidget(tw); showMaximized(); }To copy to clipboard, switch view to plain text mode
Last edited by anda_skoa; 24th March 2015 at 04:49. Reason: fixed code tag
Do you do anything with the main window instance other than creating it?
Cheers,
_
No. I just modified the MainWindow construct method code as above. I use qt 5.4.0.
Ok, just to verify: you are not calling show() on it in main(), right?
Because that is what gets usually generated by templates.
Cheers,
_
I call show() in main as below. To solve the problem, I create new project by templates and only just modify MainWindow::MainWindow.
Extra information: if not add statusbar, then everything ok. Or not add qwtplot tab, everything is ok too.Qt Code:
#include "mainwindow.h" #include <QApplication> int main(int argc, char *argv[]) { MainWindow w; w.show(); return a.exec(); }To copy to clipboard, switch view to plain text mode
So let me get this straight:
I asked you if you do anything else with the instance other than creating it.
You said you do not.
Now you say you do.
Why not call showMaximized() instead of hoping that the show() does not change the state you requested inside the window's constructor?
Luck based programming?
Cheers,
_
Thank you for your patient answer.
I tried showMaximized inside main() or remove show() in main, but it can't work too.
Hmm.
Have you tried without the
Cheers,
_
Bookmarks