Skip to content

valouvaliavlo/DynamicFontSizeWidgets

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DynamicFontSizeWidgets

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.

Components

DynamicFontSizeLabel

  • Added setTextColor (Altought it overwrites stylesheets).
  • Added click signal

DynamicFontSizePushButton

  • Added setTextColor (Altought it overwrites stylesheets).

How to use

Use QtDesigner guide found in http://doc.qt.io/qt-5/designer-using-custom-widgets.html

Example

Open example/ project to see in action. A box frame is set in example to make it clear.

TODO

  • Add/Improve examples
  • Self tests?
  • Improve size fitting algorithm
  • Add other components

Inspiration

Main inspiration: http://www.qtforum.org/article/32092/dynamic-font-size-in-qlabel-based-on-text-length.html

Other useful link

History

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.

About

Dynamic font size QPushButton and QLabel

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 86.1%
  • QMake 13.9%