Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-74689

QTabWidget / QTabBar still messed up badly in Qt 5.12.2 on macOS

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.11.0, 5.11.2, 5.12.2
    • None
    • macOS 10.13.6 with 10.14 sdk
    • macOS
    • 409e3eab092ae9896f453b69f4b4749e654680bb (qt/qtbase/5.12)

    Description

      Many of the bugs related to QTabBar and QTabWidget already reported for Qt 5.9 through Qt-5.12 are seemingly not fixed in Qt-5.12.2.

      These include: QTBUG-61092 where the close button is missing from every tab even in hover.

      See no_tab_close.png

      The only way I could find to workaround the missing close tab was to:
      {

      TabBar::TabBar(QWidget *parent)
      : QTabBar(parent),
      m_TabManager(parent),
      m_TabIndex(-1)
      {
      #if defined(Q_OS_MAC)
      // work around Qt MacOSX bug missing tab close icons
      // see: https://bugreports.qt.io/browse/QTBUG-61092
      // still broken in document mode in Qt.5.12.2 !!!!
      const QString FORCE_TAB_CLOSE_BUTTON =
      "QTabBar::close-button

      { " "background-image: url(:/qt-project.org/styles/commonstyle/images/standardbutton-closetab-16.png);" "}

      "
      "QTabBar::close-button:hover

      { " "background-image: url(:/qt-project.org/styles/commonstyle/images/standardbutton-closetab-hover-16.png);" "}

      ";
      setStyleSheet(FORCE_TAB_CLOSE_BUTTON);
      #endif
      }

      }

      Use of an Icon image on a QTabBar/QTabWidget Tab messes title text and makes it so eliding is next to worthless. This includes QTBUG-61235, QTBUG-61742, QTBUG-63445, QTBUG-64630.

      See tab_icon_hides_text.png (when elided set to none)

      See image_overlaps_elide.png (when elided)

      If you remove the icon image from the tab (which is the only workaround) then all appears to work properly:

      See okay_without_icon.png
      See okay_elided.png

      So something in qmacstyle_mac.mm seems to be still quite messed up when it comes to using an image in a tab on mac OS with Qt-5.12.2

      Attachments

        1. image_overlaps_elide.png
          image_overlaps_elide.png
          139 kB
        2. no_tab_close.png
          no_tab_close.png
          368 kB
        3. okay_elided.png
          okay_elided.png
          167 kB
        4. okay_without_icon.png
          okay_without_icon.png
          196 kB
        5. qtbug74689.zip
          2 kB
        6. tab_icon_hides_text.png
          tab_icon_hides_text.png
          432 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            kevinhendricks Kevin B. Hendricks
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes