In case it sheds any light on the problem for anyone here are my two source files (as simple as they get):
Class declaration
#include "ui_ppdl_dialogMissingFiles.h"
#include <QString>
#include <QDebug>
class PpdlDialogMissingFiles
: public QDialog,
public Ui
::PpdlDialogMissingFiles { Q_OBJECT
public:
PpdlDialogMissingFiles
( QWidget *parent
= 0,
const QString &bodyhtml
= "" );
~PpdlDialogMissingFiles( );
private:
QString html;
// build string for preparing QTextEdit html
};
#include "ui_ppdl_dialogMissingFiles.h"
#include <QString>
#include <QDebug>
class PpdlDialogMissingFiles : public QDialog, public Ui::PpdlDialogMissingFiles {
Q_OBJECT
public:
PpdlDialogMissingFiles( QWidget *parent = 0, const QString &bodyhtml = "" );
~PpdlDialogMissingFiles( );
private:
QString html; // build string for preparing QTextEdit html
};
To copy to clipboard, switch view to plain text mode
Class implementation
#include "ppdl_dialogMissingFiles.h"
#include <QTextStream>
// constructor
PpdlDialogMissingFiles
::PpdlDialogMissingFiles ( QWidget * parent,
const QString &bodyhtml
):QDialog ( parent
){
setupUi ( this );
// wrap the passed body text in HTML framework
QTextStream ( &html
) <<
"<html><head></head><body>" << bodyhtml <<
"</body></html>";
// display the content provided to us
textEdit->setHtml ( html );
}
// destructor
PpdlDialogMissingFiles::~PpdlDialogMissingFiles ( )
{
// nothing for now
}
#include "ppdl_dialogMissingFiles.h"
#include <QTextStream>
// constructor
PpdlDialogMissingFiles::PpdlDialogMissingFiles ( QWidget * parent, const QString &bodyhtml ):QDialog ( parent )
{
setupUi ( this );
// wrap the passed body text in HTML framework
QTextStream ( &html ) << "<html><head></head><body>" << bodyhtml << "</body></html>";
// display the content provided to us
textEdit->setHtml ( html );
}
// destructor
PpdlDialogMissingFiles::~PpdlDialogMissingFiles ( )
{
// nothing for now
}
To copy to clipboard, switch view to plain text mode
Invocation from app that encounters exec() block failure (returns immediately with '0')
// missingFilesAdvisory is a populated QString
// also no change when parented to app QMainWindow instead of '0'
PpdlDialogMissingFiles *dialogMissingFiles = new PpdlDialogMissingFiles ( 0, missingFilesAdvisory );
// returns Yes (Proceed) = 1, No (Do not proceed) = 0
int proceed = dialogMissingFiles->exec ( );
// missingFilesAdvisory is a populated QString
// also no change when parented to app QMainWindow instead of '0'
PpdlDialogMissingFiles *dialogMissingFiles = new PpdlDialogMissingFiles ( 0, missingFilesAdvisory );
// returns Yes (Proceed) = 1, No (Do not proceed) = 0
int proceed = dialogMissingFiles->exec ( );
To copy to clipboard, switch view to plain text mode
Other custom dialogs of similar design working fine. This working fine in a test app. Fails in my main app. What am I not seeing?
Thanks to all,
Bill
Bookmarks