Results 1 to 3 of 3

Thread: QTableWidget signal cellActivated?

  1. #1
    Join Date
    Jan 2008
    Location
    Vancouver, Canada
    Posts
    54
    Thanks
    17
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default QTableWidget signal cellActivated?

    Hello, I am using qt 4.3.3 with two QTableWidgets. When one cell is selected in a table, I want a corresponding cell to be selected in another table. I have implemented this, but I am not sure which signal to use. I had been using cellClicked, which worked fine, but since I am not clicking both cells (one on each table) with the mouse, how can I get the other one to emit a signal?

    If that isn't clear, the basic question is: how do I get a signal to be emitted when using it is mearly "highlighted"? (I don't know if highlighted is the right term). would I use cellActivated? I can't figure out what this signal is supposed to be. It seems to connect properly, but nothing happens.

    Thanks again for people's advice!

  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: QTableWidget signal cellActivated?

    Quote Originally Posted by abrou View Post
    When one cell is selected in a table, I want a corresponding cell to be selected in another table.
    Do they have same data? In that case I'd suggest using model based approach and a shared QItemSelectionModel. Just like the Chart example does, see MainWindow::setupViews().
    J-P Nurmi

  3. #3
    Join Date
    Jan 2008
    Location
    Vancouver, Canada
    Posts
    54
    Thanks
    17
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTableWidget signal cellActivated?

    They might have the same data, but it isn't guaranteed. Each table has a list populated from a different .xml file, and clicking a row in the table will bring up information read from the corresponding .xml file (the info isn't stored, it is opened each time the user wants to look at another command). It will also bring up information from the corresponding command in the other QTableWidget.

    I think there is another way to do it, but it isn't as nice as just having a signal produced which the highlighted cell is changed.

    Thanks for your suggestion though!

Similar Threads

  1. Possible signal mapper problem
    By MarkoSan in forum Qt Programming
    Replies: 13
    Last Post: 25th January 2008, 13:11
  2. Hasn't QTableWidget an "activated" signal?
    By Morea in forum Qt Programming
    Replies: 1
    Last Post: 19th September 2007, 01:53
  3. Replies: 3
    Last Post: 8th September 2006, 18:54
  4. Replies: 2
    Last Post: 17th May 2006, 21:01
  5. Replies: 6
    Last Post: 5th March 2006, 21: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.