resetChain -> updateLayoutChain

This commit is contained in:
Uwe Rathmann 2019-07-12 15:26:55 +02:00
parent a762d51099
commit 16a67678f3
1 changed files with 18 additions and 18 deletions

View File

@ -122,7 +122,7 @@ namespace
int effectiveCount() const; int effectiveCount() const;
int effectiveCount( Qt::Orientation orientation ) const; int effectiveCount( Qt::Orientation orientation ) const;
void resetChain( Qt::Orientation, void updateLayoutChain( Qt::Orientation,
const QVector< QskLayoutChain::Range >& constraints, const QVector< QskLayoutChain::Range >& constraints,
QskLayoutChain& ) const; QskLayoutChain& ) const;
@ -513,7 +513,7 @@ QskLayoutChain::Cell EntryTable::cell( const EntryData& entry,
return cell; return cell;
} }
void EntryTable::resetChain( Qt::Orientation orientation, void EntryTable::updateLayoutChain( Qt::Orientation orientation,
const QVector< QskLayoutChain::Range >& constraints, const QVector< QskLayoutChain::Range >& constraints,
QskLayoutChain& chain ) const QskLayoutChain& chain ) const
{ {
@ -566,18 +566,18 @@ void EntryTable::resetChain( Qt::Orientation orientation,
// --------- // ---------
static inline void qskResetChain( Qt::Orientation orientation, static inline void qskUpdateLayoutChain( Qt::Orientation orientation,
const QVector< QskLayoutChain::Range >& constraints, const QVector< QskLayoutChain::Range >& constraints,
const EntryTable& entryTable, QskLayoutChain& chain ) const EntryTable& entryTable, QskLayoutChain& chain )
{ {
entryTable.resetChain( orientation, constraints, chain ); entryTable.updateLayoutChain( orientation, constraints, chain );
} }
static inline void qskResetChain( Qt::Orientation orientation, static inline void qskUpdateLayoutChain( Qt::Orientation orientation,
const EntryTable& entryTable, QskLayoutChain& chain ) const EntryTable& entryTable, QskLayoutChain& chain )
{ {
const QVector< QskLayoutChain::Range > constraints; const QVector< QskLayoutChain::Range > constraints;
entryTable.resetChain( orientation, constraints, chain ); entryTable.updateLayoutChain( orientation, constraints, chain );
} }
class QskLinearLayoutEngine::PrivateData class QskLinearLayoutEngine::PrivateData
@ -896,23 +896,23 @@ QSizeF QskLinearLayoutEngine::sizeHint( Qt::SizeHint which, const QSizeF& constr
if ( ( constraint.width() >= 0 ) && if ( ( constraint.width() >= 0 ) &&
( constraintType == QskLayoutConstraint::HeightForWidth ) ) ( constraintType == QskLayoutConstraint::HeightForWidth ) )
{ {
qskResetChain( Qt::Horizontal, entryTable, colChain ); qskUpdateLayoutChain( Qt::Horizontal, entryTable, colChain );
const auto cellConstraints = colChain.geometries( constraint.width() ); const auto cellConstraints = colChain.geometries( constraint.width() );
qskResetChain( Qt::Vertical, cellConstraints, entryTable, rowChain ); qskUpdateLayoutChain( Qt::Vertical, cellConstraints, entryTable, rowChain );
} }
else if ( ( constraint.height() >= 0 ) && else if ( ( constraint.height() >= 0 ) &&
( constraintType == QskLayoutConstraint::WidthForHeight ) ) ( constraintType == QskLayoutConstraint::WidthForHeight ) )
{ {
qskResetChain( Qt::Vertical, entryTable, rowChain ); qskUpdateLayoutChain( Qt::Vertical, entryTable, rowChain );
const auto cellConstraints = rowChain.geometries( constraint.height() ); const auto cellConstraints = rowChain.geometries( constraint.height() );
qskResetChain( Qt::Horizontal, cellConstraints, entryTable, colChain ); qskUpdateLayoutChain( Qt::Horizontal, cellConstraints, entryTable, colChain );
} }
else else
{ {
qskResetChain( Qt::Horizontal, entryTable, colChain ); qskUpdateLayoutChain( Qt::Horizontal, entryTable, colChain );
qskResetChain( Qt::Vertical, entryTable, rowChain ); qskUpdateLayoutChain( Qt::Vertical, entryTable, rowChain );
} }
m_data->blockInvalidate = false; m_data->blockInvalidate = false;
@ -960,30 +960,30 @@ void QskLinearLayoutEngine::updateCellGeometries( const QSizeF& size )
{ {
case QskLayoutConstraint::WidthForHeight: case QskLayoutConstraint::WidthForHeight:
{ {
qskResetChain( Qt::Vertical, entryTable, rowChain ); qskUpdateLayoutChain( Qt::Vertical, entryTable, rowChain );
geometries.rows = rowChain.geometries( size.height() ); geometries.rows = rowChain.geometries( size.height() );
qskResetChain( Qt::Horizontal, geometries.rows, entryTable, colChain ); qskUpdateLayoutChain( Qt::Horizontal, geometries.rows, entryTable, colChain );
geometries.columns = colChain.geometries( size.width() ); geometries.columns = colChain.geometries( size.width() );
break; break;
} }
case QskLayoutConstraint::HeightForWidth: case QskLayoutConstraint::HeightForWidth:
{ {
qskResetChain( Qt::Horizontal, entryTable, colChain ); qskUpdateLayoutChain( Qt::Horizontal, entryTable, colChain );
geometries.columns = colChain.geometries( size.width() ); geometries.columns = colChain.geometries( size.width() );
qskResetChain( Qt::Vertical, geometries.columns, entryTable, rowChain ); qskUpdateLayoutChain( Qt::Vertical, geometries.columns, entryTable, rowChain );
geometries.rows = rowChain.geometries( size.height() ); geometries.rows = rowChain.geometries( size.height() );
break; break;
} }
default: default:
{ {
qskResetChain( Qt::Horizontal, entryTable, colChain ); qskUpdateLayoutChain( Qt::Horizontal, entryTable, colChain );
geometries.columns = colChain.geometries( size.width() ); geometries.columns = colChain.geometries( size.width() );
qskResetChain( Qt::Vertical, entryTable, rowChain ); qskUpdateLayoutChain( Qt::Vertical, entryTable, rowChain );
geometries.rows = rowChain.geometries( size.height() ); geometries.rows = rowChain.geometries( size.height() );
} }
} }