Results 1 to 14 of 14

Thread: QThread and QProcess problem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2007
    Posts
    76
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QThread and QProcess problem

    i was reading the background of how to implement the communication between queue and the playlist...
    i thought to code like that
    Qt Code:
    1. update()
    2. {
    3. // do the stuff with playlist and the queue
    4. update();
    5. }
    To copy to clipboard, switch view to plain text mode 
    or am i missing something?

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QThread and QProcess problem

    Of who's update are you talking about? The list box?

    I was thinking more like: you have a list of songs( QList, whatever). This should behave like an external model for the list box. That is when you add an item, you update the list, and as a result of this the widget will get updated also.

    You should have a few functions for accessing the list's contents.
    Reading and writing to the list should be guarded with a mutex.

    You also could add a remove item function which you *call* from the thread when the current song ends. By call I mean emitting a signal from the thread.

    But I guess there are other methods. You should choose the one that feels more scalable to you, since I assume your application is just at its beginning, and it will get more complex.

    Regards

  3. #3
    Join Date
    Apr 2007
    Posts
    76
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QThread and QProcess problem

    I was talking about the update of the main widget but i haven't thought about the signal and slot way of communication...
    i haven't worked with that (excluding the tutor of course) so i'll try it... something new to experiment. it sounds interesting.

  4. #4
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QThread and QProcess problem

    This is the way it is recommended to be done in Qt4. Should work in 3 also.

    BTW, why don't you switch to v4? It has a lot of new things...Can't even be compared to 3.

    Regards

  5. #5
    Join Date
    Apr 2007
    Posts
    76
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QThread and QProcess problem

    i really don't know. i haven't read the specification for the minimum HW that it works on??
    i have a 900 MHz Duron and 512 MB RAM
    at my job i have a 3GHz and 1GB RAM and working with vs2005 and it is slow!

  6. #6
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QThread and QProcess problem

    Quote Originally Posted by codebehind View Post
    i really don't know. i haven't read the specification for the minimum HW that it works on??
    i have a 900 MHz Duron and 512 MB RAM
    at my job i have a 3GHz and 1GB RAM and working with vs2005 and it is slow!
    Slow in what way? When you compile Qt4 apps? I think it can't get better than that.
    My last Qt project( at work ), was taking about 15-20 minutes to compile, on a similar computer( 3ghz, 2gb mem). But it was pretty big.

    Ultimately your application's requirements dictate the resources to use.
    Qt4 is in many ways faster than 3.


    Regards

  7. #7
    Join Date
    Apr 2007
    Posts
    76
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QThread and QProcess problem

    slow in the way of working with it! a few open windows and let say two studios and explorer and IBrowser (Firefox), task manager and a DB Tool (AQT) and MicrosoftExchange... and it needs some time to change between app. That i mean for slow. compile time is fast in front of switching betwin app.

    anyway i started to download Qt4, will see!

  8. #8
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QThread and QProcess problem

    Why separate thread? Usually there is no need to execute an external process in a separate thread because it doesn't block anyhow.
    J-P Nurmi

Similar Threads

  1. Replies: 4
    Last Post: 27th July 2006, 11:13
  2. QProcess in a QThread
    By chombium in forum Qt Programming
    Replies: 2
    Last Post: 11th January 2006, 15: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.