I'm trying to use documentMode style tabs on Mac.
MainWindow::MainWindow()
{
setDocumentMode(true);
tabs->setDocumentMode(true);
QLabel *lbl
= new QLabel(tr
("Titlebar and Tabs are Not Seamless"));
lbl->setAlignment(Qt::AlignCenter);
tabs->addTab(lbl, tr("Hello"));
lbl
= new QLabel(tr
("Bummer"));
lbl->setAlignment(Qt::AlignCenter);
tabs->addTab(lbl, tr("World"));
setCentralWidget(tabs);
setWindowTitle(tr("Test"));
}
MainWindow::MainWindow()
: QMainWindow()
{
setDocumentMode(true);
QTabWidget *tabs = new QTabWidget();
tabs->setDocumentMode(true);
QLabel *lbl = new QLabel(tr("Titlebar and Tabs are Not Seamless"));
lbl->setAlignment(Qt::AlignCenter);
tabs->addTab(lbl, tr("Hello"));
lbl = new QLabel(tr("Bummer"));
lbl->setAlignment(Qt::AlignCenter);
tabs->addTab(lbl, tr("World"));
setCentralWidget(tabs);
setWindowTitle(tr("Test"));
}
To copy to clipboard, switch view to plain text mode
Problem is, I'm not getting the smooth look that I'm expecting. Here's how it looks (there is not supposed to be a division between the window's titlebar and the tabs... they are supposed to be seamlessly butted up against eachother).
This Qt Labs blog post from 2008 shows how it is supposed to look (see the apparently "merged" titlebar and tabs in the window with the foreign text). http://labs.trolltech.com/blogs/2008...abwidget-love/
Does anyone know what I am doing wrong?
I have also tried the following, which do not fix it...
- setUnifiedTitleAndToolBarOnMac(true)
- setMargin(0) on the labels
- using a QFrame instead of a QMainWindow
- pulling my hair out
Thanks for your help!!
Bookmarks