[PyQt] QTableWidget...Copy ?

Szabo, Patrick (LNG-VIE) patrick.szabo at lexisnexis.at
Wed Aug 22 10:43:14 BST 2012


Hi, 

Thank you for your response. 
I thought that it might be possible with those functions yet I hoped there would be an easier way. 
I want the user to be able to copy them via strg+c and thought there might be a method, attribute or flag that I have missed that would enable that possibility. 

I guess I'll have to add a button or catch the strg+c signal to solve this.

Best regards 


. . . . . . . . . . . . . . . . . . . . . . . . . .
Developer Patrick Szabo
 Developer 
LexisNexis
A-1030 Wien, Marxergasse 25

mailto:patrick.szabo at lexisnexis.at
Tel.: +43 1 53452 1573 
Fax: +43 1 534 52 146 


-----Ursprüngliche Nachricht-----

Von: pyqt-bounces at riverbankcomputing.com [mailto:pyqt-bounces at riverbankcomputing.com] Im Auftrag von Michael Kleinschnitker
Gesendet: Mittwoch, 22. August 2012 11:34
An: pyqt at riverbankcomputing.com
Betreff: Re: [PyQt] QTableWidget...Copy ?

Hi Patrick,


Am 21.08.2012 11:24, schrieb Szabo, Patrick (LNG-VIE):
> Hi,
>
> Is there any way to make it possible to copy a Table realised with a
> QTableWidet?
>
> I can mark it but it will always only copy the content of a single cell.
>
> It copies the value from the selected cell instead of copying everything
> I have marked.
>


if you want to copy teh entire table you could iterate over all rows and 
columns and copy the content from the cells.

But if you just want to copy the content of the selected cells, you 
could use the QTableWidget function "selectedItems". This returns a list 
of QTableQidgetItems. "selectedIndexes()" could be another way to solve 
your problem.



Best regards
Micha

_______________________________________________
PyQt mailing list    PyQt at riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt




More information about the PyQt mailing list