Results 1 to 6 of 6

Thread: accessing table elements in Qt

  1. #1
    Join Date
    Jul 2008
    Posts
    6
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default accessing table elements in Qt

    hi frnds...
    i'm new to Qt...presently i m deveoping a GUI in which i need to handle table elements...i hav included table widget...now d user should be able to fill the table elements...but i m unable to access d elements(Row,Coloumn)...means how table elements are reffered in Qt...
    suppose i want to print the value of (3rd row,2nd coloumn)...so what would be d syntax...
    how can i proceed...??

    plz help...
    looking for ur suggestions....>>>
    thanks...

  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: accessing table elements in Qt

    Please use the great Qt reference documentation:
    Qt Code:
    1. QTableWidgetItem* item = tableWidget->item(row, column);
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

  3. #3
    Join Date
    Jul 2008
    Posts
    6
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: accessing table elements in Qt

    thanks...

    but can we store these items in an array for futher processing...suppose my table has 10 rows and 1 coloumn...d items in the cells are 0,1......9. the very first thing is that how we set these items into cells...n then how to store these elements into an array to print the items...

    as i said earlier i'm new to Qt so plz give each n every steps in more elaborate manner...

    thanks again...

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

    Default Re: accessing table elements in Qt

    It would really be advised if you read the documentation you were given. Then you should take a look at provided examples. Otherwise you'll be asking about everything on every step. At some point you will have to read some of the docs, so it's better to do it sooner than later.

  5. #5
    Join Date
    Jul 2008
    Posts
    6
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: accessing table elements in Qt

    thanks for ur suggestions...
    but i'm using Qt3 on Linux and there is no class QTableWidgetItem in Qt3...
    so how can i proceed....???

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: accessing table elements in Qt

    Quote Originally Posted by awanish_jmi View Post
    but i'm using Qt3 on Linux and there is no class QTableWidgetItem in Qt3...
    But there's QTableItem.

Similar Threads

  1. Q3CanvasRectangle table
    By Ahmad in forum Qt Programming
    Replies: 5
    Last Post: 21st October 2007, 14:21
  2. Accessing array (TABLE TYPE) in Stored Procedure from Qt
    By sureshbabu in forum Qt Programming
    Replies: 0
    Last Post: 26th September 2007, 11:36
  3. accessing gui elements from parent
    By chemstar in forum Qt Programming
    Replies: 3
    Last Post: 21st May 2006, 11:22
  4. displaying any table on a qdatatable
    By Philip_Anselmo in forum Newbie
    Replies: 4
    Last Post: 9th May 2006, 22:12
  5. creating table plugin
    By mgurbuz in forum Qt Programming
    Replies: 3
    Last Post: 28th April 2006, 13:50

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.