Showing posts from November, 2015

Qt Snippet: Rounded corners QPushButton inside QGraphicsScene

QGraphicsScene is a great Qt component allowing to develop full graphics applications (like game for example) in a very easy way. As additional feature is possible to insert a QWidget based object inside the scene through the QGraphicsProxyWidget item.

Qt Snippet: QPushButton with word wrap feature

Qt have two main classes to use as button widget, QPushButton and QToolButton. These classes made the job in a very good way but both miss the word wrap feature. If the button width is not enough for show the entire button text the string is cutted out on sides and this is not a good effect. Word wrap feature allow the control to automatically move part of the text in a new line for allow full view.