[PyQt] QDockWidgetquestion

Iliya Gogolev iliya at realdice.com
Mon Dec 22 15:08:42 GMT 2008


I tried it too. It did not help.

 

Sorry, I use QToolBox  instead QTreeWidget, but there’s no sense

 

 

From: Brian Kelley [mailto:kelley at eyesopen.com] 
Sent: Monday, December 22, 2008 5:00 PM
To: Iliya Gogolev; pyqt at riverbankcomputing.com
Subject: Re: [PyQt] QDockWidgetquestion

 

QDockWidgets behave a little different than normal widgets.  You need to
call “setWidget” to place a widget in a dock widget.

HYPERLINK
"http://doc.trolltech.com/4.4/qdockwidget.html"http://doc.trolltech.com/4.4/
qdockwidget.html

Try:

CustomDockWidget(QDockWidget):
  def __init__(self,parent):
    QDockWidget.__init__(self, parent)
    self.tree = QTreeWidget(self)
    self.setWidget(self.tree)       


On 12/22/08 9:54 AM, "Iliya Gogolev" <iliya at realdice.com> wrote:

Hi everyone!


I added QTreeWidget to QDockWidget and then added it to MainWindow by
addDockWidget function:

"""""""""""""""""""""""""""""""""""""""""""
CustomDockWidget(QDockWidget):
    def __init__(self,parent):
        QDockWidget.__init__(self, p_parent)
        self.tree = QTreeWidget(self)

                .
                .
                        .


"""""""""""""""""""""""""""""""""""""""""""

class MainWindow(QMainWindow):
    def __init__(self,  p_parent = None):
        QMainWindow.__init__(self,  p_parent)

          self.customWidget = CustomDockWidget(self)
        self.addDockWidget (Qt.LeftDockWidgetArea, self.customWidget)
                .
                .
                        .

I'm trying to catch mouse event in MainWindow when I click on the
QTreeWidget and no success.

Any ideas?

Thanks

Internal Virus Database is out-of-date.
Checked by AVG.
Version: 7.5.549 / Virus Database: 270.9.10/1814 - Release Date: 11/26/2008
8:53 PM


_______________________________________________
PyQt mailing list    PyQt at riverbankcomputing.com
HYPERLINK
"http://www.riverbankcomputing.com/mailman/listinfo/pyqt"http://www.riverban
kcomputing.com/mailman/listinfo/pyqt

 

Internal Virus Database is out-of-date.
Checked by AVG.
Version: 7.5.549 / Virus Database: 270.9.10/1814 - Release Date: 11/26/2008
8:53 PM


Internal Virus Database is out-of-date.
Checked by AVG. 
Version: 7.5.549 / Virus Database: 270.9.10/1814 - Release Date: 11/26/2008
8:53 PM
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20081222/5577269f/attachment.html


More information about the PyQt mailing list