Results 1 to 5 of 5

Thread: setMainWidget

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2008
    Location
    Morocco
    Posts
    47
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default setMainWidget

    Peace..
    hey ..
    I try to compile a simple qt programm whch I found in a tuto .. but I get the following error >> 'class QApplication' has no member named 'setMainWidget'
    Qt Code:
    1. #include <QApplication.h>
    2. #include <qpainter.h>
    3. #include <qlabel.h>
    4. #include <qpixmap.h>
    5. #include <qpaintdevice.h>
    6. void Dessiner(QPaintDevice * dev)
    7. { }
    8. int main (int argc, char* argv[])
    9. {
    10. QApplication app(argc, argv) ;
    11. QPixmap pix(300, 200) ;
    12. Dessiner(&pix) ;
    13. QLabel label(0) ;
    14. label.setPixmap(pix) ;
    15. app.setMainWidget(&label) ;
    16. label.show() ;
    17. return app.exec() ;
    18. }
    To copy to clipboard, switch view to plain text mode 
    so is setMainWidget a member of QApplication class ??
    plz help
    Last edited by wysota; 10th March 2008 at 21:51. Reason: missing [code] tags

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.