Image on button
Edpa
Posts: 46
Hi!
I try to do button with image. But now have button with image size and picture as too small icon.
I used this script .What should I add? which strings?
var wDlg = new DzDialog;
var wBtn = new DzPushButton(wDlg );
var pixImage = new Pixmap("c:/2016-07-06_180440.png");
wBtn.pixmap = new Pixmap(pixImage );
wDlg.exec()
Post edited by Chohole on
Comments
I think your image just needs to be larger. Also why are you constructing the Pixmap twice?
I don't have a push button example handy, but DzRadioButton should be the same.
I take it back. This must be something peculiar to DzPushButton. It looks like a bug to me.
I think you are both thinking a DzPushButton's icon is for image purposes.....it's supposed to be the 'down arrow' for buttons that display a set of options. Position and size are GUI style controlled. Look at the definition of the Qt class it wraps (QPushButton) here: http://doc.qt.io/qt-4.8/qpushbutton.html
I'm not sure what DS uses for buttons with non-icon style images on them. It may be a built-in custom widget that would have to be loaded using DzUiLoader....
Thanks guys!
I thought before about DzUiLoader :)
But I do not know how I can connect this with the action,with my function.
I tried this code, but it does not work
I think what you need to do is something like (**untested**):
Hi, Esemwy!
Your script is running great. Thank you very much. Button name I found in my UI file (my widget) and replace your name theOkButton.
Hurrah, now I can create any widgets!
The script looks completely
A fragment of UI file with Button name
Hi guys!
I wrote about Vertical slider http://www.daz3d.com/forums/discussion/73311/vertical-slider#latest
I thought to use the UI file too.
After example of Esemwy, I tried to come back to this method. But I did not succeed ... Have you tried to do the slider widget?
If yes, How do you connect the slider with actions? Which signals you used?
I see strange visualization of the vertical slider in the DAZ. I think that DAZ not support it now. Try to use the QT scrollbar instead of slider. Parameters are similar.
Other version without UI file - Label on the button
Looking at the docs there is a ButtopStyle Object that is not documented, I guess that has something to do with this....
Downside is that the image is not default adjusted to pushed/non pushed state, but I like this workaround for the time being
No problem . Simple example :)
You can control clicks. I usually use the function (for 2 clicks- even or odd number)
Redacted
I only write the tested scripts. The code works. Check the path to your picture and its name and slash (correctly / )
Redacted