Skip to content
Permalink
Browse files
Fix Qt6 build
  • Loading branch information
nyalldawson committed Nov 3, 2021
1 parent c7ed020 commit b7a1f76dd7b8d5989a9968712f54ec01c90e08b3
@@ -265,7 +265,7 @@ QVariant QgsRuleBased3DRendererModel::data( const QModelIndex &index, int role )
}
else if ( role == Qt::TextAlignmentRole )
{
return Qt::AlignLeft;
return static_cast<Qt::Alignment::Int>( Qt::AlignLeft );
}
else if ( role == Qt::FontRole && index.column() == 1 )
{
@@ -90,7 +90,7 @@ QVariant QgsReportSectionModel::data( const QModelIndex &index, int role ) const

case Qt::TextAlignmentRole:
{
return ( index.column() == 2 || index.column() == 3 ) ? Qt::AlignRight : Qt::AlignLeft;
return ( index.column() == 2 || index.column() == 3 ) ? static_cast<Qt::Alignment::Int>( Qt::AlignRight ) : static_cast<Qt::Alignment::Int>( Qt::AlignLeft );
}

case Qt::EditRole:
@@ -196,7 +196,7 @@ QVariant QgsLocatorFiltersModel::data( const QModelIndex &index, int role ) cons

case Qt::TextAlignmentRole:
if ( index.column() == Config )
return Qt::AlignCenter;
return static_cast<Qt::Alignment::Int>( Qt::AlignCenter );
break;

}
@@ -488,13 +488,13 @@ QVariant QgsPointCloudAttributeStatisticsModel::data( const QModelIndex &index,
switch ( index.column() )
{
case Name:
return QVariant( Qt::AlignLeft | Qt::AlignVCenter );
return static_cast<Qt::Alignment::Int>( Qt::AlignLeft | Qt::AlignVCenter );

case Min:
case Max:
case Mean:
case StDev:
return QVariant( Qt::AlignRight | Qt::AlignVCenter );
return static_cast<Qt::Alignment::Int>( Qt::AlignRight | Qt::AlignVCenter );

}
return QVariant();
@@ -173,7 +173,7 @@ QVariant QgsLayoutModel::data( const QModelIndex &index, int role ) const
return QVariant::fromValue( qobject_cast<QObject *>( item ) );

case Qt::TextAlignmentRole:
return Qt::AlignLeft & Qt::AlignVCenter;
return static_cast<Qt::Alignment::Int>( Qt::AlignLeft & Qt::AlignVCenter );

case Qt::CheckStateRole:
switch ( index.column() )
@@ -255,7 +255,7 @@ QVariant QgsLayoutModel::headerData( int section, Qt::Orientation orientation, i
}

case Qt::TextAlignmentRole:
return Qt::AlignLeft & Qt::AlignVCenter;
return static_cast<Qt::Alignment::Int>( Qt::AlignLeft & Qt::AlignVCenter );

default:
return QAbstractItemModel::headerData( section, orientation, role );
@@ -687,7 +687,7 @@ QVariant QgsAttributeTableModel::data( const QModelIndex &index, int role ) cons

if ( role == Qt::TextAlignmentRole )
{
return QVariant( mFieldFormatters.at( index.column() )->alignmentFlag( mLayer, fieldId, mWidgetConfigs.at( index.column() ) ) | Qt::AlignVCenter );
return static_cast<Qt::Alignment::Int>( mFieldFormatters.at( index.column() )->alignmentFlag( mLayer, fieldId, mWidgetConfigs.at( index.column() ) ) | Qt::AlignVCenter );
}

if ( mFeat.id() != rowId || !mFeat.isValid() )
@@ -116,7 +116,7 @@ QVariant QgsFeatureListModel::data( const QModelIndex &index, int role ) const
}
else if ( role == Qt::TextAlignmentRole )
{
return Qt::AlignLeft;
return static_cast<Qt::Alignment::Int>( Qt::AlignLeft );
}

