Results 1 to 16 of 16

Thread: QT Table Model

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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: QT Table Model

    Maybe you could rely on the fact that the modal formCari dialog was shown when the user double clicked on some certain item. So as long as the dialog is blocking the users input, the same item remains active in the table view.

    So maybe you could just connect to the clicked() signal and act in the view according to the current index.
    J-P Nurmi

  2. #2
    Join Date
    Jan 2007
    Posts
    201
    Thanks
    22
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QT Table Model

    But if we say we have a slot like this

    connect(pushInceleCari, SIGNAL(clicked(QModelIndex)), parent, SLOT(slotCarilerEdit(const QModelIndex)));

    how could program could understand that there should be link between table and button?

  3. #3
    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: QT Table Model

    Quote Originally Posted by aekilic View Post
    connect(pushInceleCari, SIGNAL(clicked(QModelIndex)), parent, SLOT(slotCarilerEdit(const QModelIndex)));
    You cannot do this. You cannot add random parameter types to signals. QPushButton offers a signal clicked(), not clicked(QModelIndex).

    Qt Code:
    1. connect(pushInceleCari, SIGNAL(clicked()), parent, SLOT(doSomething()));
    2.  
    3. void doSomething()
    4. {
    5. QModelIndex idx = tableView->currentIndex();
    6. ...
    7. }
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

Similar Threads

  1. hierarchical model in a flat view
    By gniking in forum Qt Programming
    Replies: 4
    Last Post: 10th November 2009, 20:17
  2. Relational Table Model Problem
    By aekilic in forum Qt Programming
    Replies: 2
    Last Post: 20th January 2007, 14:57
  3. displaying any table on a qdatatable
    By Philip_Anselmo in forum Newbie
    Replies: 4
    Last Post: 9th May 2006, 22:12
  4. creating table plugin
    By mgurbuz in forum Qt Programming
    Replies: 3
    Last Post: 28th April 2006, 13:50
  5. Table model / view editing issue
    By Caius Aérobus in forum Qt Programming
    Replies: 9
    Last Post: 7th April 2006, 11:03

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.