The following code has enough space for the shortcut to fit on one line, but for some reason it breaks it into two lines after "thats". Why and how to prevent it?
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, this shows:
Oh my gosh thats
too funny!
I want too:
Oh my gosh thats too funny!
source
share