[PyQt] Problem using promoted widgets with PyQt 4.4.2

Jan Ekholm jan.ekholm at smultron.net
Wed Jul 30 12:25:37 BST 2008


On Wednesday 30 July 2008 13:47:55 Jan Ekholm wrote:
<snip>


I cut the window down to a minimal example that for me does not work. The 
files are all attached and the code is also inline below. I assume I do 
something silly, but for the love of Darwin I can't figure it out.

tags.py:

import sys
from PyQt4 import QtGui, QtCore
from PyQt4.uic import loadUi
class Tags(QtGui.QWidget):
    def __init__ (self, *args):
        QtGui.QWidget.__init__(self, *args)
        loadUi("tags.ui", self)
    
app = QtGui.QApplication(sys.argv)
Tags().show()
app.exec_()


keyword_tree.py:

import sys
from PyQt4 import QtGui, QtCore
class KeywordTree(QtGui.QTreeWidget):
    def __init__ (self, *args):
        QtGui.QTreeWidget.__init__(self, *args)


tags.ui:

<ui version="4.0" >
 <class>Tags</class>
 <widget class="QWidget" name="Tags" >
  <property name="geometry" >
   <rect>
    <x>0</x>
    <y>0</y>
    <width>548</width>
    <height>424</height>
   </rect>
  </property>
  <property name="windowTitle" >
   <string>Form</string>
  </property>
  <layout class="QVBoxLayout" name="verticalLayout" >
   <item>
    <widget class="KeywordTree" name="keyword_tree" >
     <column>
      <property name="text" >
       <string>1</string>
      </property>
     </column>
    </widget>
   </item>
  </layout>
 </widget>
 <customwidgets>
  <customwidget>
   <class>KeywordTree</class>
   <extends>QTreeWidget</extends>
   <header>keyword_tree.h</header>
  </customwidget>
 </customwidgets>
 <resources/>
 <connections/>
</ui>


-- 
    There were no public health laws in Ankh-Morpork. It would be like
                installing smoke detectors in Hell.
                                            -- Terry Pratchett, Feet of Clay
-------------- next part --------------
A non-text attachment was scrubbed...
Name: keyword_tree.py
Type: application/x-python
Size: 194 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20080730/9c5fdca0/keyword_tree.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tags.py
Type: application/x-python
Size: 324 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20080730/9c5fdca0/tags.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tags.ui
Type: application/x-designer
Size: 765 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20080730/9c5fdca0/tags-0001.bin


More information about the PyQt mailing list