void LayerAndroid::dumpLayers(FILE* file, int indentLevel) const { writeln(file, indentLevel, "{"); writeHexVal(file, indentLevel + 1, "layer", (int)this); writeIntVal(file, indentLevel + 1, "layerId", m_uniqueId); writeIntVal(file, indentLevel + 1, "haveClip", m_haveClip); writeIntVal(file, indentLevel + 1, "isRootLayer", m_isRootLayer); writeIntVal(file, indentLevel + 1, "isFixed", m_isFixed); writeFloatVal(file, indentLevel + 1, "opacity", getOpacity()); writeSize(file, indentLevel + 1, "size", getSize()); writePoint(file, indentLevel + 1, "position", getPosition()); writePoint(file, indentLevel + 1, "translation", m_translation); writePoint(file, indentLevel + 1, "anchor", getAnchorPoint()); writePoint(file, indentLevel + 1, "scale", m_scale); if (m_doRotation) writeFloatVal(file, indentLevel + 1, "angle", m_angleTransform); if (m_isFixed) { writeLength(file, indentLevel + 1, "fixedLeft", m_fixedLeft); writeLength(file, indentLevel + 1, "fixedTop", m_fixedTop); writeLength(file, indentLevel + 1, "fixedRight", m_fixedRight); writeLength(file, indentLevel + 1, "fixedBottom", m_fixedBottom); writeLength(file, indentLevel + 1, "fixedMarginLeft", m_fixedMarginLeft); writeLength(file, indentLevel + 1, "fixedMarginTop", m_fixedMarginTop); writeLength(file, indentLevel + 1, "fixedMarginRight", m_fixedMarginRight); writeLength(file, indentLevel + 1, "fixedMarginBottom", m_fixedMarginBottom); writePoint(file, indentLevel + 1, "fixedOffset", m_fixedOffset); writeIntVal(file, indentLevel + 1, "fixedWidth", m_fixedWidth); writeIntVal(file, indentLevel + 1, "fixedHeight", m_fixedHeight); } if (m_recordingPicture) { writeIntVal(file, indentLevel + 1, "picture width", m_recordingPicture->width()); writeIntVal(file, indentLevel + 1, "picture height", m_recordingPicture->height()); } if (countChildren()) { writeln(file, indentLevel + 1, "children = ["); for (int i = 0; i < countChildren(); i++) { if (i > 0) writeln(file, indentLevel + 1, ", "); getChild(i)->dumpLayers(file, indentLevel + 1); } writeln(file, indentLevel + 1, "];"); } writeln(file, indentLevel, "}"); }
void process(JNIEnv * env, SHPHandle hSHP, DBFHandle hDBF, jstring file, jobject listObject) { jclass classAdapter = (*env)->FindClass(env, "org/maptools/shapelib/android/util/TestUtils$DataAdapter"); jmethodID methodIdSize = (*env)->GetMethodID(env, classAdapter, "size", "()I"); jmethodID methodIdGet = (*env)->GetMethodID(env, classAdapter, "get", "(I)Ljava/lang/Object;"); // see: http://docs.oracle.com/javase/6/docs/technotes/guides/jni/spec/types.html#wp16437 int totalItems = (*env)->CallIntMethod(env, listObject, methodIdSize); // Apple tree jclass classAppleTree = (*env)->FindClass(env, "org/maptools/shapelib/android/util/TestUtils$AppleTree"); jmethodID methodIdGetLatitude = (*env)->GetMethodID(env, classAppleTree, "getLatitude", "()D"); jmethodID methodIdGetLongitude = (*env)->GetMethodID(env, classAppleTree, "getLongitude", "()D"); jmethodID methodIdGetName = (*env)->GetMethodID(env, classAppleTree, "getName", "()Ljava/lang/String;"); jmethodID methodIdGetHeight = (*env)->GetMethodID(env, classAppleTree, "getHeight", "()D"); jmethodID methodIdGetApples = (*env)->GetMethodID(env, classAppleTree, "getApples", "()I"); // Let us print out those items const int recordCount = DBFGetRecordCount(hDBF); const int end = totalItems + recordCount; int i; for (i = recordCount; i < end; i++) { jobject tree = (*env)->CallObjectMethod(env, listObject, methodIdGet, i); jstring name = (*env)->CallObjectMethod(env, tree, methodIdGetName); jint apples = (*env)->CallIntMethod(env, tree, methodIdGetApples); jdouble height = (*env)->CallDoubleMethod(env, tree, methodIdGetHeight); jdouble latitude = (*env)->CallDoubleMethod(env, tree, methodIdGetLatitude); jdouble longitude = (*env)->CallDoubleMethod(env, tree, methodIdGetLongitude); writePoint(env, hSHP, hDBF, i, latitude, longitude, name, height, apples); // free reference and avoid a "JNI local reference table" overflow (*env)->DeleteLocalRef(env, tree ); (*env)->DeleteLocalRef(env, name ); } }
void LC_MakerCamSVG::writeEntity(RS_Entity* entity) { RS_DEBUG->print("RS_MakerCamSVG::writeEntity: Found entity ..."); switch (entity->rtti()) { case RS2::EntityInsert: writeInsert((RS_Insert*)entity); break; case RS2::EntityPoint: writePoint((RS_Point*)entity); break; case RS2::EntityLine: writeLine((RS_Line*)entity); break; case RS2::EntityPolyline: writePolyline((RS_Polyline*)entity); break; case RS2::EntityCircle: writeCircle((RS_Circle*)entity); break; case RS2::EntityArc: writeArc((RS_Arc*)entity); break; case RS2::EntityEllipse: writeEllipse((RS_Ellipse*)entity); break; default: RS_DEBUG->print("RS_MakerCamSVG::writeEntity: Entity with type '%d' not yet implemented", (int)entity->rtti()); break; } }
// Deferring write until this time allows both points and faces from multiple // point views to be written. void PlyWriter::done(PointTableRef table) { for (auto& v : m_views) { PointRef point(*v, 0); for (PointId idx = 0; idx < v->size(); ++idx) { point.setPointId(idx); writePoint(point, table.layout()); } } if (m_faces) { PointId offset = 0; for (auto& v : m_views) { TriangularMesh *mesh = v->mesh(); if (mesh) { for (size_t id = 0; id < mesh->size(); ++id) { const Triangle& t = (*mesh)[id]; writeTriangle(t, offset); } } offset += v->size(); } } Utils::closeFile(m_stream); m_stream = nullptr; getMetadata().addList("filename", m_filename); }
void WKBWriter::write(const Geometry &g, ostream &os) { outStream = &os; switch (g.getGeometryTypeId()) { case GEOS_POINT: return writePoint((Point &)g); case GEOS_LINESTRING: case GEOS_LINEARRING: return writeLineString((LineString &)g); case GEOS_POLYGON: return writePolygon((Polygon &)g); case GEOS_MULTIPOINT: return writeGeometryCollection( (GeometryCollection &)g, WKBConstants::wkbMultiPoint); case GEOS_MULTILINESTRING: return writeGeometryCollection( (GeometryCollection &)g, WKBConstants::wkbMultiLineString); case GEOS_MULTIPOLYGON: return writeGeometryCollection( (GeometryCollection &)g, WKBConstants::wkbMultiPolygon); case GEOS_GEOMETRYCOLLECTION: return writeGeometryCollection( (GeometryCollection &)g, WKBConstants::wkbGeometryCollection); case GEOM_CIRCULARARC: return writeCircularArc((CircularArc&)g); default: assert(0); // Unknown Geometry type } }
void QgsDxfExport::writePoint( const QgsPoint& pt, const QString& layer, int color, const QgsFeature* f, const QgsSymbolLayerV2* symbolLayer, const QgsSymbolV2* symbol ) { #if 0 //debug: draw rectangle for debugging const QgsMarkerSymbolLayerV2* msl = dynamic_cast< const QgsMarkerSymbolLayerV2* >( symbolLayer ); if ( msl ) { double halfSize = msl->size() * mapUnitScaleFactor( mSymbologyScaleDenominator, msl->sizeUnit(), mMapUnits ) / 2.0; writeGroup( 0, "SOLID" ); writeGroup( 8, layer ); writeGroup( 62, 1 ); writeGroup( 10, pt.x() - halfSize ); writeGroup( 20, pt.y() - halfSize ); writeGroup( 30, 0.0 ); writeGroup( 11, pt.x() + halfSize ); writeGroup( 21, pt.y() - halfSize ); writeGroup( 31, 0.0 ); writeGroup( 12, pt.x() - halfSize ); writeGroup( 22, pt.y() + halfSize ); writeGroup( 32, 0.0 ); writeGroup( 13, pt.x() + halfSize ); writeGroup( 23, pt.y() + halfSize ); writeGroup( 33, 0.0 ); } #endif //0 //insert block or write point directly? QHash< const QgsSymbolLayerV2*, QString >::const_iterator blockIt = mPointSymbolBlocks.find( symbolLayer ); if ( !symbolLayer || blockIt == mPointSymbolBlocks.constEnd() ) { //write symbol directly here const QgsMarkerSymbolLayerV2* msl = dynamic_cast< const QgsMarkerSymbolLayerV2* >( symbolLayer ); if ( symbolLayer && symbol ) { QgsRenderContext ct; QgsSymbolV2RenderContext ctx( ct, QgsSymbolV2::MapUnit, symbol->alpha(), false, symbol->renderHints(), f ); if ( symbolLayer->writeDxf( *this, mapUnitScaleFactor( mSymbologyScaleDenominator, msl->sizeUnit(), mMapUnits ), layer, &ctx, f, QPointF( pt.x(), pt.y() ) ) ) { return; } } writePoint( layer, color, pt ); //write default point symbol } else { //insert block reference writeGroup( 0, "INSERT" ); writeGroup( 8, layer ); writeGroup( 2, blockIt.value() ); writeGroup( 10, pt.x() ); writeGroup( 20, pt.y() ); writeGroup( 30, 0 ); } }
void LayerAndroid::dumpLayer(FILE* file, int indentLevel) const { writeHexVal(file, indentLevel + 1, "layer", (int)this); writeIntVal(file, indentLevel + 1, "layerId", m_uniqueId); writeIntVal(file, indentLevel + 1, "haveClip", m_haveClip); writeIntVal(file, indentLevel + 1, "isFixed", isPositionFixed()); writeFloatVal(file, indentLevel + 1, "opacity", getOpacity()); writeSize(file, indentLevel + 1, "size", getSize()); writePoint(file, indentLevel + 1, "position", getPosition()); writePoint(file, indentLevel + 1, "anchor", getAnchorPoint()); writeMatrix(file, indentLevel + 1, "drawMatrix", m_drawTransform); writeMatrix(file, indentLevel + 1, "transformMatrix", m_transform); writeRect(file, indentLevel + 1, "clippingRect", SkRect(m_clippingRect)); if (m_content) { writeIntVal(file, indentLevel + 1, "m_content.width", m_content->width()); writeIntVal(file, indentLevel + 1, "m_content.height", m_content->height()); } if (m_fixedPosition) return m_fixedPosition->dumpLayer(file, indentLevel); }
void writeBSplinePointData(OutputStream* outputStream, BSplinePointData* splinePointData) { float t = splinePointData->time; appendDecf(outputStream, t); appendString(outputStream, CSV_SEPARATOR); Point point = splinePointData->point; writePoint(outputStream, &point); float distance = splinePointData->length; appendDecf(outputStream, distance); appendString(outputStream, CSV_SEPARATOR); float orientation = splinePointData->orientation; appendDecf(outputStream, orientation); println(outputStream); }
HElement writePlacedGraphic(PlacedGraphic & model) { HElement e = Xml::make_HElement("PlacedGraphic"); e->addAttribute("x", std::to_string(model.getPlacementPoint().getX())); e->addAttribute("y", std::to_string(model.getPlacementPoint().getY())); VectorGraphic vg = model.getGraphic(); HElement hvg = Xml::make_HElement("VectorGraphic"); hvg->addAttribute("closed", vg.isClosed() ? "true" : "false"); std::for_each(vg.begin() , vg.end(), [&hvg](Point point){ hvg->getChildElements().add(writePoint(point)); }); e->getChildElements().add(hvg); return e; }
point_count_t PgReader::readPgPatch(PointBuffer& buffer, point_count_t numPts) { point_count_t numRemaining = m_patch.remaining; PointId nextId = buffer.size(); point_count_t numRead = 0; size_t offset = ((m_patch.count - m_patch.remaining) * m_point_size); char *pos = (char *)(m_patch.binary.data() + offset); while (numRead < numPts && numRemaining > 0) { writePoint(buffer, nextId, pos); pos += m_point_size; numRemaining--; nextId++; numRead++; } m_patch.remaining = numRemaining; return numRead; }
point_count_t PgReader::readPgPatch(PointViewPtr view, point_count_t numPts) { point_count_t numRemaining = m_patch.remaining; PointId nextId = view->size(); point_count_t numRead = 0; size_t offset = (m_patch.count - m_patch.remaining) * packedPointSize(); char *pos = (char *)(m_patch.binary.data() + offset); while (numRead < numPts && numRemaining > 0) { writePoint(*view.get(), nextId, pos); pos += packedPointSize(); numRemaining--; nextId++; numRead++; } m_patch.remaining = numRemaining; return numRead; }
void WKBWriter::write(const Geometry& g, ostream& os) { outputDimension = defaultOutputDimension; if(outputDimension > g.getCoordinateDimension()) { outputDimension = g.getCoordinateDimension(); } outStream = &os; if(const Point* x = dynamic_cast<const Point*>(&g)) { return writePoint(*x); } if(const LineString* x = dynamic_cast<const LineString*>(&g)) { return writeLineString(*x); } if(const Polygon* x = dynamic_cast<const Polygon*>(&g)) { return writePolygon(*x); } if(const MultiPoint* x = dynamic_cast<const MultiPoint*>(&g)) { return writeGeometryCollection(*x, WKBConstants::wkbMultiPoint); } if(const MultiLineString* x = dynamic_cast<const MultiLineString*>(&g)) { return writeGeometryCollection(*x, WKBConstants::wkbMultiLineString); } if(const MultiPolygon* x = dynamic_cast<const MultiPolygon*>(&g)) { return writeGeometryCollection(*x, WKBConstants::wkbMultiPolygon); } if(const GeometryCollection* x = dynamic_cast<const GeometryCollection*>(&g)) { return writeGeometryCollection(*x, WKBConstants::wkbGeometryCollection); } assert(0); // Unknown Geometry type }
void ObjPrimitiveIndexWriter::drawArrays(GLenum mode,GLint first,GLsizei count) { switch(mode) { case(GL_TRIANGLES): { unsigned int pos=first; for(GLsizei i=2;i<count;i+=3,pos+=3) { writeTriangle(pos,pos+1,pos+2); } break; } case(GL_TRIANGLE_STRIP): { unsigned int pos=first; for(GLsizei i=2;i<count;++i,++pos) { if ((i%2)) writeTriangle(pos,pos+2,pos+1); else writeTriangle(pos,pos+1,pos+2); } break; } case(GL_QUADS): { unsigned int pos=first; for(GLsizei i=3;i<count;i+=4,pos+=4) { writeTriangle(pos,pos+1,pos+2); writeTriangle(pos,pos+2,pos+3); } break; } case(GL_QUAD_STRIP): { unsigned int pos=first; for(GLsizei i=3;i<count;i+=2,pos+=2) { writeTriangle(pos,pos+1,pos+2); writeTriangle(pos+1,pos+3,pos+2); } break; } case(GL_POLYGON): // treat polygons as GL_TRIANGLE_FAN case(GL_TRIANGLE_FAN): { unsigned int pos=first+1; for(GLsizei i=2;i<count;++i,++pos) { writeTriangle(first,pos,pos+1); } break; } case(GL_POINTS): { for(GLsizei i=0;i<count;++i) { writePoint(i); } break; } case(GL_LINES): { for(GLsizei i=0;i<count;i+=2) { writeLine(i, i+1); } break; } case(GL_LINE_STRIP): { for(GLsizei i=1;i<count;++i) { writeLine(i-1, i); } break; } case(GL_LINE_LOOP): { for(GLsizei i=1;i<count;++i) { writeLine(i-1, i); } writeLine(count-1, 0); break; } default: OSG_WARN << "OBJWriterNodeVisitor :: can't handle mode " << mode << std::endl; break; } }
template<typename T>void drawElementsImplementation(GLenum mode, GLsizei count, const T* indices) { if (indices==0 || count==0) return; typedef const T* IndexPointer; switch(mode) { case(GL_TRIANGLES): { IndexPointer ilast = &indices[count]; for(IndexPointer iptr=indices;iptr<ilast;iptr+=3) writeTriangle(*iptr,*(iptr+1),*(iptr+2)); break; } case(GL_TRIANGLE_STRIP): { IndexPointer iptr = indices; for(GLsizei i=2;i<count;++i,++iptr) { if ((i%2)) writeTriangle(*(iptr),*(iptr+2),*(iptr+1)); else writeTriangle(*(iptr),*(iptr+1),*(iptr+2)); } break; } case(GL_QUADS): { IndexPointer iptr = indices; for(GLsizei i=3;i<count;i+=4,iptr+=4) { writeTriangle(*(iptr),*(iptr+1),*(iptr+2)); writeTriangle(*(iptr),*(iptr+2),*(iptr+3)); } break; } case(GL_QUAD_STRIP): { IndexPointer iptr = indices; for(GLsizei i=3;i<count;i+=2,iptr+=2) { writeTriangle(*(iptr),*(iptr+1),*(iptr+2)); writeTriangle(*(iptr+1),*(iptr+3),*(iptr+2)); } break; } case(GL_POLYGON): // treat polygons as GL_TRIANGLE_FAN case(GL_TRIANGLE_FAN): { IndexPointer iptr = indices; unsigned int first = *iptr; ++iptr; for(GLsizei i=2;i<count;++i,++iptr) { writeTriangle(first,*(iptr),*(iptr+1)); } break; } case(GL_POINTS): { IndexPointer ilast = &indices[count]; for(IndexPointer iptr=indices;iptr<ilast;++iptr) { writePoint(*iptr); } break; } case(GL_LINES): { IndexPointer ilast = &indices[count]; for(IndexPointer iptr=indices;iptr<ilast;iptr+=2) { writeLine(*iptr, *(iptr+1)); } break; } case(GL_LINE_STRIP): { IndexPointer ilast = &indices[count]; for(IndexPointer iptr=indices+1;iptr<ilast;iptr+=2) { writeLine(*(iptr-1), *iptr); } break; } case(GL_LINE_LOOP): { IndexPointer ilast = &indices[count]; for(IndexPointer iptr=indices+1;iptr<ilast;iptr+=2) { writeLine(*(iptr-1), *iptr); } writeLine(*ilast, *indices); break; } default: // uhm should never come to this point :) break; } }
void QgsDxfExport::addFeature( const QgsSymbolV2RenderContext& ctx, const QString& layer, const QgsSymbolLayerV2* symbolLayer, const QgsSymbolV2* symbol ) { const QgsFeature* fet = ctx.feature(); if ( !fet ) { return; } QgsGeometry* geom = fet->geometry(); if ( geom ) { int c = 0; if ( mSymbologyExport != NoSymbology ) { c = colorFromSymbolLayer( symbolLayer, ctx ); } double width = -1; if ( mSymbologyExport != NoSymbology && symbolLayer ) { width = symbolLayer->dxfWidth( *this, ctx ); } QString lineStyleName = "CONTINUOUS"; if ( mSymbologyExport != NoSymbology ) { lineStyleName = lineStyleFromSymbolLayer( symbolLayer ); } QGis::WkbType geometryType = geom->wkbType(); //single point if ( geometryType == QGis::WKBPoint || geometryType == QGis::WKBPoint25D ) { writePoint( geom->asPoint(), layer, c, fet, symbolLayer, symbol ); } //multipoint if ( geometryType == QGis::WKBMultiPoint || geometryType == QGis::WKBMultiPoint25D ) { QgsMultiPoint multiPoint = geom->asMultiPoint(); QgsMultiPoint::const_iterator it = multiPoint.constBegin(); for ( ; it != multiPoint.constEnd(); ++it ) { writePoint( *it, layer, c, fet, symbolLayer, symbol ); } } //single line if ( geometryType == QGis::WKBLineString || geometryType == QGis::WKBLineString25D ) { writePolyline( geom->asPolyline(), layer, lineStyleName, c, width, false ); } //multiline if ( geometryType == QGis::WKBMultiLineString || geometryType == QGis::WKBMultiLineString25D ) { QgsMultiPolyline multiLine = geom->asMultiPolyline(); QgsMultiPolyline::const_iterator lIt = multiLine.constBegin(); for ( ; lIt != multiLine.constEnd(); ++lIt ) { writePolyline( *lIt, layer, lineStyleName, c, width, false ); } } //polygon if ( geometryType == QGis::WKBPolygon || geometryType == QGis::WKBPolygon25D ) { QgsPolygon polygon = geom->asPolygon(); QgsPolygon::const_iterator polyIt = polygon.constBegin(); for ( ; polyIt != polygon.constEnd(); ++polyIt ) //iterate over rings { writePolyline( *polyIt, layer, lineStyleName, c, width, true ); } } //multipolygon or polygon if ( geometryType == QGis::WKBMultiPolygon || geometryType == QGis::WKBMultiPolygon25D ) { QgsMultiPolygon mp = geom->asMultiPolygon(); QgsMultiPolygon::const_iterator mpIt = mp.constBegin(); for ( ; mpIt != mp.constEnd(); ++mpIt ) { QgsPolygon::const_iterator polyIt = mpIt->constBegin(); for ( ; polyIt != mpIt->constEnd(); ++polyIt ) { writePolyline( *polyIt, layer, lineStyleName, c, width, true ); } } } } }
void TodoDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { KColorScheme colorScheme( option.palette.currentColorGroup() ); QPen pen; // if( option.state & QStyle::State_Selected ){ // painter->fillRect(option.rect, option.palette.highlight() ); // } QPoint originPoint = option.rect.topLeft(); originPoint.rx()++; originPoint.ry()++; QMap<QString,QVariant> map( index.data().toMap() ); QStyleOptionViewItem newOption = option; if( map["type"] == 1 ){ switch( map["priority"].toInt() ){ case 1: if( Settings::self()->getUseOwnColor() ){ newOption.palette.setColor(QPalette::Background, Settings::self()->getPriority1() ); } else { newOption.palette.setColor(QPalette::Background, colorScheme.background(KColorScheme::NegativeBackground).color()); } if( Settings::self()->getUseOwnFontColor() ){ pen.setColor( Settings::self()->getPriority1Font() ); } painter->fillRect(newOption.rect, newOption.palette.background()); break; case 2: if( Settings::self()->getUseOwnColor() ){ newOption.palette.setColor(QPalette::Background, Settings::self()->getPriority2() ); } else { newOption.palette.setColor(QPalette::Background, colorScheme.background(KColorScheme::NeutralBackground).color()); } if( Settings::self()->getUseOwnFontColor() ){ pen.setColor( Settings::self()->getPriority2Font() ); } painter->fillRect(newOption.rect, newOption.palette.background()); break; case 3: if( Settings::self()->getUseOwnColor() ){ newOption.palette.setColor(QPalette::Background, Settings::self()->getPriority3() ); } else { newOption.palette.setColor(QPalette::Background, colorScheme.background(KColorScheme::PositiveBackground).color()); } if( Settings::self()->getUseOwnFontColor() ){ pen.setColor( Settings::self()->getPriority3Font() ); } painter->fillRect(newOption.rect, newOption.palette.background()); break; default: newOption.palette.setColor(QPalette::Background, colorScheme.background(KColorScheme::NormalBackground).color()); break; } painter->fillRect(newOption.rect, newOption.palette.background()); //qDebug() << newOption.palette.background().color().toRgb(); } painter->save(); QStyledItemDelegate::paint(painter,newOption,index); painter->restore(); if( map["type"] == 0 ){ if( index.column() != 0 ){ return; } QString iconName; if( view->isExpanded(index) ){ iconName = "arrow-down"; } else { iconName = "arrow-right"; } QRect iconRect(originPoint, QSize(15,15)); painter->drawPixmap(iconRect, KIcon(iconName).pixmap(QSize(15,15)) ); painter->save(); painter->setFont(boldFont); QPoint writePoint( originPoint + QPoint(iconRect.size().width()+5,0) ); QString text = cutString( map["name"].toString(), QRect( writePoint, newOption.rect.bottomRight() ), boldFont ); painter->drawText( QRect( writePoint, newOption.rect.bottomRight() ), text ); painter->restore(); } if( map["type"] == 1 ){ painter->save(); painter->setPen(pen); originPoint.ry()++; if( index.column() == 0 ){ originPoint.rx() += 25; // for the checkbox QString text = map["name"].toString(); // if( map["priority"].toInt() == 4 ){ // text.prepend("- "); // } else { // text.prepend( QString::number(map["priority"].toInt()) + " " ); // } text = cutString( text, QRect(originPoint,newOption.rect.bottomRight()), standardFont ); painter->drawText( QRect(originPoint,newOption.rect.bottomRight()), text ); } else { QString text = cutString( map["date"].toDate().toString(), QRect(originPoint,newOption.rect.bottomRight()), standardFont ); painter->drawText( QRect(originPoint,newOption.rect.bottomRight()), text); if(map["date"].toDate().isNull()){ painter->drawText( QRect(originPoint,newOption.rect.bottomRight()), "-"); } } painter->restore(); } }