Dynamic font size QPushButton and QLabel
Implemented dynamic font size according to defined widget size and accounts for QLabel new lines. Tested with Qt5/Android, Qt5/Linux and Qt4. Tested with QSizePolicy::MinimumExpanding and QSizePolicy::Fixed.
- Added setTextColor (Altought it overwrites stylesheets).
- Added click signal
- Added setTextColor (Altought it overwrites stylesheets).
Use QtDesigner guide found in http://doc.qt.io/qt-5/designer-using-custom-widgets.html
Open example/ project to see in action. A box frame is set in example to make it clear.
- Add/Improve examples
- Self tests?
- Improve size fitting algorithm
- Add other components
Main inspiration: http://www.qtforum.org/article/32092/dynamic-font-size-in-qlabel-based-on-text-length.html
Other useful link
DynamicFontSizeLabel initial version was developed inside Exacta Balanças ( @exactabal ) which gently opened code as retribution to great work done by many Open Source projects.