KDEUI
#include <kgesture.h>
Public Member Functions | |
KShapeGesture () | |
KShapeGesture (const QPolygon &shape) | |
KShapeGesture (const QString &description) | |
KShapeGesture (const KShapeGesture &other) | |
~KShapeGesture () | |
float | distance (const KShapeGesture &other, float abortThreshold) const |
uint | hashable () const |
bool | isValid () const |
bool | operator!= (const KShapeGesture &other) const |
KShapeGesture & | operator= (const KShapeGesture &other) |
bool | operator== (const KShapeGesture &other) const |
void | setShape (const QPolygon &shape) |
void | setShapeName (const QString &friendlyName) |
QString | shapeName () const |
QString | toString () const |
QByteArray | toSvg (const QString &attributes=QString()) const |
Detailed Description
Definition at line 37 of file kgesture.h.
Constructor & Destructor Documentation
KShapeGesture::KShapeGesture | ( | ) |
Create a new invalid shape gesture.
Definition at line 50 of file kgesture.cpp.
KShapeGesture::KShapeGesture | ( | const QPolygon & | shape | ) |
Creates a new gesture consisting of given shape.
If the gesture belongs to a KAction, and the user draws approximately the same shape on the screen while holding down the right mouse button, the action will trigger. shape
must be a "reasonable" polygon. It must contain at least two points and it should contain at most 50 for performance reasons. No two consecutive points are allowed to be at the same position.
- Parameters
-
shape shape to draw to trigger this gesture
Definition at line 56 of file kgesture.cpp.
KShapeGesture::KShapeGesture | ( | const QString & | description | ) |
Creates a new gesture from a string description.
- Parameters
-
description create gesture according to this
Definition at line 63 of file kgesture.cpp.
KShapeGesture::KShapeGesture | ( | const KShapeGesture & | other | ) |
Copies the given gesture.
- Parameters
-
other gesture to copy
Definition at line 93 of file kgesture.cpp.
KShapeGesture::~KShapeGesture | ( | ) |
Destructor.
Definition at line 99 of file kgesture.cpp.
Member Function Documentation
float KShapeGesture::distance | ( | const KShapeGesture & | other, |
float | abortThreshold | ||
) | const |
Return a difference measurement betwenn this gesture and the other
gesture.
Abort comparison if difference is larger than abortThreshold
and return a very large difference in that case. Usual return values range from x to y //TODO: fill in x and y
Definition at line 225 of file kgesture.cpp.
uint KShapeGesture::hashable | ( | ) | const |
Return an opaque value for use in hash tables.
Definition at line 384 of file kgesture.cpp.
bool KShapeGesture::isValid | ( | ) | const |
Return true if this gesture is valid.
Definition at line 158 of file kgesture.cpp.
bool KShapeGesture::operator!= | ( | const KShapeGesture & | other | ) | const |
Return the opposite of operator==()
Definition at line 379 of file kgesture.cpp.
KShapeGesture & KShapeGesture::operator= | ( | const KShapeGesture & | other | ) |
Set this gesture to the other gesture.
Definition at line 362 of file kgesture.cpp.
bool KShapeGesture::operator== | ( | const KShapeGesture & | other | ) | const |
Return whether this gesture is equal to the other gesture.
Definition at line 371 of file kgesture.cpp.
void KShapeGesture::setShape | ( | const QPolygon & | shape | ) |
Set the shape to draw to trigger this gesture.
Definition at line 105 of file kgesture.cpp.
void KShapeGesture::setShapeName | ( | const QString & | friendlyName | ) |
set a user-visible name for this gesture's shape, like "triangle" or "line".
Definition at line 146 of file kgesture.cpp.
QString KShapeGesture::shapeName | ( | ) | const |
Return the user-visible name for this gesture's shape, like "triangle" or "line".
Definition at line 152 of file kgesture.cpp.
QString KShapeGesture::toString | ( | ) | const |
Return a string representation of this gesture.
Return empty string if invalid. This function is mainly for use with config files.
- See also
- shapeName()
Definition at line 164 of file kgesture.cpp.
QByteArray KShapeGesture::toSvg | ( | const QString & | attributes = QString() | ) | const |
Return an idealized SVG image of this gesture.
Return an empty image if invalid.
- Parameters
-
attributes SVG attributes to apply to the SVG "path" element that makes up the drawing of the gesture. By default, only a 'fill="none"' attribute will be set.
Definition at line 184 of file kgesture.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.