[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: KAction - setting an iconSet fails
From: David Boosalis <d () boosalis ! com>
Date: 2005-03-31 0:19:39
Message-ID: 424B421B.3010502 () boosalis ! com
[Download RAW message or body]
I have an embeded image (using qembed) that I want to use in a toolbar
with KAction
The icon will not display for a KAction, but will display if I use
QAction. KAction will also display if it is read from a file with the
KDE API:
exitIcon = new QIconSet();
KIconLoader *iconLoader = KGlobal::iconLoader();
if (iconLoader != 0) {
*exitIcon = iconLoader->loadIcon("exit",KIcon::Toolbar,
KIcon::SizeMedium);
/* this is the code that will not display the icon */
exitA = new KAction(tr("Exit"),
QKeySequence("CTRL + Key_D"),
this,
"exitAction");
if (exitIcon) {
qDebug("SET EXIT ICON");
exitA->setIconSet(*exitIcon);
}
exitA->plug(tool_bar);
// QT will work though, something like:
exitIcon = new QIconSet();
image = qembed_findImage("exit");
exitIcon->setPixmap(QPixmap(image),QIconSet::Automatic,
QIconSet::Normal,QIconSet::On);
exitA = new QAction(tr("Exit"),
QKeySequence("CTRL + Key_D"),
this,
"exitAction");
if (exitIcon) {
qDebug("SET EXIT ICON");
exitA->setIconSet(*exitIcon);
}
exitA->addTo(tool_bar);
The KDE code will not show the icon unless I use KIconLoader.
I fixed it by just using QActions in my code. This is with KDE 3.3.0
and QT 3.3 (both Suse 9.2 Standard libraries)
Thank you for any help
-David
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic