[partition] Qt6 conversion completed

adjust QMouseEvents, update CHANGES
This commit is contained in:
demmm 2023-09-07 18:10:21 +02:00
parent 07e5a3a113
commit b8dd4ef20a
2 changed files with 13 additions and 0 deletions

View File

@ -17,6 +17,7 @@ Frameworks are required as well, and those need to be Qt6-based as well.
This release contains contributions from (alphabetically by first name):
- Adriaan de Groot
- Anke Boersma
- Hector Martin
- Ivan Borzenkov

View File

@ -340,7 +340,11 @@ PartitionSplitterWidget::mousePressEvent( QMouseEvent* event )
{
if ( m_itemToResize && m_itemToResizeNext && event->button() == Qt::LeftButton )
{
#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
if ( qAbs( event->x() - m_resizeHandleX ) < HANDLE_SNAP )
#else
if ( qAbs( event->position().x() - m_resizeHandleX ) < HANDLE_SNAP )
#endif
{
m_resizing = true;
}
@ -393,7 +397,11 @@ PartitionSplitterWidget::mouseMoveEvent( QMouseEvent* event )
int ew = rect().width(); //effective width
qreal bpp = total / static_cast< qreal >( ew ); //bytes per pixel
#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
qreal mx = event->x() * bpp - start;
#else
qreal mx = event->position().x() * bpp - start;
#endif
// make sure we are within resize range
mx = qBound( static_cast< qreal >( m_itemMinSize ), mx, static_cast< qreal >( m_itemMaxSize ) );
@ -428,7 +436,11 @@ PartitionSplitterWidget::mouseMoveEvent( QMouseEvent* event )
{
if ( m_itemToResize && m_itemToResizeNext )
{
#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
if ( qAbs( event->x() - m_resizeHandleX ) < HANDLE_SNAP )
#else
if ( qAbs( event->position().x() - m_resizeHandleX ) < HANDLE_SNAP )
#endif
{
setCursor( Qt::SplitHCursor );
}