Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QState assignProperty and object pointer lifetime
Forum Updated to NodeBB v4.3 + New Features

QState assignProperty and object pointer lifetime

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.7k Views 1 Watching
  • 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.
  • Q Offline
    Q Offline
    qtradar
    wrote on 4 Feb 2011, 16:31 last edited by
    #1

    Hi,

    Can anyone tell me how QState's assignProperty(QObject *, const char *, const QVariant &) method handles objects that are no longer in scope?

    For example, I would like to set the enabled property of a button in a QDialog from the global state machine in my application. The assignProperty(button, "enabled", false) statement is executed every time the dialog is opened, as the dialog is newly instantiated every time. The issue is, that with the above statement active, my application sometimes crashes after opening the dialog a few times. It seems that assignProperty() is sometimes still trying to set the property of the already deleted previous buttons. Could this be possible? If so, is there a way to remove an assignProperty() instruction from a state without deleting and recreating the entire state?

    Thanks

    1 Reply Last reply
    0

    1/1

    4 Feb 2011, 16:31

    • Login

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