Results 1 to 2 of 2

Thread: QTabWidget documentMode on mac looks wrong.

  1. #1
    Join Date
    Oct 2009
    Qt products
    MacOS X Unix/X11 Windows

    Default QTabWidget documentMode on mac looks wrong.

    I'm trying to use documentMode style tabs on Mac.

    Qt Code:
    1. MainWindow::MainWindow()
    2. {
    3. setDocumentMode(true);
    5. QTabWidget *tabs = new QTabWidget();
    6. tabs->setDocumentMode(true);
    8. QLabel *lbl = new QLabel(tr("Titlebar and Tabs are Not Seamless"));
    9. lbl->setAlignment(Qt::AlignCenter);
    10. tabs->addTab(lbl, tr("Hello"));
    12. lbl = new QLabel(tr("Bummer"));
    13. lbl->setAlignment(Qt::AlignCenter);
    14. tabs->addTab(lbl, tr("World"));
    16. setCentralWidget(tabs);
    17. setWindowTitle(tr("Test"));
    18. }
    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).

    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!!

  2. #2
    Join Date
    Jan 2006
    Warsaw, Poland
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits

    Default Re: QTabWidget documentMode on mac looks wrong.

    I think what you get is a correct result. If it wasn't, the tabs on the tabbar would be directed upwards and not downwards. You can see the difference here:
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.

Similar Threads

  1. I got it wrong, can't compile
    By been_1990 in forum The Model-View Framework
    Replies: 12
    Last Post: 16th January 2010, 00:00
  2. What's wrong with QxtSqlPackageModel
    By wirasto in forum Qt Programming
    Replies: 2
    Last Post: 12th December 2009, 12:38
  3. What's wrong??
    By dreamer in forum Qt Programming
    Replies: 2
    Last Post: 25th June 2008, 09:07
  4. Help please - what am I doing wrong?
    By Jimmy2775 in forum Qt Programming
    Replies: 6
    Last Post: 6th March 2006, 23:06
  5. what's wrong with my validator?
    By TheKedge in forum Qt Programming
    Replies: 5
    Last Post: 26th January 2006, 22:41

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.