PDA

View Full Version : PyQt ignoring stylesheets with certain layout configurations?



gct
11th November 2009, 06:42
OK I'm stumped on this one. I wanted to put a sidebar in my app, with a tree view and a list view for a couple things, and I thought I'd get fancy and
make it so the two views took up the entire vertical space, had rounded headers on each one, and a splitter between them so you could decide how
much space each one had.

I was able to get it done with a style sheet to give me the nice rounded headers. I set the main window up with a horizontal layout and a spacer
to push the sidebar to the right.

Then on the sidebar, each view/header combination is laid out vertically inside a widget so they'll expand, and these two widgets are then laid out
vertically with a splitter. Finally the sidebar is laid out vertically.

My problem is when the final vertical layout is added, PyQt stops rendering my first header. It just looks like a regular unstyled frame (ie ugly). It
previews correctly in designer, but then displays incorrectly in python.

I've attached a sample form and python stub that can be used to run it (just run python bug_test.py). Can anyone tell me what I'm doing wrong?

I'm using Qt 4.5.0 (from ubuntu 9.04 repo) and PyQt 4.6.1 (installed from tarball). Help!

gct
11th November 2009, 15:18
Anyone have any thoughts?