1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ModuleBase_Tools.h
4 // Created: 11 July 2014
5 // Author: Vitaly Smetannikov
7 #ifndef ModuleBase_Tools_H
8 #define ModuleBase_Tools_H
10 #include "ModuleBase.h"
17 namespace ModuleBase_Tools {
20 * Methods to adjust margins and spacings.
22 MODULEBASE_EXPORT void adjustMargins(QWidget* theWidget);
23 MODULEBASE_EXPORT void adjustMargins(QLayout* theLayout);
25 MODULEBASE_EXPORT void zeroMargins(QWidget* theWidget);
26 MODULEBASE_EXPORT void zeroMargins(QLayout* theLayout);
31 * Methods to modify a resource pixmap
34 //! Create composite pixmap.
35 //! Pixmap \a theAdditionalIcon is drawn over pixmap \a dest with coordinates
36 //! specified relatively to the upper left corner of \a theIcon.
38 //! \param theAdditionalIcon resource text of the additional pixmap
39 //! \param theIcon resource text of the background pixmap
40 //! \return resulting pixmap
41 MODULEBASE_EXPORT QPixmap composite(const QString& theAdditionalIcon, const QString& theIcon);
43 //! Generates the pixmap lighter than the resources pixmap.
44 //! Pixmap \a theIcon is lighted according to the given value.
45 //! If the lighter value is greater than 100, this functions returns a lighter pixmap.
46 //! Setting lighter value to 150 returns a color that is 50% brighter. If the factor is less than 100,
47 //! the return pixmap is darker. If the factor is 0 or negative, the return pixmap is unspecified.
49 //! \param resource text of the pixmap
50 //! \param theLighterValue a lighter factor
51 //! \return resulting pixmap
52 MODULEBASE_EXPORT QPixmap lighter(const QString& theIcon, const int theLighterValue = 200);