Results 1 to 4 of 4

Thread: Slot "columnsMoved" is not firing?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2009
    Location
    US, Midwest
    Posts
    215
    Thanks
    62
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Slot "columnsMoved" is not firing?

    I have a QAbstractTableModel-derived model attached to a QTreeView and I need to be able to track user movement of columns in the view. Luckily QAbstractTableModel has a signal "columnsMoved".
    So, I do usual stuff:
    Qt Code:
    1. ui.lstPairs->setModel(&_model);
    2. bool res1 = connect(&_model, SIGNAL(columnsMoved(const QModelIndex&, int, int, const QModelIndex&, int)),
    3. this, SLOT(columnsMoved(const QModelIndex&, int, int, const QModelIndex&, int)));
    4. if (!res1)
    5. return;
    To copy to clipboard, switch view to plain text mode 
    ..
    and slot implementation:
    private slots:
    void columnsMoved(const QModelIndex & sourceParent, int sourceStart, int sourceEnd, const QModelIndex & destinationParent, int destinationColumn);
    ..
    Qt Code:
    1. void viewPairs::columnsMoved(const QModelIndex & sourceParent, int sourceStart, int sourceEnd, const QModelIndex & destinationParent, int destinationColumn)
    2. {
    3. int i =5; // test
    4. }
    To copy to clipboard, switch view to plain text mode 

    When I run it in debug the res1 variable is TRUE, so everything looks normal. Then I start moving the view columns using mouse and my slot is never called. (I place a breakpoint in int i = 5; line)

    Question: what can be the problem that causes columnsMoved slot to never be called?
    Thanks.
    Last edited by TorAn; 6th November 2014 at 14:52.

Similar Threads

  1. Replies: 5
    Last Post: 24th May 2010, 21:20
  2. debugging "signal does not reach slot" in a template class
    By Daniel Dekkers in forum Qt Programming
    Replies: 1
    Last Post: 3rd April 2010, 16:03
  3. Replies: 1
    Last Post: 5th January 2010, 13:34
  4. Replies: 1
    Last Post: 23rd August 2008, 22:09
  5. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05

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.