Hi,

I have a small issue with QStatusBar. It seems to have a bit bigger height than it is supposed to:
Capture.PNG
Here's the code that creates it:
Qt Code:
  1. QToolButton *abt = new QToolButton(this);
  2. abt->setDefaultAction(aboutAction);
  3.  
  4. QLabel *gridSpacingLabel = new QLabel(tr(" Grid Spacing: 20"));
  5. QLabel *xPosLabel = new QLabel(tr(" X: 640 "));
  6. QLabel *yPosLabel = new QLabel(tr(" Y: 640 "));
  7. QLabel *widthLabel = new QLabel(tr(" Width: 640 "));
  8. QLabel *heightLabel = new QLabel(tr(" Height: 480 "));
  9. QLabel *unsavedDataLabel = new QLabel();
  10. QPixmap pixmap(":changes.png");
  11. unsavedDataLabel->setPixmap(pixmap);
  12.  
  13. statusBar()->addPermanentWidget(abt);
  14. statusBar()->addPermanentWidget(gridSpacingLabel);
  15. statusBar()->addPermanentWidget(xPosLabel);
  16. statusBar()->addPermanentWidget(yPosLabel);
  17. statusBar()->addPermanentWidget(widthLabel);
  18. statusBar()->addPermanentWidget(heightLabel);
  19. statusBar()->addPermanentWidget(unsavedDataLabel);
To copy to clipboard, switch view to plain text mode 

I tried the following (separately) and other sizePolicy combinations but none seem to remove that strip at the top.
Qt Code:
  1. statusBar()->setMaximumHeight(20);
  2. statusBar()->layout()->setContentsMargins(0,0,0,0);
  3. statusBar()->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
To copy to clipboard, switch view to plain text mode 

I am looking for something like this (from Notepad++):
Capture2.PNG