I am trying to insert a very tiny QLabel
into a very tiny QFrame
.
The QFrame
is used as a spacer and I thought it a perfect place to add text.
In code that text would change (in
to mm
). Because mm
is so giant it is clipped...
Yet it seems to me it would fit if I could just get rid of the margins !
So I try:
ui->tinyFrame
is created in Designer... it has geometry 0,0,10,10
QLabel* unitLabel = new QLabel("mm");
unitLabel->setFixedSize(8,8);
unitLabel->setFont(QFont("Arial Narrow", 7));
unitLabel->setMargin(0);
unitLabel->setContentsMargins(0,0,0,0);
QHBoxLayout* unitLayout = new QHBoxLayout();
unitLayout->setSpacing(0); // I try everything
unitLayout->setMargin(0);
unitLayout->setContentsMargins(0,0,0,0);
ui->tinyFrame->setLayout(unitLayout);
ui->tinyFrame->setContentsMargins(0,0,0,0);
unitLayout->addWidget(unitLabel);
What else can I try to remove the space around my little label ?