I'd like to make QPushButton
word wrap and expand it's height instead of expanding width. How can I do that?
I have solved the problem with wordwrap on a button this way:
QPushButton *createQPushButtonWithWordWrap(QWidget *parent, const QString &text)
{
auto btn = new QPushButton(parent);
auto label = new QLabel(text,btn);
label->setWordWrap(true);
auto layout = new QHBoxLayout(btn);
layout->addWidget(label,0,Qt::AlignCenter);
return btn;
}