Results 1 to 3 of 3

Thread: Problem connecting selectionChanged

  1. #1
    Join Date
    Apr 2009
    Location
    Valencia (Spain)
    Posts
    245
    Thanks
    38
    Thanked 19 Times in 19 Posts
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Problem connecting selectionChanged

    Hi, I want to connect QAbstractItemView::selectionChanged, but I don't know why it's not working :S


    Qt Code:
    1. m_itemSelectedModel = ui.m_myTableView->selectionModel();
    2. bool test = QObject::connect(m_itemSelectedModel , SIGNAL(selectionChanged()), this, SLOT(my_private_slot()));
    To copy to clipboard, switch view to plain text mode 

    thanks!

  2. #2
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Problem connecting selectionChanged

    You are specifying a wrong signal signature. It looks like this:

    Qt Code:
    1. selectionChanged ( const QItemSelection &, const QItemSelection & )
    To copy to clipboard, switch view to plain text mode 
    I'm a rebel in the S.D.G.

  3. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Problem connecting selectionChanged

    What is not working? is my_private_slot declared as a slot? Q_OBJECT makro in the header file? or maybe
    Qt Code:
    1. QObject::connect(m_itemSelectedModel , SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)), this, SLOT(my_private_slot()));
    To copy to clipboard, switch view to plain text mode 

    EDIT: maybe I should try refresh before answering a thread I have opened in a tab...

Similar Threads

  1. Problem Wtih Connecting MySQL Database on Windows
    By dummystories in forum Installation and Deployment
    Replies: 25
    Last Post: 29th April 2009, 12:12
  2. Problem in connecting to PostgreSQL
    By c_srikanth1984 in forum Qt Programming
    Replies: 3
    Last Post: 24th April 2009, 08:18
  3. Problem connecting to remote database
    By graciano in forum Qt Programming
    Replies: 2
    Last Post: 16th April 2009, 11:59
  4. Replies: 4
    Last Post: 23rd May 2008, 10:42
  5. Replies: 15
    Last Post: 6th April 2008, 11:06

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.