Results 1 to 14 of 14

Thread: Direct connection in QML

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #8
    Join Date
    Feb 2013
    Location
    Prague
    Posts
    7
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Direct connection in QML

    If your objects live in different threads then having direct connections between them is a good first step to the end of the world.
    The objects which I connect directly live in the same thread. But the code is executed by a new QThread that I create. This thread acts as a realtime timer which triggers the execution of slots which emit signals and other slots and so. This object graph is defined by a custom XML at the moment. Take a look at the project's (beta) website. It might help you to understand what I am after.
    Qt does not bring any real-time guarantees. Regardless if you use direct connections or queued ones.
    Qt is only an application framework. The OS does bring real-time guarantees. I am using clock_nanosleep() kernel instruction in my C++/Qt timer code. It works great. My realtime part is not missing deadlines on sub-microsecond basis - but only if my modules (QObjects) are connected directly. With queued connections it doesn't even make sense to measure delays as you bring an extra queue in between my modules. That's why I need direct connections.

    It's as possible as exposing any other QML element. "Connections" is by no means different.
    The Connections object is used as this. See the following example:
    Qt Code:
    1. Connections {
    2. target: area
    3. onClicked: foo(parameters)
    4. }
    To copy to clipboard, switch view to plain text mode 
    Looking at the code above I can't see any way how to impact the connection type of clicked signal. I must be missing something. Should I inherit Connections class? I don't have problem with exposing a QML element. My problem is that the notation onSignal:slot always creates queued connection.

  2. The following user says thank you to mfojtak for this useful post:


Similar Threads

  1. Direct QwtPlot painting
    By ssample in forum Qwt
    Replies: 1
    Last Post: 23rd January 2013, 06:41
  2. Replies: 0
    Last Post: 11th November 2011, 19:18
  3. Replies: 1
    Last Post: 2nd April 2010, 06:42
  4. Qt + WINAPI + direct painting
    By JovianGhost in forum Qt Programming
    Replies: 8
    Last Post: 26th March 2010, 05:10
  5. How to use Signal through direct connection
    By santosh.kumar in forum Qt Programming
    Replies: 1
    Last Post: 14th December 2007, 07:07

Tags for this Thread

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.