Results 1 to 3 of 3

Thread: Strange QPrintDialog behavior on my machine

  1. #1
    Join Date
    Dec 2009
    Location
    Kiev, Ukraine
    Posts
    16
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Strange QPrintDialog behavior on my machine

    Hi, help me please with my problem: listed code from main.cpp work in strange case, if line "splash.show();" commented it work right, but if it is not commented QPringDialog window can't be closed it any way: all buttons responding on my clicks but nothing more not happened. Mac OS X 10.6.6 Qt 4.7.4


    Qt Code:
    1. #include <QApplication>
    2. #include <QPrintDialog>
    3. #include <QPrinter>
    4. #include <QSplashScreen>
    5.  
    6. int main(int argc, char *argv[])
    7. {
    8. QApplication app(argc, argv);
    9. QSplashScreen splash;
    10. splash.show();
    11.  
    12. QPrinter printer(QPrinter::HighResolution);QPrintDialog dialog(&printer);dialog.exec();
    13. return app.exec();
    14. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Sep 2011
    Location
    Buenos Aires
    Posts
    9
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Strange QPrintDialog behavior on my machine

    i'm using the splash screen too, but I use it like this.

    Qt Code:
    1. int main(int argc, char** argv) {
    2. QApplication app(argc, argv);
    3.  
    4. QPixmap pixmap("./images/splash.png");
    5. QSplashScreen splash(pixmap);
    6. splash.show();
    7. app.processEvents(); // this is to allow the procesing of mouse clicks over the splash to close it
    8.  
    9. // some more code
    10.  
    11. MainWindow win;
    12. win.resize(1024, 768);
    13. win.show();
    14. splash.finish(&win); // this finishes the splash when the program finished loading.
    To copy to clipboard, switch view to plain text mode 

    Check the way i'm using the splash, I'm inclined to think that the app.processEvents(); is key to your problem.

  3. #3
    Join Date
    Dec 2009
    Location
    Kiev, Ukraine
    Posts
    16
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Strange QPrintDialog behavior on my machine

    after some more investigation i understand that it is something wrong in my environment because it works at other developer machine. that is not Qt problem but i cant understand why cocoa dialog works wrong way...

Similar Threads

  1. QSqlDatabase strange behavior
    By macav in forum Qt Programming
    Replies: 1
    Last Post: 9th February 2011, 15:21
  2. Strange behavior of QSqlTableModel
    By venomj in forum Qt Programming
    Replies: 0
    Last Post: 13th January 2010, 03:29
  3. QComboBox strange behavior
    By Antebios in forum Newbie
    Replies: 2
    Last Post: 31st March 2009, 23:50
  4. Strange resize behavior
    By Lykurg in forum Newbie
    Replies: 3
    Last Post: 9th January 2007, 13:56
  5. scrollbars strange behavior
    By siniy in forum Qt Programming
    Replies: 6
    Last Post: 29th December 2006, 10:27

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.