[Qt-interest] QTableView and copy an paste operations
Velusamy, Baskar
Baskar.Velusamy at chevron.com
Sat Feb 7 01:28:33 CET 2009
Thanks Alex, I'll try this approach.. I heard using MIME type, we can
easily do this operation, but I don't know how....
+Baskar
-----Original Message-----
From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of Malyushytsky,
Alex
Sent: Friday, February 06, 2009 4:23 PM
To: qt-interest at trolltech.com
Subject: Re: [Qt-interest] QTableView and copy an paste operations
I think to copy to clipboard you can use:
QApplication::clipboard()->setText( ... ) ;
If it were a single cell it would be:
QApplication::clipboard()->setText(
tableView->currentIndex().data().toString() )
So you need to figure out how to construct string, so so Excel will past
it in the way you want.
My guess is you should separate column values with tabs "\t" and add
"\n" to split rows.
Best regards,
Alex Malyushytsky
-----Original Message-----
From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of Velusamy, Baskar
Sent: Friday, February 06, 2009 3:59 PM
To: qt-interest at trolltech.com
Subject: [Qt-interest] QTableView and copy an paste operations
Hi,
I'm trying to provide copy functionality in a QTableView so the user
can copy an paste rows from the TableView into Excel ( and with in
TableView ). Please let me know if anyone could help me on this ...
Thanks for your help..
Regards
Baskar
-----Original Message-----
From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of Josh
Sent: Friday, February 06, 2009 2:34 PM
To: qt-interest at trolltech.com
Subject: [Qt-interest] Qt4.4 QTextEdit size and viewport() size
Hello,
This should be simple but I can't figure it out. I have a QTextEdit with
lots of text so that scrollbars appear. I'm trying to get the size of
the widget that contains the text (for lack of a better description). I
thought the viewport() function did this, but it only returns the size
of the visible portion of the QTextEdit. The size of the QTextEdit
itself likewise is only the size of the visible widget.
So for example if you have a QTextEdit with many pages of text, the
height of the widget I'm looking for should certainly be more than the
number of pixels of the height of the screen, but both the QTextEdit's
height() function and the viewport() height() function both return the
number of pixels on the screen.
Thoughts? Ultimately it would be nice not just to get the size of the
underlying widget, but also a pointer to it itself. Thanks.
Josh
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
------------------------------------------------------------------------
---------------------------
Weidlinger Associates, Inc. made the following annotations.
"This message and any attachments are solely for the intended recipient
and may contain confidential or privileged information. If you are not
the intended recipient, any disclosure, copying, use, or distribution of
the information included in this message and any attachments is
prohibited. If you have received this communication in error, please
notify us by reply e-mail and immediately and permanently delete this
message and any attachments. Thank you."
"Please consider our environment before printing this email."
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
More information about the Qt-interest-old
mailing list