Results 1 to 2 of 2

Thread: QTableWidgetItem: setData or setText?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTableWidgetItem: setData or setText?

    there is no difference between these two code snippets.
    since
    Qt Code:
    1. inline void QTableWidgetItem::setText(const QString &atext)
    2. { setData(Qt::DisplayRole, atext); }
    To copy to clipboard, switch view to plain text mode 
    the last one is simpler.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  2. The following 2 users say thank you to spirit for this useful post:

    frankiefrank (10th January 2011), mattc (5th January 2010)

Similar Threads

  1. setData fails in QSqlRelationalTableModel
    By thePoet in forum Qt Programming
    Replies: 6
    Last Post: 8th July 2009, 04:27
  2. QSqlTableModel and possible bug with setData?
    By sylvainb in forum Qt Programming
    Replies: 2
    Last Post: 25th February 2009, 21:43
  3. QwtPolarCurve setData()---help needed
    By swamyonline in forum Qwt
    Replies: 2
    Last Post: 6th August 2008, 07:30
  4. setData()
    By starcontrol in forum Qt Programming
    Replies: 2
    Last Post: 2nd May 2008, 08:54
  5. setData()
    By coderbob in forum Qt Programming
    Replies: 4
    Last Post: 28th February 2008, 12:51

Tags for this Thread

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.