[Qt-interest] QPushButton with SVG images

Heiko Steindl heiko at kom.at
Thu May 28 15:55:25 CEST 2009


Hi!

did you have this in your .pro file?

QT += svg

You'll also need a #include <QtSvg> in your source file and than it
should work.

I hope this helps. :)

Best regards

Heiko

-- 


Mit freundlichen Grüßen

Heiko Steindl

Computerhaus EDV-Handels Ges.m.b.H
Wienerstrasse 35a
8605 Kapfenberg AUSTRIA

Tel: +43 (0)3862 27777
Fax: +43 (0)3862 27777 77
Mobil: +43 (0)676 3727777
E-Mail: heiko at kom.at




Tiago Correia schrieb:
> Hi,
>
> I'm using version 4.5.1 of Qt in Windows with Visual Studio 2008 SP1.
>
> I'm trying to include an SVG as an icon in a QPushButton. I've made my
> UI file on designer, selected my resource file and choose the SVG file
> to add has Icon. In Designer, the preview form, works just fine. When
> compiling and linking no error. But when running the application, I
> get the error, on the line where a QPixmpa is trying be be built by
> using the file name of the SVG resource and parameter.
>
> Any ideia you to solve this problem, without converting the SVG to PNG?
>
> -- 
> Tiago Correia
> chief technology officer
>
> cnoti inovação & desenvolvimento – Aprendizagem enRiquecida pela
> Tecnologia
> www.cnotinfor.pt <http://www.cnotinfor.pt>
> Telefone: +351 239 499 231
>
> Subscreva gratuitamente a nossa Newsletter BICA – Boletim informativo
> de Interactividade, Comunicação e Aprendizagem
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090528/53a3313b/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: heiko.vcf
Type: text/x-vcard
Size: 367 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090528/53a3313b/attachment.vcf 


More information about the Qt-interest-old mailing list