Unsolved QFileDialog Error
-
@saitej
Hi,'Yes, the dialog shows up in full screen and also I am unable to resize it from the bottom
It sounds like the event loop is blocked. I don't see how that might be happening from your snippet, but perhaps you could post the rest of the code - the whole method and how it's called?
Kind regards.
-
did you try to use the debug mode for track errors and see variables instances ?
Is your two differents projects has same files contents (or the second project is just a test case maybe ?). If this two projects are new, then use a tool for compare files contents to show differences appears.
then... you could also try to use valgrind tool from qtcreator. -
Mainwindow.cpp
QAction *loadfile = new QAction("Load File",this); ui->menuWidgets->addAction(loadfile); connect(loadfile, SIGNAL(triggered(bool)),this,SLOT(onLoadfile()));
void MainWindow::onLoadfile(){ QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"),QDir::homePath() , tr("Kml Files (*.kml)")); qDebug() << "Loading File"<< fileName; QFile file( fileName ); if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) return; }
-
Hi guys
I have boiled down the error to a line which when commented the filedialog works but I don't see any reason how that line is effecting the filedialog. I will need that line in my project so if someone can tell me how it is affecting the filedialog, It will be very helpful.
Thanks
ui->sideLayout->addWidget(wid1,Qt::AlignBottom);
This line adds a widget to the sidelayout which is a vertical layout added in the mainwindow.ui file through the designer.
Note: There are other layouts along with the side layout but they are not influencing
-
hi
That is like epic strange.
What type is wid1 ? -
:)
It's a custom class widget to display variables on real time -
@saitej
Just for test.
Could you try with a normal QpushButton for wid1 just to see if
it was something to do with the actual widget.
My brain cannot find any reason that a layout should do stuff to a dialog.?! -
Ya. I think something is wrong in the custom class that is influencing the filedialog.
-
@saitej
Hmm, im dying to know what that can be since
its hard to imagine other class affecting a dialog that way.
:) -
its hard to imagine other class affecting a dialog that way.
All classes share the event loop, so that's why I mentioned it earlier.
-
Any insight on what probably could have blocked the event loop?
-
@saitej
It might not be blocked, but from what I can see on the screen and from the description of the problem (and where it's occurring) that's my suspicion. Anyway, the most common cause I suppose would be loops (endless ones mostly) and recursive events. Do you mind sharing the widget in question, or its paint/resize event implementation at least?