Results 1 to 3 of 3

Thread: interface GUI die when run some " while() do "

  1. #1

    Default interface GUI die when run some " while() do "

    Hi

    I made some functions in which I used some " while () { .. }".

    When the programe started, the GUI died , howerver the others applications worked well ( a bit slow but worked ).

    I know I have to use moveToThread, I wrote some functions but they didn't work

    Have you got any idea? Thanx a lot

    Qt Code:
    1. Class QThreadEX:public QThread
    2. {
    3. Q_OBJECT
    4. ....
    5. protected:
    6. void run(){ exec();}
    7. }
    To copy to clipboard, switch view to plain text mode 
    File ui:
    Qt Code:
    1. void test_thread:: on_pushButton_clicked(){
    2. QThreadEx * confThread = new QThreadEx()
    3. config conf;
    4.  
    5. confThread->start;
    6. conf.moveToThread(confThread);
    7.  
    8.  
    9.  
    10. connect(confThread, SIGNAL(started()),conf, SLOT(conf.test());
    11.  
    12. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by azerty_fr; 14th June 2007 at 10:02.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: interface GUI die when run some " while() do "

    The slot connection is incorrect. Should be "SLOT(test())" and not "SLOT(conf.test())". Furthermore you create "conf" on the stack, so it is destroyed once the function returns.

  3. #3

    Default Re: interface GUI die when run some " while() do "

    I've already completed it with success . Thanx anyway

Similar Threads

  1. broadcast ip interface on windows xp
    By pawer in forum Qt Programming
    Replies: 14
    Last Post: 19th May 2007, 15:49
  2. multiple page linear interface
    By ahkv9 in forum Qt Programming
    Replies: 3
    Last Post: 17th April 2007, 19:44
  3. Interface composition and QObject
    By brcain in forum Qt Programming
    Replies: 9
    Last Post: 20th November 2006, 17:56
  4. User Interface with QTableView
    By Brandybuck in forum Qt Programming
    Replies: 1
    Last Post: 22nd March 2006, 23:24
  5. Qt interface running extremely slowly...
    By jazztpt in forum Qt Programming
    Replies: 1
    Last Post: 4th February 2006, 11:12

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.