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

[macOS] QTabBar tab button must be retrieved with button position "QTabBar::ButtonPosition::LeftSide" when tab bar position is set to "QTabWidget::West"

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.8.2
    • None
    • macOS

    Description

      On macOS, when a QTabBar is positioned vertically using "QTabWidget::West", accessing tab buttons using "QTabBar::ButtonPosition::RightSide" returns "nullptr" contrary to Linux and Windows.

      A workaround is to use "QTabBar::ButtonPosition::LeftSide" instead of ""QTabBar::ButtonPosition::RightSide".

      Here is an example of portable code for suppressing the close button of a tab widget :

      QTabWidget* tab_widget = new QTabWidget(this);
      tab_widget->addTab(new QWidget(), "");
      tab_widget->setTabPosition(QTabWidget::West); QTabBar::ButtonPosition button_pos =
      #ifdef __APPLE__
          QTabBar::LeftSide;
      #else
          QTabBar::RightSide;
      #endif
      tab_widget->tabBar()->tabButton(0, button_pos)->deleteLater();
      tab_widget->tabBar()->setTabButton(0, button_pos, nullptr);

      Attachments

        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
            jbl Jean-Baptiste Leonesio
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes