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. I want to call a function after a change in a QTreeView.
Qt 6.11 is out! See what's new in the release blog

I want to call a function after a change in a QTreeView.

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 502 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.
  • D Offline
    D Offline
    developer_96
    wrote on last edited by developer_96
    #1

    How can i achive to call a function or doing something after a change in a QTreeView.
    For Example:

    if(change in QtreeView)
    {
    s = 3;
    }
    

    So how can I say that something is changed.

    Regards

    1 Reply Last reply
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @developer_96 said in I want to call a function after a change in a QTreeView.:

      So how can I say that something is changed.

      The model from the view has some nice signals for this.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      2
      • D Offline
        D Offline
        developer_96
        wrote on last edited by
        #3

        @Christian-Ehrlicher thank you. But the problem is i already use a signal for an button that is triggered.
        So how can i achive to say that the button can be only clicked after a change?
        Is it possible to use the signal as a condition?

        1 Reply Last reply
        0
        • Christian EhrlicherC Online
          Christian EhrlicherC Online
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @developer_96 said in I want to call a function after a change in a QTreeView.:

          So how can i achive to say that the button can be only clicked after a change?

          Enable the button after the model emitted a change signal.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          2
          • D Offline
            D Offline
            developer_96
            wrote on last edited by
            #5
            This post is deleted!
            1 Reply Last reply
            0
            • D Offline
              D Offline
              developer_96
              wrote on last edited by
              #6

              thank you.

              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