Sure ....

http://pastebin.com/mZ04q16h

Now includes a Maya style and removed the triangle pixmap and used a
QPolygon instead.  Made the text bold to match Maya also.
It's a near 1 - 1 match.

I did try to rotate the QPolygon with QMatrix.map(poly) but I think it
rotated off screen.  If someone gets that working that would be nice to
see.  Anyway, it was easy enough to describe 2 triangles for expanded and
collapsed.

-Dave

On Tue, May 15, 2012 at 3:23 PM, Dillon Bailey <[email protected]> wrote:

> If you could post, that would be great!
>
>
> On Tuesday, May 15, 2012, David Moulder wrote:
>
>> Bur's implementation is very nice.  I've modified the widgets paintEvent
>> method to add a Maya style look to them.  I can post back up if people are
>> interested.
>>
>>
>>
>> On Mon, May 14, 2012 at 10:23 PM, Jo Jürgens <[email protected]> wrote:
>>
>> Nice work!
>>
>> Blur Studios have published all their pipeline scripts, and there's a
>> pretty nice collapsible groupBox there. Might be interesting to have a look
>> at.
>>
>> You can download a Windows installer from
>> http://code.google.com/p/blur-dev/. If you just want the groupbox
>> script, I pasted it here: http://pastebin.com/ZFUrj7sm
>>
>>
>>
>> On Fri, May 11, 2012 at 8:03 AM, Manuel Macha <[email protected]>wrote:
>>
>> I'm on pyqt 4.7.3. The mistake that I was making was that I defined the
>> signal inside my init method.
>> Thanks Justin, I'll definitely stick with the new syntax from now on.
>> p.s: here's a working example: http://pastebin.com/zcTVbat0
>>
>>
>>
>>
>> On Fri, May 11, 2012 at 12:29 PM, Justin Israel 
>> <[email protected]>wrote:
>>
>> New style signal slots were introduced in Qt 4.5. Maybe you are using a
>> really old version of Qt?
>>
>>
>>
>> On May 10, 2012, at 7:20 PM, Manuel Macha <[email protected]> wrote:
>>
>> Hi Justin,
>> many thanks for your help.
>> I've cleaned up the mousePressEvent method as suggested (the original was
>> eclipse's suggested default syntax for overriding a method)
>> I'd prefer using the new-style signal-slots mechanism but in this case I
>> couldn't get it to work, even trying several variations of the example that
>> you've given.
>> As for breaking the UI-setup into a bunch of smaller methods. I think I
>> saw that in some book and found it helped me with breaking stuff into
>> meaningful subtasks. I'm aware that it inflates the code and it's uncommon
>> to do things that way but for me it's working.
>> Anyways, here's how far I got with the frameLayout. I've added the
>> collapse-arrow and a label:
>> http://pastebin.com/qYgDDYsB
>>
>> Regards,
>> Manuel
>>
>>
>> On Fri, May 11, 2012 at 1:47 AM, Justin Israel <[email protected]>wrote:
>>
>> I don't think there is anything wrong with the approach you are taking.
>> This is the norm. The framework can't provide every type of functionality,
>> but they do give you a ton of building blocks to make it easy to compose
>> your own.
>>
>> There isn't much to say about your code other than me nit picking a
>> little :-)
>> But here are some small things...
>>
>>     def mousePressEvent(self, *args, **kwargs):
>>         self.emit(QtCore.SIGNAL('clicked()'))
>>         return QtGui.QFrame.mousePressEvent(self, *args, **kwargs)
>>
>> An event method will only receive a single event argument, and you don't
>> need to return anything. Right now this would be returning None all the
>> time. You can just take the single event arg, and then call the superclass
>> method with it.
>>
>> Also, you might want to consider using the new-style signal-slots if you
>> are just learning...
>> You can define signals as class attributes like this:
>>
>> class TitleFrame(QtGui.QFrame):
>>     clicked = QtCore.pyqtSignal()
>>
>> ... And then you can emit like this:
>>
>>      self.clicked.emit()
>>
>> ... And connections to the slot in your other class would be like:
>>
>>     self.titleFrame.clicked.connect(self.printSomething)
>>
>> Its much cleaner and easier to use. And you can create signals w
>>
>> --
>> David Moulder
>> http://www.google.com/profiles/squish3d
>>
>> --
>> view archives: http://groups.google.com/group/python_inside_maya
>> change your subscription settings:
>> http://groups.google.com/group/python_inside_maya/subscribe
>>
>  --
> view archives: http://groups.google.com/group/python_inside_maya
> change your subscription settings:
> http://groups.google.com/group/python_inside_maya/subscribe
>



-- 
David Moulder
http://www.google.com/profiles/squish3d

-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe

Reply via email to