Results 1 to 3 of 3

Thread: Passing QTableWidget values to another QWizard page

  1. #1
    Join Date
    Feb 2008
    Posts
    43
    Thanks
    14

    Question Passing QTableWidget values to another QWizard page

    Hello! I have checked some answers on that subject but still can't quite figure that out. Here is the question:

    in a QWizard i have QTableWidget on one of the pages. I need take values of that QTableWidget, let's say item(1,1), get text ouf of it (->text) and publish it on the final page on a lineEdit. If that would be not a tableWidget but a lineEdit I would do: registerField("text", lineEdit) and then use this field("text") on the next page but it doesn't work with tableWidget.

    Do I need to play around with setDefaultProperty or I need just extend my registerField line?

    Please help!

  2. #2
    Join Date
    Feb 2008
    Posts
    43
    Thanks
    14

    Default Re: Passing QTableWidget values to another QWizard page

    Okay, so I do:

    Qt Code:
    1. ClassWizard::ClassWizard(QWidget *parent)
    2. ...
    3.  
    4. setDefaultproperty("QTabWidget", "item", SIGNAL(cellChanged(int, int)));
    To copy to clipboard, switch view to plain text mode 
    Then...

    Qt Code:
    1. IntoPage::IntroPage(QWidget *parent)
    2. ...
    3.  
    4. registerField("myItem", tableWidget);
    To copy to clipboard, switch view to plain text mode 
    and then...

    Qt Code:
    1. void SummaryPage::finalCalc()
    2. {
    3. ...
    4. QTableWidgetItem *finalItem = field("myItem".value<QTableWidgetItem *>();
    5. ...
    6.  
    7. }
    To copy to clipboard, switch view to plain text mode 
    That gives me buch of errors and doesn't work and that was my only idea on how to go about that.
    Last edited by slava; 29th June 2010 at 22:51. Reason: to wrap code blocks

  3. #3
    Join Date
    Feb 2008
    Posts
    43
    Thanks
    14

    Default Re: Passing QTableWidget values to another QWizard page

    i Have better Idea)) Since I need to dump all the fields in the text file at the end, I crreated a textEdit on the page with tableWidget, made it unvisible and dumped everything from the tableWidget to the textEdit right on that page and then registered textEdit as a field to have an access to that from the last page. That worked for me, thanks.

Similar Threads

  1. Replies: 7
    Last Post: 15th November 2012, 14:22
  2. Replies: 3
    Last Post: 26th February 2010, 22:37
  3. Passing values to custom 'slot' functions (pyqt)
    By Richie in forum Qt Programming
    Replies: 2
    Last Post: 7th September 2009, 07:05
  4. Replies: 3
    Last Post: 13th September 2008, 15:12
  5. Passing Command Line Values?
    By Kapil in forum Newbie
    Replies: 1
    Last Post: 29th March 2006, 08:26

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.