Details
-
Bug
-
Resolution: Cannot Reproduce
-
P2: Important
-
4.3.1
-
None
Description
Setting the font of a QTabBar can make the text not appear perfectly vertically aligned on the QTabBar.
Reproducible with the following example:
- In the QTabBar with the reduced, when comparing the space in the label the font size above letter "S" in the Tab label it seems to be have about 1 pixel more in the space above the letter and the edge of the QTabBar compared to the space below the S letter and the edge of the QTabBar. It would be expected that the letters were perfectly vertically centered.
#include <QtGui>
#include <QDebug>
#include <QMacStyle>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QWidget widget;
QVBoxLayout layout(&widget);
QTabBar* tabBar = new QTabBar();
tabBar->addTab("Sequence");
tabBar->addTab("Map");
tabBar->addTab("Restriction Sites");
QFont smallerFont = app.font();
smallerFont.setPixelSize(11);
tabBar->setFont(smallerFont);
tabBar->show();
QTabBar* tabBar2 = new QTabBar();
tabBar2->addTab("Sequence");
tabBar2->addTab("Map");
tabBar2->addTab("Restriction Sites");
tabBar2->show();
layout.addWidget(tabBar);
layout.addWidget(tabBar2);
widget.show();
return app.exec();
}