Results 1 to 2 of 2

Thread: can't make QAbstractItemView signals work

  1. #1
    Join Date
    Apr 2007
    Posts
    46
    Thanks
    4
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default can't make QAbstractItemView signals work

    I have the following code, and the signal does nothing:

    Qt Code:
    1. listOrIconView = new QListView(this);
    2. listOrIconView->setModel(proxyModel);
    3. listOrIconView->setEditTriggers(QAbstractItemView::NoEditTriggers);
    4. connect(listOrIconView, SIGNAL(activated(const QModelIndex &index)), qApp, SLOT(quit()));
    To copy to clipboard, switch view to plain text mode 

  2. #2
    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: can't make QAbstractItemView signals work

    You may not put parameter names to the connect statement:
    Qt Code:
    1. connect(listOrIconView, SIGNAL(activated(const QModelIndex &)), qApp, SLOT(quit()));
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

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

    ber_44 (29th May 2007)

Similar Threads

  1. how to make QHttp work with this URL
    By ber_44 in forum Qt Programming
    Replies: 11
    Last Post: 23rd April 2007, 09:20
  2. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 05:57
  3. QHttp signals don't work !!
    By probine in forum Qt Programming
    Replies: 11
    Last Post: 11th January 2007, 15:02
  4. Why can't I make dynamic_cast work properly?
    By pir in forum General Programming
    Replies: 13
    Last Post: 18th July 2006, 16:17

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.