aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/objects/class_toolbutton.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/objects/class_toolbutton.cpp')
-rw-r--r--src/modules/objects/class_toolbutton.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/modules/objects/class_toolbutton.cpp b/src/modules/objects/class_toolbutton.cpp
index 4508540bc..3a531da30 100644
--- a/src/modules/objects/class_toolbutton.cpp
+++ b/src/modules/objects/class_toolbutton.cpp
@@ -142,7 +142,13 @@ bool KviKvsObject_toolbutton::functionsetImage(KviKvsObjectFunctionCall *c)
KVSO_PARAMETERS_END(c)
if (!widget()) return true;
QPixmap * pix = g_pIconManager->getImage(icon);
- if(pix) ((QToolButton *)widget())->setIconSet(QIconSet(*pix,QIconSet::Small));
+ if(pix){
+ #ifdef COMPILE_USE_QT4
+ ((QToolButton *)widget())->setIconSet(QIconSet(*pix));
+ #else
+ ((QToolButton *)widget())->setIconSet(QIconSet(*pix,QIconSet::Small));
+ #endif
+ }
else
((QToolButton *)widget())->setIconSet(QIconSet());
return true;
@@ -231,8 +237,14 @@ bool KviKvsObject_toolbutton::functionsetTextLabel(KviKvsObjectFunctionCall *c)
KVSO_PARAMETER("tooltip",KVS_PT_STRING,KVS_PF_OPTIONAL,szTip)
KVSO_PARAMETERS_END(c)
if(!widget()) return true;
- if (szTip.isEmpty()) ((QToolButton *)widget())->setTextLabel(szLabel);
- else ((QToolButton *)widget())->setTextLabel(szLabel,szTip);
+
+ #ifdef COMPILE_USE_QT4
+ ((QToolButton *)widget())->setText(szLabel);
+ if (!szTip.isEmpty()) ((QToolButton *)widget())->setToolTip(szTip);
+ #else
+ if (szTip.isEmpty()) ((QToolButton *)widget())->setTextLabel(szLabel);
+ else ((QToolButton *)widget())->setTextLabel(szLabel,szTip);
+ #endif
return true;
}
bool KviKvsObject_toolbutton::functiontextLabel(KviKvsObjectFunctionCall *c)