aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/objects/class_painter.cpp
diff options
context:
space:
mode:
authorGravatar Noldor2007-04-18 16:03:39 +0000
committerGravatar Noldor2007-04-18 16:03:39 +0000
commit56b7fa929af6d0b3de60ae494aa2893794279833 (patch)
treeb9b16c1d497e9ec11031ecc25bc8cb207f73fd00 /src/modules/objects/class_painter.cpp
parentcompact tips (diff)
downloadKVIrc-56b7fa929af6d0b3de60ae494aa2893794279833.tar.gz
KVIrc-56b7fa929af6d0b3de60ae494aa2893794279833.tar.bz2
KVIrc-56b7fa929af6d0b3de60ae494aa2893794279833.zip
added some QT4 painter new functions.
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@515 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/objects/class_painter.cpp')
-rw-r--r--src/modules/objects/class_painter.cpp46
1 files changed, 45 insertions, 1 deletions
diff --git a/src/modules/objects/class_painter.cpp b/src/modules/objects/class_painter.cpp
index 23210abda..5c45910d2 100644
--- a/src/modules/objects/class_painter.cpp
+++ b/src/modules/objects/class_painter.cpp
@@ -152,7 +152,15 @@
!fn: $setOpacity(<opacity_factor:real>) [QT4 ONLY]
Sets the painter opacity that affects all painter operations (drawpixmap, drawtext...). Valid values range are from 0 (total transparency) to 1 (total opacity)[br]
You must invoke the [classfnc]$begin[/classfnc] before using it.
-
+ !fn: $setTextAntialiasing(<boolean>) [QT4 ONLY]
+ Enable/disable antialias in text if possible.
+ You must call the [classfnc]$begin[/classfnc] before using it.
+ !fn: $setAntialiasing(<boolean>) [QT4 ONLY]
+ Enable/disable antialias in edges of primitives if possible.
+ You must call the [classfnc]$begin[/classfnc] before using it.
+ !fn: $setSmoothPixmapTransform(<boolean>) [QT4 ONLY]
+ Enable/disable smooth bilinear pixmap transformation algorithm (such as bilinear).
+ You must call the [classfnc]$begin[/classfnc] before using it.
Example:[br]
[br]
class (hello,widget)[br]
@@ -365,6 +373,9 @@ KVSO_BEGIN_REGISTERCLASS(KviKvsObject_painter,"painter","object")
#ifdef COMPILE_USE_QT4
KVSO_REGISTER_HANDLER(KviKvsObject_painter,"setOpacity",functionsetOpacity)
+ KVSO_REGISTER_HANDLER(KviKvsObject_painter,"setTextAntialiasing",functionsetTextAntialiasing)
+ KVSO_REGISTER_HANDLER(KviKvsObject_painter,"setAntialiasing",functionsetAntialiasing)
+ KVSO_REGISTER_HANDLER(KviKvsObject_painter,"setSmoothPixmapTransform",functionsetSmoothPixmapTransform)
#endif
KVSO_REGISTER_HANDLER(KviKvsObject_painter,"begin",functionbegin)
@@ -956,6 +967,39 @@ bool KviKvsObject_painter::functionsetOpacity(KviKvsObjectFunctionCall *c)
m_pPainter->setOpacity(dOpacity);
return true;
}
+bool KviKvsObject_painter::functionsetTextAntialiasing(KviKvsObjectFunctionCall *c)
+{
+ if(!m_pPainter)return true;
+
+ bool bEnabled;
+ KVSO_PARAMETERS_BEGIN(c)
+ KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled)
+ KVSO_PARAMETERS_END(c)
+ m_pPainter->setRenderHint(QPainter::TextAntialiasing,bEnabled);
+ return true;
+}
+bool KviKvsObject_painter::functionsetAntialiasing(KviKvsObjectFunctionCall *c)
+{
+ if(!m_pPainter)return true;
+
+ bool bEnabled;
+ KVSO_PARAMETERS_BEGIN(c)
+ KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled)
+ KVSO_PARAMETERS_END(c)
+ m_pPainter->setRenderHint(QPainter::Antialiasing,bEnabled);
+ return true;
+}
+bool KviKvsObject_painter::functionsetSmoothPixmapTransform(KviKvsObjectFunctionCall *c)
+{
+ if(!m_pPainter)return true;
+
+ bool bEnabled;
+ KVSO_PARAMETERS_BEGIN(c)
+ KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled)
+ KVSO_PARAMETERS_END(c)
+ m_pPainter->setRenderHint(QPainter::SmoothPixmapTransform,bEnabled);
+ return true;
+}
#endif