Results 1 to 2 of 2

Thread: Signal & Slot

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2007
    Location
    Germany
    Posts
    89
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Signal & Slot

    Hello friends,

    i´am nearly ready with my treeview. To expand the child i must double click on the parent.
    But i want expand it by one click so i implement this
    Qt Code:
    1. privat slots:
    2. void expand(const QModelIndex & index);
    To copy to clipboard, switch view to plain text mode 

    in my mainwindow i add this code:
    Qt Code:
    1. connect(qtv, SIGNAL(clicked( const QModelIndex & index )),
    2. this, SLOT(expand(const QModelIndex & index)));
    To copy to clipboard, switch view to plain text mode 

    and after all the implementation:

    Qt Code:
    1. void MainWindow::expand(const QModelIndex & index)
    2. {
    3. if ( index.isValid())
    4. {
    5. qtv->expand(index);
    6. }
    7.  
    8. }
    To copy to clipboard, switch view to plain text mode 

    But nothing happens. I must always doubleclick the parent item to expand the child.

    Have anybody an idea what i make wrong??
    Attached Images Attached Images

Similar Threads

  1. signal and slot across threads having event loop
    By travis in forum Qt Programming
    Replies: 6
    Last Post: 5th November 2007, 23:56
  2. Replies: 2
    Last Post: 16th August 2007, 00:20
  3. signal not getting communicated to slot
    By quickNitin in forum Qt Programming
    Replies: 17
    Last Post: 2nd June 2006, 04:56
  4. Manually send signal to slot
    By donmorr in forum Qt Programming
    Replies: 1
    Last Post: 29th May 2006, 15:03
  5. signal slot conection using a string, not a SLOT
    By rianquinn in forum Qt Programming
    Replies: 6
    Last Post: 5th February 2006, 18:52

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.