Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QPrintDialog::exec returns QDialog::Rejected immediatly in Windows, not in Lubuntu



  • I wrote a simple example program for QPrinterDialog:

    @
    void QtDialog::on_button_clicked()
    {
    QPrinter printer;

    const boost::shared_ptr<QPrintDialog> print_dialog(
    new QPrintDialog(&printer));
    if (print_dialog->exec() != QDialog::Accepted)
    {
    return;
    }
    }
    @

    Under the Linux distribution Lubuntu this works as expected. When crosscompiling the code with MXE to Windows, QPrintDialog::exec returns QDialog::Rejected immediatly when running it with Wine.

    1. Who has an idea what causes QPrintDialog::exec to return QDialog::Rejected immediatly?
    2. Is the problem in (a) Qt5 (b) the MXE crosscompiling environment (c) Wine. If (b) or (c), sorry for posting at the wrong forum :)

    Linux distribution: Lubuntu 13.04 (raring)
    IDE: Qt Creator 2.7.0
    C++ standard: C++98
    Compiler (Lubuntu): G++ 4.7.3
    Compiler (MXE): G++ 4.8.1
    Libraries used (Lubuntu): Qt: version 5.0.1 (32 bit)
    Libraries used (MXE): Qt: version 5.0.1 (32 bit)
    Wine: 1.4.1

    Full code and project download at http://richelbilderbeek.nl/CppQPrintDialogExample1.htm . I would be curious if the code would work well under native Windows...


Log in to reply