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

QTabWidget: draws extra line in Motif style

XMLWordPrintable

      In Motif style QTabWidget exhibits some strange display choices depending on the TabPosition of the tab widget.

      The following app demonstrates it:

      #include <QApplication>
      #include <QVBoxLayout>
      #include <QMainWindow>
      #include <QWidget>
      #include <QTabWidget>
      #include <QTextEdit>
      #include <QMotifStyle>
      #include <QComboBox>

      class MainWindow : public QMainWindow
      {
      Q_OBJECT
      public:
      MainWindow(QWidget *parent = 0)
      : QMainWindow(parent)
      {
      setCentralWidget(new QWidget(this));
      QVBoxLayout *lay = new QVBoxLayout(centralWidget());

      for (int i=0; i<=QTabWidget::East; ++i) {
      QTabWidget *tw = new QTabWidget(centralWidget());
      tw->setTabPosition((QTabWidget::TabPosition)i);
      for (int i=0; i<2; ++i)

      { QWidget *w = new QWidget(tw); QVBoxLayout *l = new QVBoxLayout(w); l->addItem(new QSpacerItem(1, 1)); QComboBox *box = new QComboBox(w); box->addItem("foo"); l->addWidget(box); l->addItem(new QSpacerItem(1, 1)); tw->addTab(w, "Tab number " + QString::number(i + 1)); }

      lay->addWidget(tw);
      }
      }
      public slots:
      };

      #include "main.moc"

      int main(int argc, char **argv)
      {
      QApplication a(argc, argv);
      a.setStyle(new QMotifStyle);
      MainWindow w;
      w.show();
      return a.exec();
      }

      Notice the line painted above/left of the current tab of the South/East tabs. This isn't consistent and also makes it harder to see which tab is current

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            bjnilsen Bjørn Erik Nilsen
            rve Anders Bakken
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes