Results 1 to 2 of 2

Thread: [B]tableWidget row,col to textEdit[B]

  1. #1
    Join Date
    Oct 2009
    Location
    tathra nsw australia
    Posts
    14
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question [B]tableWidget row,col to textEdit[B]

    g'day all

    QTableWidgetItem* val = tableWidget->takeItem(row, col); // ok???
    this line looks ok (at least no errors

    textEdit->append(QString(val));
    this is WRONG as is all that i have tried.

    using Qt 4.5,2 kde4.3.2 QtCreator 1.2.1

    QtCreator is the ants pants
    regards
    briang

  2. #2
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: [B]tableWidget row,col to textEdit[B]

    textEdit->append(QString(val));
    Yes this is wrong enough

    To use only text of that item use:
    Qt Code:
    To copy to clipboard, switch view to plain text mode 

    So now your code will be:
    Qt Code:
    1. textEdit->append(val->text());
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to yogeshgokul for this useful post:

    briang (6th November 2009)

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.