[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] Bug with QClipboard
From: Chris Kaynor <ckaynor () zindagigames ! com>
Date: 2010-04-29 18:49:56
Message-ID: n2xa03c8d051004291149h5fbb67c0q2d2ac0be06d20fea () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Ah yes, that is my bad. I missed the part of the documentation for
QClipboard where it says:
There is a single QClipboard object in an application, accessible
as QApplication.clipboard().
Thanks for your time though :).
Chris
On Thu, Apr 29, 2010 at 11:31 AM, Russell Valentine
<russ@coldstonelabs.org>wrote:
> Doesn't look like setText() is a static function, I'd suggest trying:
>
> QtGui.QApplication.clipboard().setText("This is a clipboard test.")
>
>
> On 04/29/10 13:11, Chris Kaynor wrote:
> > When using PyQt 4.7 with Python 2.6.2, it is impossible to use the
> > QClipboard class.
> >
> > When attempting to instantiate an instance of the class, the error
> > "TypeError: PyQt4.QtGui.QClipboard cannot be instantiated or sub-classed"
> is
> > raised.
> >
> > As the class cannot be instantiated, I tried to call the methods on the
> type
> > object (QClipboard.setText) and got the error "TypeError:
> > QClipboard.setText(QString, QClipboard.Mode mode=QClipboard.Clipboard):
> > first argument of unbound method must have type 'QClipboard'"
> >
> > Chris
> >
>
[Attachment #5 (text/html)]
Ah yes, that is my bad. I missed the part of the documentation for QClipboard where \
it says:<div><br>There is a single QClipboard object in an application, accessible as \
QApplication.clipboard().</div><div><br>Thanks for your time though :).</div> \
<div><br></div><div>Chris<br> <br><div class="gmail_quote">On Thu, Apr 29, 2010 at \
11:31 AM, Russell Valentine <span dir="ltr"><<a \
href="mailto:russ@coldstonelabs.org">russ@coldstonelabs.org</a>></span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex;"> Doesn't look like setText() is a static function, \
I'd suggest trying:<br> <br>
QtGui.QApplication.clipboard().setText("This is a clipboard test.")<br>
<div><div></div><div class="h5"><br>
<br>
On 04/29/10 13:11, Chris Kaynor wrote:<br>
> When using PyQt 4.7 with Python 2.6.2, it is impossible to use the<br>
> QClipboard class.<br>
><br>
> When attempting to instantiate an instance of the class, the error<br>
> "TypeError: PyQt4.QtGui.QClipboard cannot be instantiated or \
sub-classed" is<br> > raised.<br>
><br>
> As the class cannot be instantiated, I tried to call the methods on the type<br>
> object (QClipboard.setText) and got the error "TypeError:<br>
> QClipboard.setText(QString, QClipboard.Mode mode=QClipboard.Clipboard):<br>
> first argument of unbound method must have type 'QClipboard'"<br>
><br>
> Chris<br>
><br>
</div></div></blockquote></div><br></div>
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic