Results 1 to 7 of 7

Thread: QTreeWidget signal not working

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    New Delhi,India
    Posts
    226
    Thanks
    14
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTreeWidget signal not working

    Hi...

    Thanks for the reply,

    i want the signal to be emitted when a particular sub item of the QTreeWidget is double clicked.. if i do not add the parameter names then it executes the same slot for any of the items clicked on the Tree Widget .. i want different slots to be executed for different tree widget items clicked...

    what do i do for that....
    what i tried didnt work...

    with regards ,
    Kapil
    All you have to decide is what to do with the time that is given to you

  2. #2
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: QTreeWidget signal not working

    Use connect for conecting needed item with needed slot
    a life without programming is like an empty bottle

  3. #3
    Join Date
    Feb 2006
    Location
    New Delhi,India
    Posts
    226
    Thanks
    14
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTreeWidget signal not working

    Quote Originally Posted by zlatko
    Use connect for conecting needed item with needed slot
    Hi..

    am doing that only.. just check on the small code which i have put.. this would give u some idea...
    All you have to decide is what to do with the time that is given to you

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QTreeWidget signal not working

    Qt Code:
    1. // connection
    2. connect(m_uiMainWindow.routingFlowTree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), this, SLOT(onDoubleClickAddDesignItem(QTreeWidgetItem*, int)));
    3.  
    4. // slot
    5. void Something::onDoubleClickAddDesignItem(QTreeWidgetItem* item, int column)
    6. {
    7. QList<QTreeWidgetItem *> widgetList = m_uiMainWindow.routingFlowTree->findItems(QString("Add Design"),Qt::MatchRecursive);
    8.  
    9. if (widgetList.size() > 0 && item == widgetList.takeFirst())
    10. {
    11. // do your thing
    12. }
    13. }
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

  5. The following user says thank you to jpn for this useful post:

    Kapil (28th April 2006)

  6. #5
    Join Date
    Feb 2006
    Location
    New Delhi,India
    Posts
    226
    Thanks
    14
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTreeWidget signal not working

    Hi..

    Thanks a lot for the code block.. It solves the problem... I was trying to put on this idea that ur answer came..

    Thanks again...

    with regards..
    Kapil
    All you have to decide is what to do with the time that is given to you

Similar Threads

  1. QTreeWidget clicked signal
    By ^NyAw^ in forum Qt Programming
    Replies: 41
    Last Post: 30th January 2010, 11:42
  2. pthread instead QThread
    By brevleq in forum Qt Programming
    Replies: 8
    Last Post: 23rd December 2008, 07:16
  3. Connection of custon signals/slots
    By brevleq in forum Qt Programming
    Replies: 2
    Last Post: 23rd December 2008, 07:04
  4. QTreeWidget double click signal
    By Pinco Pallino in forum Newbie
    Replies: 2
    Last Post: 18th November 2006, 16:37
  5. QTreeWidget SIGNAL
    By raphaelf in forum Newbie
    Replies: 6
    Last Post: 5th March 2006, 17:35

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.