T
T
tschin2015-12-12 11:43:06
Qt
tschin, 2015-12-12 11:43:06

How to make a frame around text in Qt in Qt?

Hello! Tried to make a frame around text in QLabel. Did it like this:

QString text = "bla-bla-bla";
QString addText="<p style='border: 1px solid red; padding: 5px;'>"+text+"</p>";
ui->label->setText(addText);

The frame didn't show up. Tried using styleSheet to do this:
QString style = "border: 1px solid red; padding: 5px;";
ui->label->setStyleSheet(style);

No reaction either...
So how do I make a frame around the text in QLabel in Qt?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
Jacob E, 2015-12-12
@tschin

How to make border in QLabel text?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question