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 theIcon resource text of the background pixmap
36 //! \return resulting pixmap
37 MODULEBASE_EXPORT QPixmap composite(const QString& theAdditionalIcon, const QString& theIcon);
39 //! Generates the pixmap lighter than the resources pixmap.
40 //! Pixmap \a theIcon is lighted according to the given value.
41 //! If the lighter value is greater than 100, this functions returns a lighter pixmap.
42 //! Setting lighter value to 150 returns a color that is 50% brighter. If the factor is less than 100,
43 //! the return pixmap is darker. If the factor is 0 or negative, the return pixmap is unspecified.
45 //! \param resource text of the pixmap
46 //! \param theLighterValue a lighter factor
47 //! \return resulting pixmap
48 MODULEBASE_EXPORT QPixmap lighter(const QString& theIcon, const int theLighterValue = 200);