1 // File: ModuleBase_Tools.h
2 // Created: 11 July 2014
3 // Author: Vitaly Smetannikov
5 #ifndef ModuleBase_Tools_H
6 #define ModuleBase_Tools_H
8 #include "ModuleBase.h"
15 namespace ModuleBase_Tools {
18 * Methods to adjust margins and spacings.
20 MODULEBASE_EXPORT void adjustMargins(QWidget* theWidget);
21 MODULEBASE_EXPORT void adjustMargins(QLayout* theLayout);
23 MODULEBASE_EXPORT void zeroMargins(QWidget* theWidget);
24 MODULEBASE_EXPORT void zeroMargins(QLayout* theLayout);
28 * Methods to modify a resource pixmap
30 //! Create composite pixmap.
31 //! Pixmap \a theAdditionalIcon is drawn over pixmap \a dest with coordinates
32 //! specified relatively to the upper left corner of \a theIcon.
34 //! \param theAdditionalIcon resource text of the additional pixmap
35 //! \param theXShift horizontal shift
36 //! \param theYShift vertical shift
37 //! \param theIcon resource text of the background pixmap
38 //! \return resulting pixmap
39 MODULEBASE_EXPORT QPixmap composite(const QString& theAdditionalIcon, const int theXShift,
40 const int theYShift, const QString& theIcon);
42 //! Generates the pixmap lighter than the resources pixmap.
43 //! Pixmap \a theIcon is lighted according to the given value.
44 //! If the lighter value is greater than 100, this functions returns a lighter pixmap.
45 //! Setting lighter value to 150 returns a color that is 50% brighter. If the factor is less than 100,
46 //! the return pixmap is darker. If the factor is 0 or negative, the return pixmap is unspecified.
48 //! \param resource text of the pixmap
49 //! \param theLighterValue a lighter factor
50 //! \return resulting pixmap
51 MODULEBASE_EXPORT QPixmap lighter(const QString& theIcon, const int theLighterValue = 200);