KPushButton and deprecated setIcon ?

Martin Koller kollix at aon.at
Sun Feb 19 11:29:24 GMT 2012


Hi,

I'm developing a new KDE application and use designer for the UI.
In designer I can set the icon for a KPushButton to a name in the field "Theme"
which results in a call to
        QIcon icon(QIcon::fromTheme(QString::fromUtf8("contact-new")));
        newCustomer->setIcon(icon);
However I get a compiler warning due to setIcon being defined as deprecated with
the following comment:

     * Sets the pixmap for this button. Rarely used. This one exists mostly for usage in Qt designer,
     * with icons embedded into the ui file. But you should rather save them separately, and load them
     * with KIcon("name") so that the icons are themeable.
     */
#ifndef KDE_NO_DEPRECATED
    KDE_DEPRECATED void setIcon( const QIcon &pix );

I assume this deprecation was done before Qt itself had the possibility to load an icon from a theme ?

So should the KDE_DEPRECATED be simply removed ?

-- 
Best regards/Schöne Grüße

Martin
A: Because it breaks the logical sequence of discussion
Q: Why is top posting bad?

()  ascii ribbon campaign - against html e-mail 
/\  www.asciiribbon.org   - against proprietary attachments

Geschenkideen, Accessoires, Seifen, Kulinarisches: www.bibibest.at
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20120219/cbb45eb9/attachment.sig>


More information about the kde-core-devel mailing list