Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Problem with window/widget size
never_ever last edited by
I have mainWindow (that inherits by QMainWindow), and I have second class that inherits by QWidget and it is invoked by first class.
In second window I have QGraphicsView. In second class I need to use QGraphicsView size (ui.graphicsView()->size()), but this size depends on the place where I write
secondWindow = new SecondWindow();
newWindow = new MyClass();
fileName = QFileDialog::getOpenFileName(this,
tr("Open file"), QDir::homePath(), tr("File TXT (*txt)"));
//newWindow = new MyClass();
When I write it in first place the second window shows before I choose file to open and I don't want that. I want that it will open after I choose the file. But when I write it in second place I get wrong size of QGraphicsView widget (size of not maximized window).
Any idea why it happens in that way? Maybe I