Results 1 to 2 of 2

Thread: some doubts qtablewidget

  1. #1
    Join Date
    Aug 2009
    Posts
    38
    Thanks
    3

    Default some doubts qtablewidget

    Hi,


    I would like to know how could I assign the value of a cell in my tablewidget to a variable to then use it for a qprocess. I've created a signal when the the cell is clicked but I don't know how I can do this.
    Other question, How could I do that the cells of my tablewidget are locks and nothing can edit them.

    Many thanks and sorry for my english!!

  2. #2
    Join Date
    Aug 2008
    Location
    Algarve, Portugal
    Posts
    288
    Thanks
    23
    Thanked 32 Times in 28 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: some doubts qtablewidget

    To get the text of your cell do :

    Qt Code:
    1. QString str;
    2. str=m_ui->tableWidget->item(row,column)->text();
    To copy to clipboard, switch view to plain text mode 

    to prevent the cell form being editable use the function

    QTableWidgetItem::setFlags ( Qt::ItemFlags flags )and the flag
    Qt::ItemIsEditable

Similar Threads

  1. QComboBox in QTableWidget : display troubles.
    By Nyphel in forum Qt Programming
    Replies: 2
    Last Post: 13th October 2007, 23:29
  2. Select columns from a QTableWidget
    By toglez in forum Qt Programming
    Replies: 10
    Last Post: 7th October 2007, 15:15
  3. print QTableWidget
    By chak_med in forum Qt Programming
    Replies: 3
    Last Post: 4th November 2006, 18:46
  4. QTableWidget editing question
    By Trasmeister in forum Qt Programming
    Replies: 1
    Last Post: 20th September 2006, 18:46
  5. Replies: 6
    Last Post: 5th March 2006, 21:05

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.