3dsMax 2019 not displaying QPushbutton icon AND text

3dsMax 2019 not displaying QPushbutton icon AND text

Anonymous
Not applicable
3,045 Views
22 Replies
Message 1 of 23

3dsMax 2019 not displaying QPushbutton icon AND text

Anonymous
Not applicable

If a QPushbutton is created with an icon and text in QtDesigner or programmatically, then opened in Max2019, the icon appears, but the text is not visible.

 

Testing by adding a background-color stylesheet suggest that Max is somehow adjusting the margins of the icon to be the entire size of the QPushbutton. This is compared to testing in QtDesigner or just from python, both of which work correctly.

 

Any suggestions on how to get Max to stop jacking with my Qt widgets?

 

Thanks!

0 Likes
3,046 Views
22 Replies
Replies (22)
Message 2 of 23

denisT.MaxDoctor
Advisor
Advisor

what are we talking about? C++, Python, or MaxScript somehow?

0 Likes
Message 3 of 23

istan
Advisor
Advisor

same issue: c++ qpushbutton

max2020

when assigning an icon, it does not show the text anymore. Did anyone solve this?

0 Likes
Message 4 of 23

denisT.MaxDoctor
Advisor
Advisor

use QToolButton instead

0 Likes
Message 5 of 23

A012255
Enthusiast
Enthusiast

Yep - but displays bad: The icon is positioned differently. Have to re-invent the wheel and will create it on my own.. Thx

 

0 Likes
Message 6 of 23

istan
Advisor
Advisor
You will develop this for me? 😉
Seem to be not solveable within a minute. Users just have to live without icons and once again I blame AD for that 😉
0 Likes
Message 7 of 23

denisT.MaxDoctor
Advisor
Advisor

@istan wrote:
You will develop this for me? 😉
Seem to be not solveable within a minute. Users just have to live without icons and once again I blame AD for that 😉

don't blame AD too much, especially not undeservedly. 😉

QPushButton does not support text under the icon. This is a fairly well-known limitation.

0 Likes
Message 8 of 23

istan
Advisor
Advisor

@denisT.MaxDoctor wrote:

QPushButton does not support text under the icon. This is a fairly well-known limitation.


I just wanted to get the text to the right of the icon, as it appears in the designer.

0 Likes
Message 9 of 23

denisT.MaxDoctor
Advisor
Advisor

It looks like it's not supported anymore... you have two options - draw pixmap yourself with painter or add layout to button.

with the second case you will get almost the same as a toolbutton  

0 Likes
Message 10 of 23

istan
Advisor
Advisor

I gave it a final test with a standalone qt app with the same version max uses and it worked there.

It's too minor for me to care any more. Thx.

0 Likes
Message 11 of 23

denisT.MaxDoctor
Advisor
Advisor

@istan wrote:

I gave it a final test with a standalone qt app with the same version max uses and it worked there.

 


Are you saying you can display a QPushButton with an icon and text in any alignment combination?

0 Likes
Message 12 of 23

istan
Advisor
Advisor

@denisT.MaxDoctor wrote:

Are you saying you can display a QPushButton with an icon and text in any alignment combination?


Yes. The icon and the text is displayed - exactly the same way as qt-designer does.

0 Likes
Message 13 of 23

denisT.MaxDoctor
Advisor
Advisor

@istan wrote:

@denisT.MaxDoctor wrote:

Are you saying you can display a QPushButton with an icon and text in any alignment combination?


Yes. The icon and the text is displayed - exactly the same way as qt-designer does.


Hmm... I, for example, don't know how to make a QPushButton without an additional layout with an icon and text underneath using Qt Designer. Could you give me a hint?

0 Likes
Message 14 of 23

istan
Advisor
Advisor

I was not talking about underneath. The text shows to the right of the icon.

0 Likes
Message 15 of 23

istan
Advisor
Advisor

sshot-14.png

0 Likes
Message 16 of 23

denisT.MaxDoctor
Advisor
Advisor

@istan wrote:

sshot-14.png


anyone can do that 😜

 

0 Likes
Message 17 of 23

istan
Advisor
Advisor
without max probably yes, but with max the text will be gone!
0 Likes
Message 18 of 23

denisT.MaxDoctor
Advisor
Advisor

denisTMaxDoctor_0-1692225317117.png

 

they are made with an additional layout set into the QPushButton and two QLabel widgets (Icon and Text) added to the layout.

0 Likes
Message 19 of 23

denisT.MaxDoctor
Advisor
Advisor

It is generally easier to use QToolButtons, but QToolButton has specific behaviour and style compared to QPushButton's, and overriding them to match QPushButton's is more difficult than making a QPushButton with a layout inside.

0 Likes
Message 20 of 23

istan
Advisor
Advisor

@denisT.MaxDoctor wrote:

denisTMaxDoctor_0-1692225317117.png


Cool! Were they all done via stylesheets or is extra code necessary?

0 Likes