About the first problem, that's normal, since the documentation says: "Since the QApplication object does so much initialization, it *must* be created before any other objects related to the user interface are created."
QApplication is created in main() in most cases. Then, the GUI is created. Then, the main returns a->exec(). Could you post the code? Otherwise, check Qt examples about how to initialize an application. And if you have a segfault situation, this means the behavior is likely undefined. So making trivial changes, changing the compiler version, eating a pizza, and even doing nothing may change the code's behavior. Etienne 2013/9/11 Olivier BARTHELEMY <barthel...@geovariances.com> > I am having SEGFAULTS in some code just by making trivial changes that > should not influence the behaviour. > The code simply creates a QTextEdit in a QDIalog, and segfaults somewhere > in child calls of show() on the QDialog > Running valgrind, i noticed warnings about 'conditional jump or move > depending on uninitialized value'. Strangely, the warning has an almost > identical call stack than the segv. > The warning is apparently triggered because the class that builds the > QApplication and the dialog is a child of QObject, so the QObject > constructed before the QApplication must mess something up. Removing that > inheritance to QOBject, of manually creating the QApplication before > creating the class object removes the valgrind warning, but does not clear > the SEGV. > I have had some mixed success to remove the segv by trying multiple G++ > versions. Older G++ versions seem to crash less (no crash in 4.1, little > crashes in 4.4, almost always crash in 4.6), but the results are > inconsistent. It seems more like the difference of generated code triggers > more or less the error, but what is messed up is still there. > > People there (https://code.google.com/p/eiskaltdc/issues/detail?id=601) > and on some other sites (google 'QWidgetPrivate::create_sys conditional > jump' for example) have been having similar problems of either the warning > or the SEGV with call stacks indicating the same problem, but without > solution. > > Any suggestion? > > I'm using QT4.8.5 > > > -- > Olivier BARTHELEMY > > _______________________________________________ > Interest mailing list > Interest@qt-project.org > http://lists.qt-project.org/mailman/listinfo/interest > >
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest