[PyKDE] Problems with QWidgetStack.raiseWidget()

Jorge Godoy godoy at ieee.org
Thu Jul 21 17:25:31 BST 2005


Hi,

I'm trying to write functions to cycle through the widgets created on a
widgetstack.  I can get their ID correctly, guess what the next widget's ID
should be but when I can the raiseWidget(int id) method it doesn't work.  A
code snippet with its output is included below, as well as program versions.
I appreciate any hints on what I might be doing wrong.

CODE:
--------------------------------------------------------------------------------
    def nextWidgetStack(self):
        print 'List:', self.widgetstacksList
        id = self.widgetStack1.id(self.widgetStack1.visibleWidget())
        pos = self.widgetstacksList.index(id)
        print 'Actual:', self.widgetstacksList[pos]
        try:
            next = self.widgetstacksList[pos + 1]
        except IndexError:
            next = self.widgetstacksList[0]
        print 'Next:', next
        print 'Widget Found:', self.widgetStack1.widget(next)
        self.widgetStack1.raiseWidget(next)
--------------------------------------------------------------------------------


OUTPUT (activated twice to show that nothing changes):
--------------------------------------------------------------------------------
List: [1, 2, 3]
Actual: 3
Next: 1
Widget Found: None
List: [1, 2, 3]
Actual: 3
Next: 1
Widget Found: None
--------------------------------------------------------------------------------


Versions:
   pyuic -version --> Python User Interface Compiler 3.13 for Qt version 3.3.4
   sip -V         --> 4.1.1 (4.1.1-255)

   >>> import qt
   >>> qt.qVersion()
   '3.3.4'
   >>>  


Expected behaviour:
   Having widget with ID 1 raised on the widgetstack.


Thanks in advance,
-- 
Jorge Godoy      <godoy at ieee.org>





More information about the PyQt mailing list