Results 1 to 5 of 5

Thread: things on QSqlRelationalTableModel , QDataWidgetMapper and QTableView

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2010
    Location
    China
    Posts
    66
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    8

    Default Re: things on QSqlRelationalTableModel , QDataWidgetMapper and QTableView

    i used the connect as this below
    Qt Code:
    1. connect(welldatamapper,SIGNAL(setCurrentModelIndex()),wellTableView,SLOT(currentChanged()));
    2. connect(wellTableView,SIGNAL(currentChanged()),welldatamapper,SLOT(setCurrentModelIndex()));
    To copy to clipboard, switch view to plain text mode 

    but it din't work!

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanked 268 Times in 268 Posts
    Wiki edits
    20

    Default Re: things on QSqlRelationalTableModel , QDataWidgetMapper and QTableView

    Quote Originally Posted by xiongxiongchuan View Post
    Qt Code:
    1. SIGNAL(setCurrentModelIndex())
    To copy to clipboard, switch view to plain text mode 
    That's not a signal.

    Qt Code:
    1. SLOT(currentChanged())
    To copy to clipboard, switch view to plain text mode 
    That's not a slot.

    To quote the documentation:
    The following example illustrates how to update all widgets with new data whenever the selection of a QTableView named myTableView changes:
    Qt Code:
    1.  
    2. connect(myTableView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
    3. mapper, SLOT(setCurrentModelIndex(QModelIndex)));
    To copy to clipboard, switch view to plain text mode 

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

    xiongxiongchuan (13th June 2010)

  4. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: things on QSqlRelationalTableModel , QDataWidgetMapper and QTableView

    The first statement is obviously incorrect.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 2
    Last Post: 29th December 2012, 15:14
  2. QSqlRelationalTableModel QDataWidgetMapper
    By kawoN in forum General Programming
    Replies: 4
    Last Post: 26th May 2010, 10:30
  3. Replies: 1
    Last Post: 18th March 2009, 22:26
  4. QDataWidgetMapper to synchronize widgets with QTableView
    By ehamberg in forum Qt Programming
    Replies: 4
    Last Post: 21st February 2008, 21:46
  5. QDataWidgetMapper and QSqlRelationalTableModel problem
    By larry104 in forum Qt Programming
    Replies: 1
    Last Post: 14th November 2007, 16:46

Tags for this Thread

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.