Results 1 to 4 of 4

Thread: my first qt application, everythings ok, but background image get nothing. help me!!!

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2011
    Posts
    2
    Qt products
    Qt4 Qt/Embedded
    Thanks
    2

    Unhappy my first qt application, everythings ok, but background image get nothing. help me!!!

    Qt Code:
    1. #include <QtGui>
    2.  
    3. int main(int argc, char** argv){
    4. QApplication apps(argc, argv);
    5. apps.setApplicationName("Application Demo");
    6.  
    7. QPalette palette;
    8. palette.setBrush(QPalette::Window, QBrush(QPixmap("demo.jpg")));
    9.  
    10. wnds.setAutoFillBackground(true);
    11. wnds.setWindowTitle("QMainWindow Demo");
    12. wnds.setWindowFlags(wnds.windowFlags() & ~Qt::WindowMinimizeButtonHint & Qt::FramelessWindowHint);
    13. wnds.setPalette(palette);
    14. wnds.statusBar()->showMessage("StatusBar Ready");
    15. wnds.resize(800,600); // pixmap.size()
    16. wnds.show(); // wnds.showMaximized();
    17.  
    18. return apps.exec();
    19. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by Lykurg; 24th December 2011 at 17:14. Reason: missing [code] tags

Similar Threads

  1. Replies: 0
    Last Post: 5th April 2011, 14:36
  2. Replies: 1
    Last Post: 25th June 2010, 19:31
  3. Background image in an application
    By halvors in forum Qt Programming
    Replies: 1
    Last Post: 1st April 2010, 12:27
  4. No Background Image on Example
    By igor in forum Qt Programming
    Replies: 3
    Last Post: 19th January 2007, 13:41
  5. [QT4.1.1 XP] background image
    By incapacitant in forum Newbie
    Replies: 3
    Last Post: 1st March 2006, 14:02

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.