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?