Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
Difficulty: 2/10
Date added: 14th of October 2012
In this exercise I will show an error I have wrestled with for some weeks, with the goal to prevent you having the same trouble. I will assume some basic Qt knowledge.
I desired to have the following program flow:
I want to hide the first dialog when showing the second dialog. This prevent the user from needlessly seeing the older dialog.
Also note that the program returns an exit code of zero, which denotes that the program ended without an error.
The code shown below, however, ends the program when pressing 'Back to first'. Why?
The solution can really be found in the code shown.
Note that the -from my point of- unexpected behavior is actually the expected behavior, according to this bug report.
QT += core gui |
#ifndef FIRSTDIALOG_H |
#include "seconddialog.h" |
#include <QtGui/QApplication> |
#ifndef SECONDDIALOG_H |
#include "seconddialog.h" |
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.
This page has been created by the tool CodeToHtml