Results 1 to 16 of 16

Thread: A Bug in Qt?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 370 Times in 336 Posts

    Default Re: A Bug in Qt?

    try to use something like this
    Qt Code:
    1. ...
    2. connect(ui.tableView, SIGNAL(entered(const QModelIndex &)), SLOT(entered(const QModelIndex &)));
    3.  
    4. }
    5.  
    6. void MyWidget::entered(const QModelIndex &index)
    7. {
    8. if (!index.isValid())
    9. return;
    10. ui.lineEdit->setText(QString("%1").arg(m_selectionModel->selectedRows().size()));
    11. }
    To copy to clipboard, switch view to plain text mode 
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  2. #2
    Join Date
    Aug 2008
    Location
    Nanjing, China
    Posts
    66
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    12
    Thanked 2 Times in 2 Posts

    Default Re: A Bug in Qt?

    it seems does not work......
    Jerry

  3. #3
    Join Date
    Aug 2008
    Location
    Nanjing, China
    Posts
    66
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    12
    Thanked 2 Times in 2 Posts

    Default Re: A Bug in Qt?

    it seems does not work......
    And the signal does not meet the logic demand.
    Jerry

  4. #4
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 370 Times in 336 Posts

    Default Re: A Bug in Qt?

    this code returs correct value of selected rows. maybe you do something wrong or I don't understand properly what do you want to achieve.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

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.