Results 1 to 2 of 2

Thread: broken QIcon (from QPainter) in VS2010 Release

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2011
    Posts
    21
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default broken QIcon (from QPainter) in VS2010 Release

    For the following code I get a nice icon in debug but a wrong icon in release mode. It is a stripped version originating in a QAbstractItemModel application.

    Windows XP, Qt 4.8.4, Visual Studio 2010

    Debug:Icon1.png

    Release: Icon2.png

    Thank you!

    Qt Code:
    1. #include <QApplication>
    2. #include <QPainter>
    3. #include <QMainWindow>
    4.  
    5. QIcon icon() {
    6. QPixmap Icon(16,16);
    7. QPainter Painter(&Icon);
    8. Painter.drawLine(0,7,15,7);
    9. return Icon;
    10. }
    11.  
    12. int main(int argc, char *argv[]) {
    13. QApplication Application(argc, argv);
    14. QMainWindow Window;
    15. Application.setWindowIcon(icon());
    16. Window.show();
    17. return Application.exec();
    18. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Mar 2011
    Posts
    21
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: broken QIcon (from QPainter) in VS2010 Release

    Doc: Warning: This will create a QPixmap with uninitialized data. Call fill() to fill the

Similar Threads

  1. Help, How to Static Linking Qt 5.0.2 (latest release) VS2010
    By elmasmalo1 in forum Installation and Deployment
    Replies: 0
    Last Post: 13th April 2013, 00:53
  2. Broken Qt
    By hakermania in forum Installation and Deployment
    Replies: 7
    Last Post: 9th September 2010, 08:02
  3. QGraphicsGridLayout Broken
    By oberlus in forum Qt Programming
    Replies: 1
    Last Post: 27th August 2010, 10:32
  4. Qt4.3 broken by Qt4.4
    By bnilsson in forum Installation and Deployment
    Replies: 2
    Last Post: 4th January 2008, 11:41
  5. Replies: 2
    Last Post: 31st May 2006, 21:52

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
  •  
Qt is a trademark of The Qt Company.