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

QTabBar stylesheet property "alignment" not working

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.2
    • Widgets: Style Sheets
    • None
    • Debian 11 using Qt Creator 4.14.1 and the Qt libraries packaged with the distribution and LXQt 0.16.0.
    • Linux/X11

    Description

      Hi, I'm trying to display a QTabBar where the tabs are right-aligned instead of the platform default (left).

      I put the following in my mainwindow.cpp after the call to ui->setupUi():

      ui>tabBar>setExpanding(false);
      ui>tabBar>setStyleSheet("QTabBar{alignment:right;}");

      However, instead of aligning the tabs to the right, they are now centered. It turns out they are always centered when I apply a stylesheet with an alignment property, no matter if I set "alignment: left", "alignment: center" or "alignment: right".

      Am I doing anything wrong or doesn't QTabBar properly support the alignment property?

      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
            klickklack Peter Ransel
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes