Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QML binding executed before QObject connection
Forum Updated to NodeBB v4.3 + New Features

QML binding executed before QObject connection

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 140 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    skybreaker
    wrote on last edited by skybreaker
    #1

    Hi,

    I saw some strange behaviour on the Qt project I'm working on (5.12.6, OSX), but I don't know if this is by design, or not.
    Lets have the following registered QObject types:
    Class P

    • with property p of type G

    Class A

    • with a constant property x of type *P (exposed as a pointer)
    • after creating x in the constructor, it creates a connection between x.p change notification and one of its private slot (let's call it S)

    Class B

    • with property b of type G

    On QML side:

    • there is logic to alter A.x.p
    • B.b is bound to A.x.p

    My expectation would be that when A.x.p is changed, A::S() would be called first (since it was the first connection made to property x), and afterwards the binding made in QML to B.b, but it seems they are called reverse order. Threading should not be an issue here.

    Is it expected that QML bindings are performed before QObject connections? I couldn't find anywhere in the documentation this kind of information.

    Sorry for posting this question without any snippets, will follow up with an example if something is still unclear.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved