In the following code there is clearly enough space for the label to fit on one line, but for some reason it splits it into two lines after 'thats'. Why and how do I prevent this?
Widget::Widget(QWidget *parent)
: QWidget(parent)
{
this->setFixedSize(250,100);
QLabel *label = new QLabel;
label->setStyleSheet("background-color:blue");
label->setWordWrap(true);
label->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
label->setText("Oh my gosh thats too funny!");
label->setParent(this);
}
Again for clarity, it shows:
Oh my gosh thats too funny!
And I want:
Oh my gosh thats too funny!