[PyKDE] QTabWidget: Unbound symbols -> AttributeError?

Greg Fortune lists at gregfortune.com
Tue May 20 15:18:01 BST 2003


I can reproduce on a 5500, but the explanation is simple.  The version of 
Qtopia running on the 5500 uses Qt 2.3.2 and the count property is not 
available in that version of Qt.

This is untested, but you might be able to get at the number of pages by

1) temp = currentPageIndex()
#This is the unknown..  Hopefully, negative indexs work like 
#they do for insertTab
2) setCurrentPage(-1) 
3) num = currentPageIndex() + 1
4) setCurrentPage(temp)

Morale of the story: Watch out for the different versions of Qt :)

Greg Fortune
Fortune Solutions


On Monday 19 May 2003 03:22 pm, Anthony Bellissimo wrote:
> I searched the archives for this problem, but didn't find anything that
> was ever resolved (though a few people mentioned it). This code is
> sufficient to demonstrate the problem:
>
> ----
> from qt import *
> qa = QApplication([])
> tw = QTabWidget()
> qw = QWidget()
> tw.addTab(qw,"blah")
> # This line fails, sometimes.
> print "How many tabs? %d tab(s)"%tw.count()
> ----
>
> Under normal circumstances, this gives 1. However, with the most recent
> version of Qt and PyQt on both Windows and the Sharp Zaurus, it dies
> with an AttributeError, suggesting that some of the bindings aren't
> working quite right. I noticed it with some other functions as well,
> such as (int)indexOf(QWidget) and (QWidget)page(int). Is there some way
> around this, even if the solution is to roll back to an earlier version
> of one of the libraries involved? It's frustrating that this stuff
> works fine on the Gentoo install on my desktop but not on either of the
> other two platforms.
>
> Thanks,
> -- Anthony Bellissimo (twon at cs.umass.edu)
>
> _______________________________________________
> PyKDE mailing list    PyKDE at mats.gmd.de
> http://mats.gmd.de/mailman/listinfo/pykde




More information about the PyQt mailing list