Results 1 to 9 of 9

Thread: The show() method...

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Location
    Finland /Pakistan
    Posts
    216
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    20
    Thanked 1 Time in 1 Post

    Default The show() method...

    Hi,
    I have written a program in which i have implemented Graphics View Framework..the output is there and it s perfect ,but the problem is that i have written the command of show() in my class constructor while in the main where i have instantiate the object of that class ,the

    show() shows an empty screen...

    but i think its the common and good practice to put show() command in the main

    In Conctsructor It work fine

    Qt Code:
    1. TrainingUI::TrainingUI(QGraphicsView *parent):QGraphicsView(parent)
    2. {
    3. ..
    4. view.setScene(scene);
    5. view.show(); // WORKS FINE HERE
    6. ..
    7. }
    To copy to clipboard, switch view to plain text mode 


    But in Main it shows an empty screen

    Qt Code:
    1. #include "trainingui.h"
    2. int main(int argc, char *argv[])
    3. {
    4. QApplication a(argc, argv);
    5. TrainingUI w;
    6. w.show(); // EMPTY SCREEN
    7. return a.exec();
    8.  
    9. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by jpn; 17th June 2008 at 10:23. Reason: missing [code] tags

Similar Threads

  1. Looking for a method to show several images
    By harakiri in forum Newbie
    Replies: 3
    Last Post: 26th June 2007, 11:57
  2. Creating object of other class in Run() method
    By santosh.kumar in forum Qt Programming
    Replies: 2
    Last Post: 15th May 2007, 16:05
  3. Calling Recursivly loading function in Run() method of QThread
    By santosh.kumar in forum Qt Programming
    Replies: 2
    Last Post: 15th May 2007, 15:42
  4. Replies: 4
    Last Post: 10th March 2007, 19:01
  5. QtSingleApplication
    By mule in forum Qt Programming
    Replies: 8
    Last Post: 28th February 2006, 20:21

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.