How to make a square button ? PyQt/PySide

1,920 views
Skip to first unread message

Jean Noval

unread,
May 24, 2015, 9:58:24 AM5/24/15
to python_in...@googlegroups.com
Hello,

I would like to make a lots of  squared QPushButton in a gridLayout.
But when the widget resize I want them to keep their squared shape. (So I cant use button.setFixedSize())


Also how to change a button's style ? By default they got a rounded Edge, I want a squared one.


Thanks in advance !

Mahmoodreza Aarabi

unread,
May 24, 2015, 12:17:45 PM5/24/15
to python_in...@googlegroups.com
in maya 2016 it change any ui to flat style

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/4b79f971-18c5-4074-b3c0-3c56c0897417%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--


Bests,
madoodia
Message has been deleted

Jean Noval

unread,
May 24, 2015, 1:59:32 PM5/24/15
to python_in...@googlegroups.com
Hello,

I think you didn't completely understand my message.
You only answered my second question.

My first question was about the size of a button, when I add a button too a GridLayout, the button is (by default) rectangular (width > height).
I want the button's height and width equal.
When I resize my UI I want the button to grow or shrink while keeping it's width/height ratio.


Can you give me an example ?

Thx
Message has been deleted

Justin Israel

unread,
May 24, 2015, 3:28:56 PM5/24/15
to python_in...@googlegroups.com

Take a look at implementing heightForWidth() on your custom button

http://doc.qt.io/qt-4.8/qwidget.html#heightForWidth


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages