Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CAF_Tools Class Reference

Prodives a set of helpful static methods.

#include <CAF_Tools.h>

Inheritance diagram for CAF_Tools:
Inheritance graph

Static Public Member Functions

static QString toQString (const TCollection_AsciiString &)
 Convert TCollection_AsciiString src to QString. More...
 
static QString toQString (const TCollection_ExtendedString &)
 Convert TCollection_ExtendedString src to QString. More...
 
static TCollection_ExtendedString toExtString (const QString &)
 Convert QString src to TCollection_ExtendedString. More...
 
static TCollection_AsciiString toAsciiString (const QString &)
 Convert QString src to TCollection_AsciiString. More...
 
static Quantity_Color color (const QColor &)
 Convert QColor object to Quantity_Color object. More...
 
static QColor color (const Quantity_Color &)
 Convert Quantity_Color object to QColor object. More...
 
- Static Public Member Functions inherited from SUIT_Tools
static void trace (const char *pLog, const char *szFormat,...)
 Traces output to log-file. More...
 
static QRect makeRect (const int x1, const int y1, const int x2, const int y2)
 
static QString fontToString (const QFont &font)
 
static void centerWidget (QWidget *src, const QWidget *ref)
 
- Static Public Member Functions inherited from Qtx
static QString toQString (const char *, const int=-1)
 Convert character array (ASCII string) to the QString. More...
 
static QString toQString (const short *, const int=-1)
 Convert integer array (UNICODE string) to the QString. More...
 
static QString toQString (const unsigned char *, const int=-1)
 Convert character array (ASCII string) to the QString. More...
 
static QString toQString (const unsigned short *, const int=-1)
 Convert integer array (UNICODE string) to the QString. More...
 
static void setTabOrder (QWidget *,...)
 Set tab order for specified list of widgets. More...
 
static void setTabOrder (const QWidgetList &)
 Set tab order for specified list of widgets. More...
 
static void alignWidget (QWidget *, const QWidget *, const int)
 Align widget src relative to widget ref acording to the alignment flags alignFlags. More...
 
static void simplifySeparators (QWidget *, const bool=true)
 Remove (recursively) unnecessary separators from the menu or toolbar. More...
 
static bool isParent (QObject *, QObject *)
 Return true if specified parent is a parent object of given child (in terms of QObject). More...
 
static QObjectfindParent (QObject *, const char *)
 Find the parent object of class specified by className (in terms of QObject). More...
 
static QString dir (const QString &, const bool=true)
 Return directory part of the file path. More...
 
static QString file (const QString &, const bool=true)
 Return file name part of the file path. More...
 
static QString extension (const QString &, const bool=false)
 Return extension part of the file path. More...
 
static QString library (const QString &)
 Convert the given parameter to the platform-specific library name. More...
 
static QString tmpDir ()
 Get the temporary directory name. More...
 
static bool mkDir (const QString &)
 Create directory recursively including all intermediate sub directories. More...
 
static bool rmDir (const QString &)
 Remove directory recursively including all subdirectories and files. More...
 
static bool dos2unix (const QString &)
 Convert text file from DOS format to UNIX. More...
 
static QString addSlash (const QString &)
 Add a slash (platform-specific) to the end of path if it is not already there. More...
 
static QCompleter * pathCompleter (const PathType, const QString &=QString())
 Create path completer which can be used in the widgets to provide auto completions. More...
 
static QString findEnvVar (const QString &, int &, int &)
 Parse given string to retrieve environment variable. More...
 
static QString makeEnvVarSubst (const QString &, const SubstMode=Auto)
 Substitute environment variables by their values. More...
 
static int rgbSet (const QColor &)
 Pack the specified color into integer RGB set. More...
 
static int rgbSet (const int, const int, const int)
 Pack the specified RGB color components into integer RGB set. More...
 
static QColor rgbSet (const int)
 Unpack the specified integer RGB set to the color. More...
 
static void rgbSet (const int, int &, int &, int &)
 Unpack the specified integer RGB set to the three RGB components. More...
 
static QColor scaleColor (const int, const int, const int)
 Return the color specified by the index between min (blue) and max (red). More...
 
static void scaleColors (const int, QColorList &)
 Generate required number of colors aligned from blue to red. More...
 
static QPixmap scaleIcon (const QPixmap &, const unsigned, const unsigned=0)
 Scale the pixmap to the required size. More...
 
static QImage grayscale (const QImage &)
 Convert given image to the grayscale format. More...
 
static QPixmap grayscale (const QPixmap &)
 Convert given pixmap to the grayscale format. More...
 
static QImage transparentImage (const int, const int, const int=-1)
 Create transparent image. More...
 
static QPixmap transparentPixmap (const int, const int, const int=-1)
 Create transparent pixmap. More...
 
static QPixmap composite (const QPixmap &, const int, const int, const QPixmap &=QPixmap())
 Create composite pixmap. More...
 
