X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_Tools.h;h=1f55bec750a28fb7a9e5b04df2273543c3ff44e6;hb=676e0178fdedf35ba607ef9d4f02d871dd06fa28;hp=1d5a448c66fd48634ba1ec5d94fc2e45b3f14cc4;hpb=efaa3e56c591f0b6a0e018cc91027ff5f82b2438;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_Tools.h b/src/ModuleBase/ModuleBase_Tools.h index 1d5a448c6..1f55bec75 100644 --- a/src/ModuleBase/ModuleBase_Tools.h +++ b/src/ModuleBase/ModuleBase_Tools.h @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // File: ModuleBase_Tools.h // Created: 11 July 2014 // Author: Vitaly Smetannikov @@ -7,8 +9,11 @@ #include "ModuleBase.h" +#include + class QWidget; class QLayout; +class QDoubleSpinBox; namespace ModuleBase_Tools { @@ -22,6 +27,36 @@ MODULEBASE_EXPORT void zeroMargins(QWidget* theWidget); MODULEBASE_EXPORT void zeroMargins(QLayout* theLayout); +/** + * \ingroup GUI + * Methods to modify a resource pixmap + */ + +//! Create composite pixmap. +//! Pixmap \a theAdditionalIcon is drawn over pixmap \a dest with coordinates +//! specified relatively to the upper left corner of \a theIcon. + +//! \param theAdditionalIcon resource text of the additional pixmap +//! \param theIcon resource text of the background pixmap +//! \return resulting pixmap +MODULEBASE_EXPORT QPixmap composite(const QString& theAdditionalIcon, const QString& theIcon); + +//! Generates the pixmap lighter than the resources pixmap. +//! Pixmap \a theIcon is lighted according to the given value. +//! If the lighter value is greater than 100, this functions returns a lighter pixmap. +//! Setting lighter value to 150 returns a color that is 50% brighter. If the factor is less than 100, +//! the return pixmap is darker. If the factor is 0 or negative, the return pixmap is unspecified. + +//! \param resource text of the pixmap +//! \param theLighterValue a lighter factor +//! \return resulting pixmap +MODULEBASE_EXPORT QPixmap lighter(const QString& theIcon, const int theLighterValue = 200); + +/// Sets programmatically the value to the spin box without emitting any signals(e.g. valueChanged) +/// \param theSpin an X or Y coordinate widget +/// \param theValue a new value +MODULEBASE_EXPORT void setSpinValue(QDoubleSpinBox* theSpin, double theValue); + } #endif