Forum
Sign Up

QTitanRibbon 6.5.0 breaks viewport resize in QAbstractScrollArea

10 months 1 week ago #1 by Mathias
Hi,

We use QTitanRibbon in an application that we resently upgraded from Qt5.15.2 and QTitanRibbon5.9.0 to Qt6.5.0 and QTitanRibbon6.5.0.

Since this change we see a different behavior in classes that are derived from QAbstractScrollArea. In particular we see that the viewport of the QAbstractScrollArea is not shrunk, if the scrollbar is shown. Instead, the scrollbar overlaps the viewport and covers parts of the content.

Here is a minimal example that illustrates the problem. It sets a QTableWidget with 20 rows and 2 columns as the central widget of a RibbonMainWindow and adds an empty page to the ribbonBar.
#include <QApplication>
#include <QHeaderView>
#include <QTableWidget>

#include <QtitanRibbon.h>
#include <QtnRibbonMainWindow.h>

class MainWindow : public RibbonMainWindow
{
  Q_OBJECT

 public:
  MainWindow()
      : RibbonMainWindow()
  {

    auto tableWidget = new QTableWidget( 20, 2, this );
    tableWidget->horizontalHeader()->setSectionResizeMode( QHeaderView::Stretch );

    for ( int row = 0; row < tableWidget->rowCount(); ++row )
      {
        for ( int column = 0; column < tableWidget->columnCount(); ++column )
          {
            QTableWidgetItem* newItem = new QTableWidgetItem( tr( "%1" ).arg( ( row + 1 ) * ( column + 1 ) ) );
            newItem->setTextAlignment( Qt::AlignRight );
            tableWidget->setItem( row, column, newItem );
          }
      }

    setCentralWidget( tableWidget );
    setWindowTitle( tr( "TableView Test" ) );

    // This line causes the scrollbar to overlap the viewport of the tableWidget.
    // Comment out to get tableWidget with non-overlapping scrollbar
    ribbonBar()->addPage( tr( "First Page" ) );
  }
};

int main( int argc, char* argv[] )
{
  QApplication app( argc, argv );
  MainWindow mw;
  mw.show();
  return app.exec();
}

#include "main.moc"

Using Qt5.15.2 and QTitanRibbon5.9.0 gives the properly resized viewport as shown in QTitanRibbon5.9.0.png.


But when I run this example with Qt6.5.0, QTitanRibbon6.5.0 the QTableWidget is shown with a vertical scrollbar that covers up the content of the right-most column. See QTitanRibbon6.5.0.png.


Is there an option in QTitanRibbon6.5.0 to get the shrinking of the viewport or is this a bug?
Attachments:

Please Log in or Create an account to join the conversation.

More
10 months 11 hours ago #2 by Mathias
@ Developer Machines

Could you reproduce this issue? Is this a bug in QTitanRibbon 6.5.0?

Please Log in or Create an account to join the conversation.

More
4 months 4 weeks ago #3 by Mathias
We found the following workaround to restore the expected scrollbar behavior.

Setting the geometry of the scrollbars by defining a style sheet works for us.
horizontalScrollBar()->setStyleSheet("QScrollBar {height:15px;}");
verticalScrollBar()->setStyleSheet("QScrollBar {width:15px;}");

15px is the default width of scrollbars. Note that for the horizontal scrollbar the height property has to be set.

Please Log in or Create an account to join the conversation.

More
4 months 3 weeks ago #4 by Developer Machines
This looks more like the problem in Qt6.5. If we exclude the ribon bar from the project, is the problem disappears for Qt6.5? Could you run the test at your environemnt for QtitanRibbon 6.5 and Qt5.15.2?

Please Log in or Create an account to join the conversation.

More
4 months 3 weeks ago #5 by Mathias
I have tried the following combinations:
- QtitanRibbon 6.5 compiled with Qt6.5.2
- QtitanRibbon 6.5 compiled with Qt5.15.2

Both combinations give the same behavior as described in the initial post. I.e. the scrollbar overlaps the table.

For both combinations the issue disappears, if the ribbonBar() call is commented out.

Have you tried to reproduce the issue with the example from the initial post?

PS: Another post on this forum seems to have a similar problem. See here: www.devmachines.com/forum/qtitandocking/...dockwidgetpanel.html

Please Log in or Create an account to join the conversation.

More
4 months 3 weeks ago #6 by Developer Machines
Thanks for the tip. Indeed, in version QtitanRibbon 6.5 a bug exists. But it has already been fixed in version 6.6, which we plan to publish this month. If you need a fix right now, please email to This email address is being protected from spambots. You need JavaScript enabled to view it. and we will send you the current source trunk for QtitanRibbon 6.6 immediately so you can check.

Please Log in or Create an account to join the conversation.

More
  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to edit your message.
Moderators: Developer Machines
Time to create page: 0.167 seconds

Developer Newsletter

Join our Developer Machines newsletter to get informed on all the latest releases of the commercial components for Qt.C++, Delphi FireMonkey, updates and general knowledges.

Quick Support

Should you need any additional information about our products or licensing, please contact us at the following email addresses:

  • This email address is being protected from spambots. You need JavaScript enabled to view it.

  • This email address is being protected from spambots. You need JavaScript enabled to view it.

Get in Touch

If you would like to purchase our products or services, but don’t know how to do it the right way, please feel free to contact us:

  • This email address is being protected from spambots. You need JavaScript enabled to view it.( any questions related to our products or services )
  • This email address is being protected from spambots. You need JavaScript enabled to view it.( questions related to licensing )