Results 1 to 2 of 2

Thread: Qt vs Delphi TApplicationEvents

  1. #1
    Join Date
    Sep 2009
    Location
    Las Vegas, Nevada - USA
    Posts
    12
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Qt vs Delphi TApplicationEvents

    In Delphi we have a TApplicationEvent component that if an when your application is Idle you can do processing. The best example is:

    Let's say you have a button that is Enabled or Disabled based on data entered. If the data is invalid the button is disabled and when data becames valid you enable the button. But this check is only done when the application sends a IdleEvent.

    So does Qt have such a event handler?

    I thought it might be on the main form but I did not see it, or maybe I just not looking in the right place.

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

    Default Re: Qt vs Delphi TApplicationEvents

    In Qt we tend to do something like this using signals and slots. The most straightforward way is to create a signal "dataValidChanged(bool)" and connect it to "setEnabled(bool)" slot of the button. Whenever validity of the data changes, you emit the signal and the button gets enabled or disabled properly. No need to do any periodic checks.

    As for idle processing, this is usually done by using a timer with a 0 timeout. You can read a bit about it for example here: http://doc.trolltech.com/qq/qq27-res...blemstepbystep
    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. Delphi and Qt4
    By dellegi in forum Qt Programming
    Replies: 0
    Last Post: 22nd April 2009, 16:28
  2. Qt us Builder and Delphi
    By zlatko in forum General Discussion
    Replies: 3
    Last Post: 8th May 2006, 09:08

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.