Results 1 to 6 of 6

Thread: New here, old thread...

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2009
    Posts
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default New here, old thread...

    Well, first, sorry about the poor english (I do speak portuguese so...)...
    So now, I'm a newbie with Qt, but I'm trying to do a little project with this...
    Talking a little about the project: it's a process simulator (with politics like FIFO, STF, ...), and if I'm righ I will need three threads to implement what I want:

    - The user can control process;
    - The processing "animation" (some list showing the status of queues and the id of the process that is running);
    - And the processing ...

    If I'm in the wrong way please tell me hehe...

    So, the first problem which I need some help is, what's the way to implement something like a counter number? But instead is the ID of the process that is running...
    I'm using a line_edit to show the numbers but I can use anything that you guys recommend LOL...
    I can show the number of the process, but not "animated" or counting you know?...

    Well again sorry, and any help will be so much appreciate.
    []'s Cya!

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

    Default Re: New here, old thread...

    You don't need three threads. One will be sufficient.

    Try expressing your problem more clearly, I admit I can't understand what your problem is.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    May 2009
    Posts
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: New here, old thread...

    So... talking about the program:
    - A mainwindow with some buttons (create process, block, unblock, kill), haa and with an animated list of the process (not implemented and one of my problems and doubt).\
    - In the background I need to implement a function which will be executing the process createds by the users (with time slice, changes of process, etc.)...

    So[2] I my mind (tired mind hehe), I only think in threads to make this program work simultaneos (user view, lists` animation and the mainfunctions)... some guys talk me about timers but I still not see how It could help me...

    So[3], the first step is, I really need use the QThreads? Second: when i tried to use the threads at Qt is like the view of user (create process, etc.) has stoped to the other loop in the ``thread`` execute... but I post the code here later, well, again, it`s a horrible english but help me lol !

    --

    Ah talking about the animation, what`s the way to make something like:
    char c;
    while(c<`z`)
    {
    ui->line_edit->setText(c);
    c++;
    }
    It`s works, but not like an animation hehe i mean how to show the `counter couting` to the user?and it`s what I need to know how to do... hmmm like a timer or something like this...

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

    Default Re: New here, old thread...

    Quote Originally Posted by felipealencar View Post
    - A mainwindow with some buttons (create process, block, unblock, kill), haa and with an animated list of the process (not implemented and one of my problems and doubt).\
    This one is easy, let's skip that for now.

    - In the background I need to implement a function which will be executing the process createds by the users (with time slice, changes of process, etc.)...
    You will need QProcess for this.

    So[2] I my mind (tired mind hehe), I only think in threads to make this program work simultaneos (user view, lists` animation and the mainfunctions)... some guys talk me about timers but I still not see how It could help me...
    You can use timers for animation so that you have constant frame rates but apart from that you probably won't need neither timers nor threads.

    So[3], the first step is, I really need use the QThreads?
    No, you don't. Unless you will be using some solutions where you can't avoid blocking the main thread.

    Ah talking about the animation, what`s the way to make something like:
    char c;
    while(c<`z`)
    {
    ui->line_edit->setText(c);
    c++;
    }
    It`s works, but not like an animation hehe i mean how to show the `counter couting` to the user?
    How about using QProgressBar or QProgressDialog?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    May 2009
    Posts
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: New here, old thread...

    Huhuhu.. the QTimer makes what I want, ...

    But now, how it's a process simulator, you really think I will need to use QProcess? Because de "process" createds by the users will be only some nodes of one queue... If you could give me more details about that I appreciate again...

    Ahh backing to the QTimer, it's execute the 'slot function' in times and times right?!

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

    Default Re: New here, old thread...

    No, I thought you meant a process in terms of the operating system. If you just mean a procedure, then you might need threads (if you want to run more than one at the same time).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. GUI and non-GUI thread problem
    By dimaz in forum Qt Programming
    Replies: 3
    Last Post: 18th September 2008, 21:25
  2. Replies: 5
    Last Post: 17th January 2008, 21:49
  3. Thread, Timer and Socket. Comuication problem
    By ^NyAw^ in forum Qt Programming
    Replies: 6
    Last Post: 17th January 2008, 16:48
  4. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  5. Problem closing a QMainWindow in Qt4.2
    By ian in forum Qt Programming
    Replies: 11
    Last Post: 17th October 2006, 00:49

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.