Results 1 to 2 of 2

Thread: Unable to update QTableWidget which is on Different QWidget from MainWindow

  1. #1
    Join Date
    Mar 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Unable to update QTableWidget which is on Different QWidget from MainWindow

    Hi ,
    I have One QTableWidget which is on Seperate QWidget form and i am not able to update QTableWidget.
    Actually i am trying to make this Qtable as a seperate component which i can put on different Tabs.
    One code snippet shows that it will get updated in a constructor of that QWidget.



    Please Help Me,

    Thanks N Regerds,
    sagar

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Unable to update QTableWidget which is on Different QWidget from MainWindow

    I am not sure if I get you right, but when you have a table inside an other widget and you want to access the table you have to provide a) a function which returns a pointer the the table, with which you can alter the table or b) (much better) provide setter functions like:
    Qt Code:
    1. void YourWidget::setItem ( int row, int column, QTableWidgetItem * item )
    2. {
    3. m_InternalPointerToYourTable->setItem(row, column, item);
    4. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Replies: 1
    Last Post: 23rd October 2009, 00:37
  2. Replies: 2
    Last Post: 19th November 2008, 09:01
  3. update() in QWidget
    By salmanmanekia in forum Qt Programming
    Replies: 5
    Last Post: 28th July 2008, 08:03
  4. QWidget::update() qeustion
    By tanki95 in forum Qt Programming
    Replies: 7
    Last Post: 14th March 2008, 02:29
  5. MainWindow update during computations
    By Gizmho in forum Qt Programming
    Replies: 7
    Last Post: 13th July 2006, 20:10

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.