Classes | |
| class | IdentifierValidator |
| class | LongLongValidator |
| class | StyleProxy |
| class | WaitCursor |
| class | WaitCursorRemover |
| class | Validator |
| class | MultiValidator |
Enumerations | |
| enum | CopyFileResult { CopySuccess = 0 , CopyReadError = 1 , CopyWriteError = 2 } |
Functions | |
| KEXIUTILS_EXPORT bool | isIdentifier (const TQString &s) |
| KEXIUTILS_EXPORT TQString | string2Identifier (const TQString &s) |
| KEXIUTILS_EXPORT TQString | identifierExpectedMessage (const TQString &valueName, const TQVariant &v) |
| KEXIUTILS_EXPORT TQString | string2FileName (const TQString &s) |
| bool | hasParent (TQObject *par, TQObject *o) |
| template<class type> | |
| type * | findParent (TQObject *o, const char *className) |
| template<class type> | |
| const type * | findParentConst (const TQObject *const o, const char *className) |
| template<class type> | |
| type * | findFirstChild (TQObject *o, const char *className, const char *objName=0) |
| TQDateTime | stringToHackedTQTime (const TQString &s) |
| KEXIUTILS_EXPORT void | setWaitCursor (bool noDelay=false) |
| KEXIUTILS_EXPORT void | removeWaitCursor () |
| KEXIUTILS_EXPORT TQString | fileDialogFilterString (const KMimeType::Ptr &mime, bool kdeFormat=true) |
| KEXIUTILS_EXPORT TQString | fileDialogFilterString (const TQString &mimeString, bool kdeFormat=true) |
| KEXIUTILS_EXPORT TQString | fileDialogFilterStrings (const TQStringList &mimeStrings, bool kdeFormat) |
| KEXIUTILS_EXPORT TQColor | blendedColors (const TQColor &c1, const TQColor &c2, int factor1=1, int factor2=1) |
| KEXIUTILS_EXPORT TQColor | contrastColor (const TQColor &c) |
| KEXIUTILS_EXPORT TQColor | bleachedColor (const TQColor &c, int factor) |
| KEXIUTILS_EXPORT TQIconSet | colorizeIconToTextColor (const TQPixmap &icon, const TQPalette &palette) |
| KEXIUTILS_EXPORT TQPixmap | emptyIcon (TDEIcon::Group iconGroup) |
| KEXIUTILS_EXPORT void | serializeMap (const TQMap< TQString, TQString > &map, const TQByteArray &array) |
| KEXIUTILS_EXPORT void | serializeMap (const TQMap< TQString, TQString > &map, TQString &string) |
| KEXIUTILS_EXPORT TQMap< TQString, TQString > | deserializeMap (const TQByteArray &array) |
| KEXIUTILS_EXPORT TQMap< TQString, TQString > | deserializeMap (const TQString &string) |
| KEXIUTILS_EXPORT TQString | stringToFileName (const TQString &string) |
| KEXIUTILS_EXPORT void | simpleCrypt (TQString &string) |
| KEXIUTILS_EXPORT void | simpleDecrypt (TQString &string) |
| KEXIUTILS_EXPORT void | drawPixmap (TQPainter &p, int lineWidth, const TQRect &rect, const TQPixmap &pixmap, int alignment, bool scaledContents, bool keepAspectRatio) |
| KEXIUTILS_EXPORT TQString | ptrToStringInternal (void *ptr, uint size) |
| KEXIUTILS_EXPORT void * | stringToPtrInternal (const TQString &str, uint size) |
| template<class type> | |
| TQString | ptrToString (type *ptr) |
| template<class type> | |
| type * | stringToPtr (const TQString &str) |
| KEXIUTILS_EXPORT void | setFocusWithReason (TQWidget *widget, TQFocusEvent::Reason reason) |
| KEXIUTILS_EXPORT void | unsetFocusWithReason (TQWidget *widget, TQFocusEvent::Reason reason) |
| KEXIUTILS_EXPORT CopyFileResult | copyFile (const TQString &src, const TQString &dest) |
Detailed Description
General Utils.
Enumeration Type Documentation
◆ CopyFileResult
Used by copyFile().
Definition at line 243 of file kexiutils/utils.h.
Function Documentation
◆ bleachedColor()
| TQColor KexiUtils::bleachedColor | ( | const TQColor & | c, |
| int | factor ) |
- Returns
- a lighter color for a color c and a factor factor. For colors like TQt::red or TQt::green where hue and saturation are near to 255, hue is decreased so the result will be more bleached. For black color the result is dark gray rather than black.
Definition at line 162 of file kexiutils/utils.cpp.
◆ blendedColors()
| TQColor KexiUtils::blendedColors | ( | const TQColor & | c1, |
| const TQColor & | c2, | ||
| int | factor1 = 1, | ||
| int | factor2 = 1 ) |
- Returns
- a color being a result of blending c1 with c2 with factor1 and factor1 factors: (c1*factor1+c2*factor2)/(factor1+factor2).
Definition at line 142 of file kexiutils/utils.cpp.
◆ colorizeIconToTextColor()
| TQIconSet KexiUtils::colorizeIconToTextColor | ( | const TQPixmap & | icon, |
| const TQPalette & | palette ) |
- Returns
- icon set computed as a result of colorizing icon pixmap with "buttonText" color of palette palette. This function is useful for displaying monochromed icons on the list view or table view header, to avoid bloat, but still have the color compatible with accessibility settings.
Definition at line 177 of file kexiutils/utils.cpp.
◆ contrastColor()
| TQColor KexiUtils::contrastColor | ( | const TQColor & | c | ) |
- Returns
- a contrast color for a color c: If c is light color, darker color created using c.dark(200) is returned; otherwise lighter color created using c.light(200) is returned.
Definition at line 150 of file kexiutils/utils.cpp.
◆ copyFile()
| CopyFileResult KexiUtils::copyFile | ( | const TQString & | src, |
| const TQString & | dest ) |
Copies src file to dest file.
- Returns
- CopySuccess on success, CopyReadError on source file error, CopyWriteError on destination file error.
Definition at line 391 of file kexiutils/utils.cpp.
◆ deserializeMap() [1/2]
| TQMap< TQString, TQString > KexiUtils::deserializeMap | ( | const TQByteArray & | array | ) |
- Returns
- a map deserialized from a byte array array. array need to contain data previously serialized using KexiUtils::serializeMap().
Definition at line 216 of file kexiutils/utils.cpp.
◆ deserializeMap() [2/2]
| TQMap< TQString, TQString > KexiUtils::deserializeMap | ( | const TQString & | string | ) |
- Returns
- a map deserialized from string. string need to contain data previously serialized using KexiUtils::serializeMap().
Definition at line 224 of file kexiutils/utils.cpp.
◆ drawPixmap()
| void KexiUtils::drawPixmap | ( | TQPainter & | p, |
| int | lineWidth, | ||
| const TQRect & | rect, | ||
| const TQPixmap & | pixmap, | ||
| int | alignment, | ||
| bool | scaledContents, | ||
| bool | keepAspectRatio ) |
Draws pixmap on painter p using predefined parameters. Used in KexiDBImageBox and KexiBlobTableEdit.
- Todo
- we can optimize drawing by drawing rescaled pixmap here and performing detailed painting later (using TQTimer)
- Todo
- only create buffered pixmap of the minimum size and then do not fillRect()
Definition at line 257 of file kexiutils/utils.cpp.
◆ emptyIcon()
| TQPixmap KexiUtils::emptyIcon | ( | TDEIcon::Group | iconGroup | ) |
- Returns
- empty (fully transparent) pixmap that can be used as a place for icon of size iconGroup
Definition at line 187 of file kexiutils/utils.cpp.
◆ fileDialogFilterString() [1/2]
| TQString KexiUtils::fileDialogFilterString | ( | const KMimeType::Ptr & | mime, |
| bool | kdeFormat = true ) |
- Returns
- filter string in TQFileDialog format for a mime type pointed by mime If kdeFormat is true, TQFileDialog-compatible filter string is generated, eg. "Image files (*.png *.xpm *.jpg)", otherwise KFileDialog -compatible filter string is generated, eg. "*.png *.xpm *.jpg|Image files (*.png *.xpm *.jpg)". "\\n" is appended if kdeFormat is true, otherwise ";;" is appended.
Definition at line 98 of file kexiutils/utils.cpp.
◆ fileDialogFilterString() [2/2]
| TQString KexiUtils::fileDialogFilterString | ( | const TQString & | mimeString, |
| bool | kdeFormat = true ) |
Definition at line 127 of file kexiutils/utils.cpp.
◆ fileDialogFilterStrings()
| TQString KexiUtils::fileDialogFilterStrings | ( | const TQStringList & | mimeStrings, |
| bool | kdeFormat ) |
Like TQString fileDialogFilterString(const KMimeType::Ptr& mime, bool kdeFormat = true) but returns a list of filter strings.
Definition at line 133 of file kexiutils/utils.cpp.
◆ findFirstChild()
| type * KexiUtils::findFirstChild | ( | TQObject * | o, |
| const char * | className, | ||
| const char * | objName = 0 ) |
- Returns
- first found child of o, inheriting className. If objName is 0 (the default), all object names match. Returned pointer type is casted.
Definition at line 70 of file kexiutils/utils.h.
◆ findParent()
|
inline |
- Returns
- parent object of o that inherits className or NULL if no such parent
Definition at line 45 of file kexiutils/utils.h.
◆ findParentConst()
|
inline |
Const version of findParent().
Definition at line 56 of file kexiutils/utils.h.
◆ hasParent()
|
inline |
- Returns
- true if o has parent par.
Definition at line 34 of file kexiutils/utils.h.
◆ identifierExpectedMessage()
| TQString KexiUtils::identifierExpectedMessage | ( | const TQString & | valueName, |
| const TQVariant & | v ) |
- Returns
- useful message "Value of "valueName" column must be an identifier. "v" is not a valid identifier.". It is also used by IdentifierValidator.
Definition at line 88 of file identifier.cpp.
◆ isIdentifier()
| bool KexiUtils::isIdentifier | ( | const TQString & | s | ) |
- Returns
- true if s is a valid identifier, ie. starts with a letter or '' character and contains only letters, numbers and '' character.
Definition at line 26 of file identifier.cpp.
◆ ptrToString()
| TQString KexiUtils::ptrToString | ( | type * | ptr | ) |
- Returns
- a pointer ptr safely serialized to string
Definition at line 224 of file kexiutils/utils.h.
◆ ptrToStringInternal()
| TQString KexiUtils::ptrToStringInternal | ( | void * | ptr, |
| uint | size ) |
Definition at line 349 of file kexiutils/utils.cpp.
◆ removeWaitCursor()
| void KexiUtils::removeWaitCursor | ( | ) |
Remove "wait" cursor previously set with setWaitCursor(), even if it's not yet visible. Does nothing if the application has no GUI enabled. (see TDEApplication::guiEnabled())
Definition at line 69 of file kexiutils/utils.cpp.
◆ serializeMap() [1/2]
| void KexiUtils::serializeMap | ( | const TQMap< TQString, TQString > & | map, |
| const TQByteArray & | array ) |
Serializes map to array. KexiUtils::deserializeMap() can be used to deserialize this array back to map.
Definition at line 196 of file kexiutils/utils.cpp.
◆ serializeMap() [2/2]
| void KexiUtils::serializeMap | ( | const TQMap< TQString, TQString > & | map, |
| TQString & | string ) |
Definition at line 202 of file kexiutils/utils.cpp.
◆ setFocusWithReason()
| void KexiUtils::setFocusWithReason | ( | TQWidget * | widget, |
| TQFocusEvent::Reason | reason ) |
Sets focus for widget widget with reason reason.
Definition at line 375 of file kexiutils/utils.cpp.
◆ setWaitCursor()
| void KexiUtils::setWaitCursor | ( | bool | noDelay = false | ) |
Sets "wait" cursor with 1 second delay (or 0 seconds if noDelay is true). Does nothing if the application has no GUI enabled. (see TDEApplication::guiEnabled())
Definition at line 65 of file kexiutils/utils.cpp.
◆ simpleCrypt()
| void KexiUtils::simpleCrypt | ( | TQString & | string | ) |
Performs a simple string encryption using rot47-like algorithm. Each character's unicode value is increased by 47 + i (where i is index of the character). The resulting string still contains redable characters. Do not use this for data that can be accessed by attackers!
Definition at line 245 of file kexiutils/utils.cpp.
◆ simpleDecrypt()
| void KexiUtils::simpleDecrypt | ( | TQString & | string | ) |
Performs a simple string decryption using rot47-like algorithm, using opposite operations to KexiUtils::simpleCrypt().
Definition at line 251 of file kexiutils/utils.cpp.
◆ string2FileName()
| TQString KexiUtils::string2FileName | ( | const TQString & | s | ) |
- Returns
- Valid filename based on s
Definition at line 37 of file identifier.cpp.
◆ string2Identifier()
| TQString KexiUtils::string2Identifier | ( | const TQString & | s | ) |
- Returns
- valid identifier based on s. Non-alphanumeric characters (or spaces) are replaced with ''. If a number is at the beginning, '' is added at start. Empty strings are not changed. Case remains unchanged.
Definition at line 54 of file identifier.cpp.
◆ stringToFileName()
| TQString KexiUtils::stringToFileName | ( | const TQString & | string | ) |
- Returns
- a valid filename converted from string by:
- replacing \, /, :, *, ?, ", <, >, |,
\t characters with a space - simplifing whitespace by removing redundant space characters using TQString::simplifyWhiteSpace() Do not pass full paths here, but only filename strings.
- replacing \, /, :, *, ?, ", <, >, |,
Definition at line 238 of file kexiutils/utils.cpp.
◆ stringToHackedTQTime()
|
inline |
TQDateTime - a hack needed because TQVariant(TQTime) has broken isNull().
Definition at line 81 of file kexiutils/utils.h.
◆ stringToPtr()
| type * KexiUtils::stringToPtr | ( | const TQString & | str | ) |
- Returns
- a pointer of type type safely deserialized from str
Definition at line 231 of file kexiutils/utils.h.
◆ stringToPtrInternal()
| void * KexiUtils::stringToPtrInternal | ( | const TQString & | str, |
| uint | size ) |
Definition at line 361 of file kexiutils/utils.cpp.
◆ unsetFocusWithReason()
| void KexiUtils::unsetFocusWithReason | ( | TQWidget * | widget, |
| TQFocusEvent::Reason | reason ) |
Unsets focus for widget widget with reason reason.
Definition at line 383 of file kexiutils/utils.cpp.
