It seems like the simplest approach would be to just implement resizeEvent on 
your widget and make your changes as necessary. That should kill both birds 
with a single stone. And if you need to make decisions based on width 
elsewhere, you shouldn’t really care about the size of the enclosing widget... 
all you need to pay attention to is how wide *your* widget is, which you can 
always grab using self.width().

-Nathan



From: John Vanderbeck 
Sent: Thursday, March 21, 2013 11:21 AM
To: Nuke Python discussion 
Subject: [Nuke-python] Size of Nuke Panel?

Hey all, 

I"m starting to delve into areas i've not done much with before, and i'm stuck 
trying to figure something out.

I am displaying items in a PyQT widget that is inside of a Nuke Panel. 

How can I determine what the current width/height is of the enclosing panel?  
And is there a signal that can tell me when it changes?

I know this sounds completely against the whole Qt paradigm, but my problem is 
I need to adjust how many of an item I display based on the size of the panel.  
If the panel is larger, I want to display more of them, and if its smaller I 
want to display less of them.  Since a Nuke panel can be pulled up anywhere, 
the actual sizes of them can vary widely.

Quite simply I have a series of widgets that I want to display in a grid 
fashion.  Those widgets have a minimum size where they maintain functionality.  
I need to know how many of those widgets I can display in the space given to me.


-- 
- John Vanderbeck 
- Prime Focus World, Vancouver
- 2D Pipeline TD



--------------------------------------------------------------------------------
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to