Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt - QTabWidget strange behavior - probably bug...



  • Hi guys, I have one question - How to overcome this issue with tabs in tab bar? Look closely onto tab bar - the corner buttons, are not at it's position - one the left side, the tab bar should start at the end of button and on the right side, the tab bar should be as wide as window minus the width of the second button - and that button should be placed into the real corner, isn't it?

    Code:
    @
    QPushButton *menuButton = new QPushButton("...");
    menuButton->setFixedSize(26, 26);
    QPushButton *addButton = new QPushButton("+");
    addButton->setFixedSize(26, 26);

    m_tabWidget->setCornerWidget(menuButton, Qt::TopLeftCorner);
    m_tabWidget->setCornerWidget(addButton);
    m_tabWidget->addTab(new QTextEdit(this), QString("Commander 1"));
    m_tabWidget->addTab(new QTextEdit(this), QString("Commander 2"));
    m_tabWidget->addTab(new QTextEdit(this), QString("Commander 3"));
    m_tabWidget->addTab(new QTextEdit(this), QString("Commander 4"));
    

    @

    !http://i45.tinypic.com/2w2fvvl.png(QTabWidget corner buttons bug)!

    (I have pushed it as a bug.)
    Thanks, Peppy.


Log in to reply