Results 1 to 6 of 6

Thread: how to set wait condition

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: how to set wait condition

    Note my earlier reply
    Quote Originally Posted by Santosh Reddy
    I hope, you know how to use signals and slots
    You get an error because you don't know how to use signals & slots (Don't feel bad). I will try to explain a bit, you should be reading a good book or Qt Documentation at-least.

    Following points are what you missed
    - main() is a global function, it does not have a object instance of itself, so you cannot use this pointer in main() (it's basic C++, nothing to do with Qt), this is very reason you have an error.
    - A slot has to a member function of a class which is either directly or indirectly derived from a QObject, i.e SLOT cannot be a global function (which is a problem in you case)
    - You are creating 27 (3 x 9) timers, you should be creating only one timer, and each time the timer slot is called then create a balloon.

  2. #2
    Join Date
    Apr 2011
    Posts
    36
    Thanks
    3
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to set wait condition

    sir,

    i know that 'this' can not be used in main function.

    my app is to produce 26 ballons with A-Z as text . ballon,GraphicsItem should be viewed in GraphicsScene with a time gap.

    how can i achieve this?

    i have to call ballon constuctor with random character as input in main.cpp.

    regards,
    hema

  3. #3
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: how to set wait condition

    Ok, there are many ways, i just give one example to do so. Refer the sample example, I tried to create from your inputs, check it out
    Attached Files Attached Files

  4. The following user says thank you to Santosh Reddy for this useful post:

    hema (25th July 2011)

Similar Threads

  1. Using an If condition in a QML delegate?
    By technoViking in forum Qt Quick
    Replies: 8
    Last Post: 25th August 2011, 05:26
  2. don`t work Condition...
    By Resager in forum Newbie
    Replies: 1
    Last Post: 6th May 2011, 18:18
  3. QFileDialog custom acceptance condition
    By akos.maroy in forum Qt Programming
    Replies: 3
    Last Post: 4th April 2011, 12:35
  4. How can i terminate a delay / wait condition
    By asinghma in forum Qt Programming
    Replies: 1
    Last Post: 22nd February 2011, 14:41
  5. Sleep condition in QT
    By santhoshv84 in forum Qt Programming
    Replies: 1
    Last Post: 18th July 2008, 12:07

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.