Results 1 to 5 of 5

Thread: table

  1. #1
    Join Date
    Nov 2006
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default table

    Hi all,
    I need to insert a table in a QT GUI. Which is the widget/view object you suggest? I'm working with QT 4.2.

    Requirements are basic. Tab button should move from a cell to the following one in the same row, while enter button should move down to the following row or create a new one.

    Thanks for your help.
    Gianni

  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: table

    QTableWidget might be a easier to start with but QTableView is more flexible in the long run and is also more popular amongst QtCentre users.
    J-P Nurmi

  3. #3
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: table

    You can use either QTableView or QTableWidget

  4. #4
    Join Date
    Nov 2006
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: table

    Thanks jpn an munna,
    as far as I know QTableWidget is older than QTableView. The second one uses a new way of programming introduced with QT4, is that right?

    I will try with the easiest then. I will ask again if I'm in trouble

    Gianni

  5. #5
    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: table

    QTableWidget is actually a subclass of QTableView. QTableWidget is just a "convenience view", with it's prebuilt default model. So with QTableWidget you don't need a separate model and you can work with QTableWidgetItems instead of QModelIndexes.
    J-P Nurmi

Similar Threads

  1. Dynamic updates to a table widget
    By guiGuy in forum Qt Programming
    Replies: 6
    Last Post: 1st June 2006, 20:24
  2. displaying any table on a qdatatable
    By Philip_Anselmo in forum Newbie
    Replies: 4
    Last Post: 9th May 2006, 22:12
  3. creating table plugin
    By mgurbuz in forum Qt Programming
    Replies: 3
    Last Post: 28th April 2006, 13:50
  4. Adding row in a Table after selected row
    By ankurjain in forum Qt Programming
    Replies: 3
    Last Post: 20th April 2006, 18:06
  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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.