Results 1 to 7 of 7

Thread: QListWidget signal problem

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Posts
    27
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QListWidget signal problem

    Hello,

    I am trying to create a signal on a QListWidget on item click. For some reason the signal does not seem to be working. Code is below. I think it may have to do with my setItemWidget call, not sure if this blocks signals for the QListWidgetItem.

    Edit: I just checked and connect is returning false, not sure what this problem is. And this is with the "ui.listWidget->setItemWidget(item, ne);" line commented out. So that is not causing the problem.

    Thanks for the help.

    Qt Code:
    1. for (int i = 0; i < 20; i++) {
    2. QListWidgetItem * item = new QListWidgetItem("123456789", ui.listWidget);
    3. item->setSizeHint(QSize(200,75));
    4. NameEntry * ne = new NameEntry("John", "NU", QPixmap(":/fb/images/1604859.jpg"), "123456789" );
    5. //connect(ui.listWidget, SIGNAL(itemClicked(QListWidgetItem *)), this, SLOT(changeDate()));
    6. ui.listWidget->setItemWidget(item, ne);
    7. connect(ui.listWidget, SIGNAL(itemClicked(QListWidgetItem *)), this, SLOT(changeDate()));
    8. }
    9. //... snip
    10.  
    11. void changeDate()
    12. {
    13. ui.lblDate->setText("Working...");
    14. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by rishid; 18th January 2008 at 18:35.

Similar Threads

  1. QLineEdit - lostFocus signal problem
    By Enygma in forum Qt Programming
    Replies: 6
    Last Post: 17th June 2010, 20:52
  2. QListWidget SIGNAL Problem
    By skuda in forum Qt Programming
    Replies: 19
    Last Post: 28th October 2009, 14:42
  3. QListWidget Problem
    By pmabie in forum Qt Programming
    Replies: 1
    Last Post: 7th October 2007, 06:52
  4. Problem emitting signal from a static function
    By Valheru in forum Qt Programming
    Replies: 21
    Last Post: 12th June 2007, 14:48
  5. Replies: 3
    Last Post: 15th April 2007, 19:16

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.