![]() Registered Member ![]()
|
Hi,
I'm trying to use iconwidget as button, and i use svg for it's drawing. But i got this result ![]() The second row is from inkscape as reference. Below my code snippet:
1. Does my centering layout codes correct? 2. Why the button shape does not look perfect like reference image? Thanks edited to include whole function
Last edited by mobilehunter on Mon Oct 12, 2009 9:47 am, edited 1 time in total.
|
![]() Administrator ![]()
|
The centering code looks fine from a normal Qt layouting perspective, however I do not know if setting the maximum size is needed.
I do not know why the button shape is disfigured, however it could certainly be the custom layouting. Have you tried disabling it?
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
I edited my first post above. I need to set maximum size otherwise, the mControlFrame will occupy half of the applet size. Sorry i don't understand with 'custom layouting'. Is it visible from my codes above? |
![]() Administrator ![]()
|
The problem is likely in the instantiation of the Plasma::IconWidgets. Can you please post the complete code of your widget?
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
More codes, iconwidget is created at applet constructor.
|
![]() Administrator ![]()
|
It is possible the IconWidget is forced to creating a square representation of itself, as icons are virtually always square. Does it render them correctly with Plasma::Svg?
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
Using Plasma::SvgWidget
![]() I also put setMinimumSize or the button will appear like previous IconWidget's screenshot. |
![]() Registered Member ![]()
|
I ended up creating new class for button.
|
![]() Administrator ![]()
|
Thanks for the update on the workaround.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered users: Bing [Bot], daret, Google [Bot], sandyvee, Sogou [Bot]