regular
20th October 2014, 15:34
Hi,
I have a small issue with QStatusBar. It seems to have a bit bigger height than it is supposed to:
10682
Here's the code that creates it:
QToolButton *abt = new QToolButton(this);
abt->setDefaultAction(aboutAction);
QLabel *gridSpacingLabel = new QLabel(tr(" Grid Spacing: 20"));
QLabel *xPosLabel = new QLabel(tr(" X: 640 "));
QLabel *yPosLabel = new QLabel(tr(" Y: 640 "));
QLabel *widthLabel = new QLabel(tr(" Width: 640 "));
QLabel *heightLabel = new QLabel(tr(" Height: 480 "));
QLabel *unsavedDataLabel = new QLabel();
QPixmap pixmap(":changes.png");
unsavedDataLabel->setPixmap(pixmap);
statusBar()->addPermanentWidget(abt);
statusBar()->addPermanentWidget(gridSpacingLabel);
statusBar()->addPermanentWidget(xPosLabel);
statusBar()->addPermanentWidget(yPosLabel);
statusBar()->addPermanentWidget(widthLabel);
statusBar()->addPermanentWidget(heightLabel);
statusBar()->addPermanentWidget(unsavedDataLabel);
I tried the following (separately) and other sizePolicy combinations but none seem to remove that strip at the top.
statusBar()->setMaximumHeight(20);
statusBar()->layout()->setContentsMargins(0,0,0,0);
statusBar()->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
I am looking for something like this (from Notepad++):
10683
I have a small issue with QStatusBar. It seems to have a bit bigger height than it is supposed to:
10682
Here's the code that creates it:
QToolButton *abt = new QToolButton(this);
abt->setDefaultAction(aboutAction);
QLabel *gridSpacingLabel = new QLabel(tr(" Grid Spacing: 20"));
QLabel *xPosLabel = new QLabel(tr(" X: 640 "));
QLabel *yPosLabel = new QLabel(tr(" Y: 640 "));
QLabel *widthLabel = new QLabel(tr(" Width: 640 "));
QLabel *heightLabel = new QLabel(tr(" Height: 480 "));
QLabel *unsavedDataLabel = new QLabel();
QPixmap pixmap(":changes.png");
unsavedDataLabel->setPixmap(pixmap);
statusBar()->addPermanentWidget(abt);
statusBar()->addPermanentWidget(gridSpacingLabel);
statusBar()->addPermanentWidget(xPosLabel);
statusBar()->addPermanentWidget(yPosLabel);
statusBar()->addPermanentWidget(widthLabel);
statusBar()->addPermanentWidget(heightLabel);
statusBar()->addPermanentWidget(unsavedDataLabel);
I tried the following (separately) and other sizePolicy combinations but none seem to remove that strip at the top.
statusBar()->setMaximumHeight(20);
statusBar()->layout()->setContentsMargins(0,0,0,0);
statusBar()->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
I am looking for something like this (from Notepad++):
10683