[PyQt] RE: Drag and Drop TextEdit

adonay at k-demar.org adonay at k-demar.org
Fri Sep 19 17:37:56 BST 2008

If anyone interest the answer, finally I found it by casuality.
If you create the gui with qt4 designer, it puts a scrollareaWidgetContents
that grabs the mouse focus. For this reason, drag'n'drop doesn't work.
You need to edit .ui file, and set width & height of
scrollareaWidgetContents to 0
or remove scrollareaWidgetContents lines (this is my favorite method)

In .ui file you have these lines to remove:

<widget class="QWidget" name="scrollAreaWidgetContents" >
      <property name="geometry" >

And now it works, as child of scrollArea.

I think that this an error from designer, because this widget only must be
created if, using the designer, makes a child of it. No create
scrollareaWidgetContents by default, if no child on it.



Original Message:
From: adonay at k-demar.org adonay at k-demar.org
Date: Mon, 8 Sep 2008 17:20:36 -0400
To: pyqt at riverbankcomputing.com
Subject: Drag and Drop TextEdit

I'm doing a program that I need a TextEdit with drag&drop to move the

I have a Scrollarea, a textEdit, and a textedit2
   scrollarea is the parent of textedit

and textedit2 is the widget that I need to move.

If I make textedit as his parent, no work drag&drop
and if I make scrollarea as his parent, no work scrollbar of scrollarea,
but works d&d

I uploaded to my server a little app, to show it


Can anyone help me plz?


mail2web.com – Enhanced email for the mobile individual based on Microsoft®
Exchange - http://link.mail2web.com/Personal/EnhancedEmail

mail2web.com – What can On Demand Business Solutions do for you?

More information about the PyQt mailing list