本文整理汇总了C++中Damage::type方法的典型用法代码示例。如果您正苦于以下问题:C++ Damage::type方法的具体用法?C++ Damage::type怎么用?C++ Damage::type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Damage
的用法示例。
在下文中一共展示了Damage::type方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleDamages
void TableShape::handleDamages(const QList<Damage*>& damages)
{
QList<Damage*>::ConstIterator end(damages.end());
for (QList<Damage*>::ConstIterator it = damages.begin(); it != end; ++it) {
Damage* damage = *it;
if (!damage) continue;
if (damage->type() == Damage::Cell) {
CellDamage* cellDamage = static_cast<CellDamage*>(damage);
const Region region = cellDamage->region();
if (cellDamage->changes() & CellDamage::Appearance)
d->sheetView->invalidateRegion(region);
continue;
}
if (damage->type() == Damage::Sheet) {
SheetDamage* sheetDamage = static_cast<SheetDamage*>(damage);
if (sheetDamage->changes() & SheetDamage::PropertiesChanged)
d->sheetView->invalidate();
continue;
}
}
update();
}
示例2: handleDamages
void SheetAccessModel::handleDamages(const QList<Damage*>& damages)
{
QList<Damage*>::ConstIterator end(damages.end());
for (QList<Damage*>::ConstIterator it = damages.begin(); it != end; ++it) {
Damage* damage = *it;
if (!damage) {
continue;
}
if (damage->type() == Damage::Sheet) {
SheetDamage* sheetDamage = static_cast<SheetDamage*>(damage);
kDebug(36007) << "Processing\t" << *sheetDamage;
if (sheetDamage->changes() & SheetDamage::Name) {
Sheet *sheet = sheetDamage->sheet();
// We should never receive signals from sheets that are not in our model
Q_ASSERT(d->cols.contains(sheet));
const int sheetIndex = d->cols[sheet];
setHeaderData(sheetIndex, Qt::Horizontal, sheet->sheetName());
}
continue;
}
}
}
示例3: handleDamages
void CanvasItem::handleDamages(const QList<Damage*>& damages)
{
QRegion paintRegion;
enum { Nothing, Everything, Clipped } paintMode = Nothing;
QList<Damage*>::ConstIterator end(damages.end());
for (QList<Damage*>::ConstIterator it = damages.begin(); it != end; ++it) {
Damage* damage = *it;
if (!damage) continue;
if (damage->type() == Damage::Cell) {
CellDamage* cellDamage = static_cast<CellDamage*>(damage);
kDebug(36007) << "Processing\t" << *cellDamage;
Sheet* const damagedSheet = cellDamage->sheet();
if (cellDamage->changes() & CellDamage::Appearance) {
const Region& region = cellDamage->region();
sheetView(damagedSheet)->invalidateRegion(region);
paintMode = Everything;
}
continue;
}
if (damage->type() == Damage::Sheet) {
SheetDamage* sheetDamage = static_cast<SheetDamage*>(damage);
kDebug(36007) << *sheetDamage;
const SheetDamage::Changes changes = sheetDamage->changes();
if (changes & (SheetDamage::Name | SheetDamage::Shown)) {
// d->tabBar->setTabs(doc()->map()->visibleSheets());
paintMode = Everything;
}
if (changes & (SheetDamage::Shown | SheetDamage::Hidden)) {
// updateShowSheetMenu();
paintMode = Everything;
}
// The following changes only affect the active sheet.
if (sheetDamage->sheet() != d->activeSheet) {
continue;
}
if (changes.testFlag(SheetDamage::ContentChanged)) {
update();
paintMode = Everything;
}
if (changes.testFlag(SheetDamage::PropertiesChanged)) {
sheetView(d->activeSheet)->invalidate();
paintMode = Everything;
}
if (sheetDamage->changes() & SheetDamage::ColumnsChanged)
columnHeader()->update();
if (sheetDamage->changes() & SheetDamage::RowsChanged)
rowHeader()->update();
continue;
}
if (damage->type() == Damage::Selection) {
SelectionDamage* selectionDamage = static_cast<SelectionDamage*>(damage);
kDebug(36007) << "Processing\t" << *selectionDamage;
const Region region = selectionDamage->region();
if (paintMode == Clipped) {
const QRectF rect = cellCoordinatesToView(region.boundingRect());
paintRegion += rect.toRect().adjusted(-3, -3, 4, 4);
} else {
paintMode = Everything;
}
continue;
}
kDebug(36007) << "Unhandled\t" << *damage;
}
// At last repaint the dirty cells.
if (paintMode == Clipped) {
update(paintRegion.boundingRect());
} else if (paintMode == Everything) {
update();
}
}