<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Sweet, the setDown() method was what I needed, thanks!<br>
It's a little disapointing that the right and middle mouse click
events don't seem to work on a mac though.<br>
<br>
I guess in that case I will have to make sure that the
mousePressEvent isn't called when the button is dragged. Is there an
elegant way to set some sort of threshold or check if the button was
moved a certain distance between the mouseDown and mouseUp events,
and if so, don't trigger the mousePressEvent? Will have a play, I
might have just answered my own question :-D<br>
<br>
Cheers,<br>
frank<br>
<br>
On 14/04/12 2:01 AM, Aaron Richiger wrote:
<blockquote cite="mid:4F88319E.2060907@bluewin.ch" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
Hello Frank and Sebastian!<br>
<br>
You are both right... Because you are discussing about different
code, I guess. The tutorial indicated by Frank does not work on
Mac for me (maybe, I am just to stupid to figure out how to
trigger a RightMouseButtonEvent on Mac, but anyways), so I guess,
Sebastian tried the code of the tutorial on Windows, where right
clicks perfectly work, but they do not leave down the original
button. <br>
Then I guess, Frank changed the tutorial code slightly to drag and
drop with left clicks on MacOS. And there it is, the original
button stays down after dragging and I think, this behaviour is
platform independent, so Sebastian would get the same problem I
guess...<br>
But it's not a bug of PySide or Qt, but just the normal behaviour
of buttons, if you click them with the left mousebutton. They are
looking "down", to repair this, simply call self.setDown(False) in
the mouseMoveEvent() method. You get a changed version of the
tutorial (not only dragNdrop, but also creating a new widget as
Frank wanted) here:<br>
<br>
<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://pastebin.com/GMbcCWYM">http://pastebin.com/GMbcCWYM</a><br>
<br>
Play around dragging the buttons with the left mouse button and
uncomment the self.setDown() call to see Franks issue platform
independent.<br>
<br>
Lot's of "guesses" and "maybes", but could be the solution...<br>
Aaron<br>
<br>
<br>
<br>
<blockquote cite="mid:4F881479.7040109@risefx.com" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
I guess this is a bug in PySide, which may depend on OS. I do
not have this behaviour on win xp with newest Pyside and python
26<br>
<br>
<br>
<br>
<br>
On 04/13/2012 10:54 AM, Frank Rueter | OHUfx wrote:
<blockquote cite="mid:4F87E9E0.3000703@ohufx.com" type="cite">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
Hi everyone,<br>
<br>
me again :)<br>
<br>
I just implemented the tutorial on <a moz-do-not-send="true"
href="http://zetcode.com/gui/pysidetutorial/dragdrop/">this
page</a> into my code as I needed to be able to copy
QPushButtons from one widget to another via Drag&Drop. It
all works great, accept for the fact that the original button
that I drag becomes checked and stays checked after I drop it
into the other widget.<br>
The example on the above page actually has the same problem
accept it doesn't matter in that example.<br>
<br>
The QPushButton is not set to be checkable and I've tried
using setChecked( False ) on the button both in the
dragEnterEvent as well as the dropEvent, but to no avail.<br>
<br>
Any ideas how to make the button uncheck itself after it was
dropped?<br>
<br>
<br>
Cheers,<br>
frank<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
PySide mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:PySide@qt-project.org">PySide@qt-project.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.qt-project.org/mailman/listinfo/pyside">http://lists.qt-project.org/mailman/listinfo/pyside</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Sebastian Elsner - pipeline td - r i s e | fx
t: +49 30 20180300 <a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:sebastian@risefx.com">sebastian@risefx.com</a>
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="http://www.risefx.com">www.risefx.com</a>
r i s e | fx GmbH
Schlesische Strasse 28 Aufgang B, 10997 Berlin
Geschäftsführer: Sven Pannicke, Robert Pinnow
Handelsregister Berlin HRB 106667 B</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
PySide mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:PySide@qt-project.org">PySide@qt-project.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.qt-project.org/mailman/listinfo/pyside">http://lists.qt-project.org/mailman/listinfo/pyside</a>
</pre>
</blockquote>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
PySide mailing list
<a class="moz-txt-link-abbreviated" href="mailto:PySide@qt-project.org">PySide@qt-project.org</a>
<a class="moz-txt-link-freetext" href="http://lists.qt-project.org/mailman/listinfo/pyside">http://lists.qt-project.org/mailman/listinfo/pyside</a>
</pre>
</blockquote>
</body>
</html>