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. How to handle click event on node of Treeview
Forum Updated to NodeBB v4.3 + New Features

How to handle click event on node of Treeview

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.8k 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.
  • I Offline
    I Offline
    Indrajeet
    wrote on last edited by
    #1

    Hi

    I want to call a slot on the click event of a treeview node i tried something like this

    @QObject::connect(view, SIGNAL(clicked(const QModelIndex &)),view, SLOT(expandtest(const QModelIndex &)));@

    My slot loks like this
    @void MainWindow::expandtest(const QModelIndex &index)
    {
    QMessageBox::information(this, "Popup", "Item clicked");
    }@

    but the slot is not getting called.
    Can anybody help me out.

    1 Reply Last reply
    0
    • V Offline
      V Offline
      vsorokin
      wrote on last edited by
      #2

      Third parameter of connect must be pointer to object which contain slot,
      so for you it must be pointer for MainWindow object,
      if you doing connect in MainWindow object you can use this.

      --
      Vasiliy

      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