#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
@@ -296,7 +296,7 @@ QVariant QgsRuleBasedLabelingModel::data( const QModelIndex &index, int role ) c
}
else if ( role == Qt::TextAlignmentRole )
{
return ( index.column() == 2 || index.column() == 3 ) ? Qt::AlignRight : Qt::AlignLeft;
return ( index.column() == 2 || index.column() == 3 ) ? static_cast<Qt::Alignment::Int>( Qt::AlignRight ) : static_cast<Qt::Alignment::Int>( Qt::AlignLeft );
}
else if ( role == Qt::FontRole && index.column() == 1 )
{
@@ -144,7 +144,7 @@ QVariant QgsPointCloudClassifiedRendererModel::data( const QModelIndex &index, i

case Qt::TextAlignmentRole:
{
return ( index.column() == 0 ) ? Qt::AlignHCenter : Qt::AlignLeft;
return ( index.column() == 0 ) ? static_cast<Qt::Alignment::Int>( Qt::AlignHCenter ) : static_cast<Qt::Alignment::Int>( Qt::AlignLeft );
}

case Qt::EditRole:
@@ -382,7 +382,7 @@ QVariant QgsColorSchemeModel::data( const QModelIndex &index, int role ) const
}

case Qt::TextAlignmentRole:
return QVariant( Qt::AlignLeft | Qt::AlignVCenter );
return static_cast<Qt::Alignment::Int>( Qt::AlignLeft | Qt::AlignVCenter );

default:
return QVariant();
@@ -465,9 +465,9 @@ QVariant QgsColorSchemeModel::headerData( int section, Qt::Orientation orientati
switch ( section )
{
case ColorSwatch:
return QVariant( Qt::AlignHCenter | Qt::AlignVCenter );
return static_cast<Qt::Alignment::Int>( Qt::AlignHCenter | Qt::AlignVCenter );
case ColorLabel:
return QVariant( Qt::AlignLeft | Qt::AlignVCenter );
return static_cast<Qt::Alignment::Int>( Qt::AlignLeft | Qt::AlignVCenter );
default:
return QVariant();
}
@@ -587,7 +587,7 @@ QVariant QgsNewVectorTableFieldModel::data( const QModelIndex &index, int role )
case ColumnHeaders::Precision:
case ColumnHeaders::Length:
{
return Qt::AlignmentFlag::AlignVCenter + Qt::AlignmentFlag::AlignHCenter;
return static_cast<Qt::Alignment::Int>( Qt::AlignmentFlag::AlignVCenter | Qt::AlignmentFlag::AlignHCenter );
}
default:
break;
@@ -654,11 +654,11 @@ QVariant QgsNewVectorTableFieldModel::headerData( int section, Qt::Orientation o
case ColumnHeaders::Type:
case ColumnHeaders::ProviderType:
{
return Qt::AlignmentFlag::AlignVCenter + Qt::AlignmentFlag::AlignLeft;
return static_cast<Qt::Alignment::Int>( Qt::AlignmentFlag::AlignVCenter | Qt::AlignmentFlag::AlignLeft );
}
default:
{
return Qt::AlignmentFlag::AlignVCenter + Qt::AlignmentFlag::AlignHCenter;
return static_cast<Qt::Alignment::Int>( Qt::AlignmentFlag::AlignVCenter | Qt::AlignmentFlag::AlignHCenter );
}
}
break;
@@ -220,7 +220,7 @@ QVariant QgsCategorizedSymbolRendererModel::data( const QModelIndex &index, int

case Qt::TextAlignmentRole:
{
return ( index.column() == 0 ) ? Qt::AlignHCenter : Qt::AlignLeft;
return ( index.column() == 0 ) ? static_cast<Qt::Alignment::Int>( Qt::AlignHCenter ) : static_cast<Qt::Alignment::Int>( Qt::AlignLeft );
}

case Qt::EditRole:
@@ -181,7 +181,7 @@ QVariant QgsGraduatedSymbolRendererModel::data( const QModelIndex &index, int ro
}
else if ( role == Qt::TextAlignmentRole )
{
return ( index.column() == 0 ) ? Qt::AlignHCenter : Qt::AlignLeft;
return ( index.column() == 0 ) ? static_cast<Qt::Alignment::Int>( Qt::AlignHCenter ) : static_cast<Qt::Alignment::Int>( Qt::AlignLeft );
}
else if ( role == Qt::EditRole )
{
@@ -1006,7 +1006,7 @@ QVariant QgsRuleBasedRendererModel::data( const QModelIndex &index, int role ) c
}
else if ( role == Qt::TextAlignmentRole )
{
return ( index.column() == 2 || index.column() == 3 ) ? Qt::AlignRight : Qt::AlignLeft;
return ( index.column() == 2 || index.column() == 3 ) ? static_cast<Qt::Alignment::Int>( Qt::AlignRight ) : static_cast<Qt::Alignment::Int>( Qt::AlignLeft );
}
else if ( role == Qt::FontRole && index.column() == 1 )
{
@@ -70,9 +70,9 @@ QVariant DockModel::data( const QModelIndex &index, int role ) const
if ( role == Qt::TextAlignmentRole )
{
if ( column )
return QVariant( Qt::AlignRight );
return static_cast<Qt::Alignment::Int>( Qt::AlignRight );
else
return QVariant( Qt::AlignLeft );
return static_cast<Qt::Alignment::Int>( Qt::AlignLeft );
}

QVariant val;

0 comments on commit b7a1f76

Please sign in to comment.