static QString colorToString (const QColor &)
 Convert color to the string representation. More...
 
static bool stringToColor (const QString &, QColor &)
 Create color from the string representation. More...
 
static QString biColorToString (const QColor &, const int)
 Convert bi-color value to the string representation. More...
 
static bool stringToBiColor (const QString &, QColor &, int &)
 Restore bi-color value from the string representation. More...
 
static QColor mainColorToSecondary (const QColor &, int)
 Compute secondary color value from specified main color and delta. More...
 
static QString gradientToString (const QLinearGradient &)
 Dump linear gradient to the string description. More...
 
static QString gradientToString (const QRadialGradient &)
 Dump radial gradient to the string description. More...
 
static QString gradientToString (const QConicalGradient &)
 Dump conical gradient to the string description. More...
 
static bool stringToLinearGradient (const QString &, QLinearGradient &)
 Create linear gradient from its string representation. More...
 
static bool stringToRadialGradient (const QString &, QRadialGradient &)
 Create radial gradient from its string representation. More...
 
static bool stringToConicalGradient (const QString &, QConicalGradient &)
 Create conical gradient from its string representation. More...
 
static QString backgroundToString (const BackgroundData &)
 Convert background data to the string representation. The resulting string consists of several sub-strings separated by ';' symbol. These sub-strings represent: More...
 
static BackgroundData stringToBackground (const QString &)
 Restore background data from the string representation. More...
 
static long versionToId (const QString &)
 Convert string representation of version identifier to the numerical value. Resulting value can be used for comparison of different versions (lower, higher, equal). More...
 
static QString qtDir (const QString &=QString())
 Get Qt installation directory. More...
 
static QFont stringToFont (const QString &fontDescription)
 
static void * getDisplay ()
 Open the default X display and returns pointer to it. This method is available on Linux only. More...
 
static Qt::HANDLE getVisual ()
 Returns pointer to X visual suitable for 3D rendering. This method is available on Linux only. More...
 

Additional Inherited Members

- Public Types inherited from Qtx
enum  AlignmentFlags {
  AlignLeft = Qt::AlignLeft, AlignLeading = Qt::AlignLeading, AlignRight = Qt::AlignRight, AlignTrailing = Qt::AlignTrailing,
  AlignHCenter = Qt::AlignHCenter, AlignJustify = Qt::AlignJustify, AlignAbsolute = Qt::AlignAbsolute, AlignHorizontal_Mask = Qt::AlignHorizontal_Mask,
  AlignTop = Qt::AlignTop, AlignBottom = Qt::AlignBottom, AlignVCenter = Qt::AlignVCenter, AlignVertical_Mask = Qt::AlignVertical_Mask,
  AlignCenter = Qt::AlignCenter, AlignOutLeft = Qt::AlignVCenter << 2, AlignOutRight = AlignOutLeft << 2, AlignOutTop = AlignOutRight << 2,
  AlignOutBottom = AlignOutTop << 2
}
 Widget alignment flags. More...
 
enum  PathType { PT_OpenFile, PT_SaveFile, PT_Directory }
 Path type, indicates required directory/file operation. More...
 
enum  { AppropriateRole = Qt::UserRole + 100 }
 Custom data roles. More...
 
enum  Appropriate { Shown, Hidden, Toggled }
 
enum  SubstMode { Always, Never, Auto }
 Environment variables substitution mode. More...
 
enum  VisibilityState { ShownState, HiddenState, UnpresentableState }
 object visibility state More...
 
enum  HeaderViewFlags { ShowText = 0x001, ShowIcon = 0x010, ShowAll = ShowText | ShowIcon }
 Header view flags. More...
 
enum  CustomDataType { IdType }
 Type of the custom data (for custom tree model) More...
 
enum  BackgroundMode { NoBackground, ColorBackground, SimpleGradientBackground, CustomGradientBackground }
 Background mode. More...
 
enum  TextureMode { CenterTexture, TileTexture, StretchTexture }
 Texture mode. More...
 

Member Function Documentation

Quantity_Color CAF_Tools::color ( const QColor &  c)
static
Parameters
ccolor object in Qt format
Returns
color object in OCC format
QColor CAF_Tools::color ( const Quantity_Color &  c)
static
Parameters
ccolor object in OCC format
Returns
color object in Qt format
TCollection_AsciiString CAF_Tools::toAsciiString ( const QString &  src)
static
Parameters
srcstring to be converted
Returns
resulting TCollection_AsciiString object
TCollection_ExtendedString CAF_Tools::toExtString ( const QString &  src)
static
Parameters
srcstring to be converted
Returns
resulting TCollection_ExtendedString object
QString CAF_Tools::toQString ( const TCollection_AsciiString &  src)
static
Parameters
srcstring to be converted
Returns
resulting QString object
QString CAF_Tools::toQString ( const TCollection_ExtendedString &  src)
static
Parameters
srcstring to be converted
Returns
resulting QString object

The documentation for this class was generated from the following files: