Results 1 to 14 of 14

Thread: Write new data into QTableWidgetItem, convert float into QTableWidgetItem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2016
    Posts
    41
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    2

    Default Re: Write new data into QTableWidgetItem, convert float into QTableWidgetItem

    Yes, you are right.
    And yes I enter it manually.

    Problem was solved when I changed problem line to:
    tbl_2->setItem(i,j, ptwi = new QTableWidgetItem(QString::number( A[i][j] )));

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,348
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    318
    Thanked 872 Times in 859 Posts

    Default Re: Write new data into QTableWidgetItem, convert float into QTableWidgetItem

    @BlitzorDDD: You could save yourself a lot of time and head-pounding if you used Google and looked up some of the many, many examples on how to use QTableWidget:

    https://wiki.qt.io/How_to_Use_QTableWidget
    http://www.codeprogress.com/cpp/libr...m=QTableWidget

    and you would make many fewer mistakes if you learned how to write a good Qt application by studying the examples and tutorials on the Qt web site:

    http://doc.qt.io/qt-5/qtexamplesandtutorials.html

    We could spend many hours fixing each new bug you create, or you could teach yourself not to make bugs in the first place.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Jul 2016
    Posts
    41
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    2

    Default Re: Write new data into QTableWidgetItem, convert float into QTableWidgetItem

    Yes, yes, I would and I will.
    This is just my third program on Qt.
    Thank you very much for your links!

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: Write new data into QTableWidgetItem, convert float into QTableWidgetItem

    Quote Originally Posted by Blitzor DDD View Post
    Yes, you are right.
    And yes I enter it manually.
    Which, unsurprisingly, results in items being added to the table.
    Your tbl_2, on the other hand, remains empty.

    Quote Originally Posted by Blitzor DDD View Post
    Problem was solved when I changed problem line to:
    tbl_2->setItem(i,j, ptwi = new QTableWidgetItem(QString::number( A[i][j] )));
    Not sure what you have the "ptwi" in there for, but yes.
    As already clarified in comment #2, btw.

    Cheers,
    _

Similar Threads

  1. QTableWidgetItem
    By weixj2003ld in forum Qt Programming
    Replies: 1
    Last Post: 11th August 2011, 06:35
  2. QTableWidgetItem
    By weixj2003ld in forum Qt Programming
    Replies: 3
    Last Post: 7th August 2011, 07:59
  3. How to subclass QTableWidgetItem
    By codemonkey in forum Qt Programming
    Replies: 4
    Last Post: 4th October 2009, 11:11
  4. Im became fool with QTableWidgetItem
    By zorro68 in forum Qt Programming
    Replies: 3
    Last Post: 28th February 2007, 12:17
  5. 3 Different Color for in QTablewidgetItem
    By jnana in forum Qt Programming
    Replies: 3
    Last Post: 21st March 2006, 11:38

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.