avoid incompatible Qt::endl calls

This commit is contained in:
Uwe Rathmann 2020-01-02 17:49:10 +01:00
parent fb87fe1251
commit ea055fc7a7

View File

@ -1022,14 +1022,12 @@ QskGraphic QskGraphic::fromPixmap( const QPixmap& pixmap )
QDebug operator<<( QDebug debug, const QskGraphic& graphic ) QDebug operator<<( QDebug debug, const QskGraphic& graphic )
{ {
// Qt::endl
QDebugStateSaver saver( debug ); QDebugStateSaver saver( debug );
debug << "Graphic" << '('; debug << "Graphic" << '(';
debug << Qt::endl << " boundingRect:" << graphic.boundingRect(); debug << "\n boundingRect:" << graphic.boundingRect();
debug << Qt::endl << " controlPointsRect:" << graphic.boundingRect(); debug << "\n controlPointsRect:" << graphic.boundingRect();
debug << Qt::endl << " commandTypes:" << graphic.commandTypes(); debug << "\n commandTypes:" << graphic.commandTypes();
for ( const auto command : graphic.commands() ) for ( const auto command : graphic.commands() )
{ {
@ -1039,13 +1037,13 @@ QDebug operator<<( QDebug debug, const QskGraphic& graphic )
{ {
const auto& path = *command.path(); const auto& path = *command.path();
debug << Qt::endl << " Path(" << path.elementCount() << ")"; debug << "\n Path(" << path.elementCount() << ")";
const char *types[] = { "MoveTo", "LineTo", "CurveTo", "CurveToData" }; const char *types[] = { "MoveTo", "LineTo", "CurveTo", "CurveToData" };
for ( int i = 0; i < path.elementCount(); i++ ) for ( int i = 0; i < path.elementCount(); i++ )
{ {
debug << Qt::endl << " "; debug << "\n ";
const auto el = path.elementAt(i); const auto el = path.elementAt(i);
debug << types[ el.type] << el.x << el.y; debug << types[ el.type] << el.x << el.y;
@ -1057,21 +1055,21 @@ QDebug operator<<( QDebug debug, const QskGraphic& graphic )
{ {
const auto& pixmapData = *command.pixmapData(); const auto& pixmapData = *command.pixmapData();
debug << Qt::endl << " Pixmap:"; debug << "\n Pixmap:";
debug << Qt::endl << " " << pixmapData.pixmap; debug << "\n " << pixmapData.pixmap;
debug << Qt::endl << " Rect:" << pixmapData.rect; debug << "\n Rect:" << pixmapData.rect;
debug << Qt::endl << " SubRect:" << pixmapData.subRect; debug << "\n SubRect:" << pixmapData.subRect;
break; break;
} }
case QskPainterCommand::Image: case QskPainterCommand::Image:
{ {
const auto& imageData = *command.imageData(); const auto& imageData = *command.imageData();
debug << Qt::endl << " Image:"; debug << "\n Image:";
debug << Qt::endl << " " << imageData.image; debug << "\n " << imageData.image;
debug << Qt::endl << " ConversionFlags" << imageData.flags; debug << "\n ConversionFlags" << imageData.flags;
debug << Qt::endl << " Rect:" << imageData.rect; debug << "\n Rect:" << imageData.rect;
debug << Qt::endl << " SubRect:" << imageData.subRect; debug << "\n SubRect:" << imageData.subRect;
break; break;
} }
@ -1080,82 +1078,70 @@ QDebug operator<<( QDebug debug, const QskGraphic& graphic )
const auto& stateData = *command.stateData(); const auto& stateData = *command.stateData();
const auto flags = stateData.flags; const auto flags = stateData.flags;
debug << Qt::endl << " State:"; debug << "\n State:";
const char indent[] = " "; const char indent[] = "\n ";
if ( flags & QPaintEngine::DirtyPen ) if ( flags & QPaintEngine::DirtyPen )
{ {
debug << Qt::endl << indent; debug << indent << "Pen:" << stateData.pen;
debug << "Pen:" << stateData.pen;
} }
if ( flags & QPaintEngine::DirtyBrush ) if ( flags & QPaintEngine::DirtyBrush )
{ {
debug << Qt::endl << indent; debug << indent << "Brush:" << stateData.brush;
debug << "Brush:" << stateData.brush;
} }
if ( flags & QPaintEngine::DirtyBrushOrigin ) if ( flags & QPaintEngine::DirtyBrushOrigin )
{ {
debug << Qt::endl << indent; debug << indent << "BrushOrigin:" << stateData.brushOrigin;
debug << "BrushOrigin:" << stateData.brushOrigin;
} }
if ( flags & QPaintEngine::DirtyFont ) if ( flags & QPaintEngine::DirtyFont )
{ {
debug << Qt::endl << indent; debug << indent << "Font:" << stateData.font;
debug << "Font:" << stateData.font;
} }
if ( flags & QPaintEngine::DirtyBackground ) if ( flags & QPaintEngine::DirtyBackground )
{ {
debug << Qt::endl << indent; debug << indent << "Background:"
debug << "Background:"
<< stateData.backgroundMode << stateData.backgroundMode
<< stateData.backgroundBrush; << stateData.backgroundBrush;
} }
if ( flags & QPaintEngine::DirtyTransform ) if ( flags & QPaintEngine::DirtyTransform )
{ {
debug << Qt::endl << indent; debug << indent << "Transform: " << stateData.transform;
debug << "Transform: " << stateData.transform;
} }
if ( flags & QPaintEngine::DirtyClipEnabled ) if ( flags & QPaintEngine::DirtyClipEnabled )
{ {
debug << Qt::endl << indent; debug << indent << "ClipEnabled: " << stateData.isClipEnabled;
debug << "ClipEnabled: " << stateData.isClipEnabled;
} }
if ( flags & QPaintEngine::DirtyClipRegion ) if ( flags & QPaintEngine::DirtyClipRegion )
{ {
debug << Qt::endl << indent; debug << indent << "ClipRegion: " << stateData.clipOperation;
debug << "ClipRegion: " << stateData.clipOperation;
} }
if ( flags & QPaintEngine::DirtyClipPath ) if ( flags & QPaintEngine::DirtyClipPath )
{ {
debug << Qt::endl << indent; debug << indent << "ClipPath:" << stateData.clipOperation;
debug << "ClipPath:" << stateData.clipOperation;
} }
if ( flags & QPaintEngine::DirtyHints ) if ( flags & QPaintEngine::DirtyHints )
{ {
debug << Qt::endl << indent; debug << indent << "RenderHints:" << stateData.renderHints;
debug << "RenderHints:" << stateData.renderHints;
} }
if ( flags & QPaintEngine::DirtyCompositionMode ) if ( flags & QPaintEngine::DirtyCompositionMode )
{ {
debug << Qt::endl << indent; debug << indent << "CompositionMode:" << stateData.compositionMode;
debug << "CompositionMode:" << stateData.compositionMode;
} }
if ( flags & QPaintEngine::DirtyOpacity ) if ( flags & QPaintEngine::DirtyOpacity )
{ {
debug << Qt::endl << indent; debug << indent << "Opacity:" << stateData.opacity;
debug << "Opacity:" << stateData.opacity;
} }
break; break;