Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
4.6.0
-
None
-
Windows 7, Ubuntu
-
94759a0ed565b21c8dbfb4b12bfe6064f156b410
Description
A text QLabel with word wrapping enabled is clipped when set to fixed size in a single dimension, and constrained for space in the other dimension.
Example (resize the window to see the clipping effect):
#include <QtGui> int main(int argc, char **argv) { QApplication app(argc, argv); QLabel *label = new QLabel("Qt uses standard C++, but makes extensive use of the C pre-processor to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on all major platforms, and has extensive internationalization support. Non-GUI features include SQL database access, XML parsing, thread management, network support and a unified cross-platform API for file handling."); label->setWordWrap(true); label->setFixedWidth(200); label->setStyleSheet("background-color: cyan"); QVBoxLayout *layout = new QVBoxLayout; layout->addWidget(label); layout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Fixed, QSizePolicy::Expanding)); QWidget *widget = new QWidget(); widget->setLayout(layout); widget->show(); return app.exec(); }