[Interest] QFileDialog: what's wrong with this minimal example
Wilhelm
wilhelm.meier at fh-kl.de
Mon Jan 21 19:33:03 CET 2013
Hi all,
if I compile this stripped down minimal example
-------------
#include <QApplication>
#include <QFileDialog>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QFileDialog fd(0, "Load from file",
QDir::currentPath(),
"All Files (*)");
// return a.exec();
}
---------------
I get the following run-time error:
QObject: Cannot create children for a parent that is in a different thread.
(Parent is QFileSystemWatcher(0x1770be0), parent's thread is
QThread(0x1734420), current thread is QFileInfoGatherer(0x1791c58)
It is compiled with QT5.0.0 and g++ (GCC) 4.8.0 20130113 (experimental):
make[2]: Entering directory
`/home/lmeier/Software/qtwm/trunk/apps/apps5-build-QT5-Debug/test/test4'
g++ -c -m64 -pipe -g -Wall -W -D_REENTRANT -fPIE -DQT_WIDGETS_LIB
-DQT_GUI_LIB -DQT_CORE_LIB
-I/opt/Qt5.0.0/5.0.0/gcc_64/mkspecs/linux-g++-64
-I../../../apps5/test/test4 -I/opt/Qt5.0.0/5.0.0/gcc_64/include
-I/opt/Qt5.0.0/5.0.0/gcc_64/include/QtWidgets
-I/opt/Qt5.0.0/5.0.0/gcc_64/include/QtGui
-I/opt/Qt5.0.0/5.0.0/gcc_64/include/QtCore -I. -I. -o main.o
../../../apps5/test/test4/main.cc
make[1]: Entering directory
`/home/lmeier/Software/qtwm/trunk/apps/apps5-build-QT5-Debug/lib'
make[1]: Nothing to be done for `first'.
make[1]: Leaving directory
`/home/lmeier/Software/qtwm/trunk/apps/apps5-build-QT5-Debug/lib'
g++ -m64 -Wl,-rpath,/opt/Qt5.0.0/5.0.0/gcc_64
-Wl,-rpath,/opt/Qt5.0.0/5.0.0/gcc_64/lib -o test4 main.o
-L/usr/X11R6/lib64 -L/opt/Qt5.0.0/5.0.0/gcc_64/lib -lQt5Widgets -lQt5Gui
-lQt5Core -lGL -lpthread
--
Wilhelm
More information about the Interest
mailing list