@@ -267,29 +267,6 @@ class QgsPalLayerSettings
267
267
placing labels over any part of the polygon is avoided.*/
268
268
};
269
269
270
- enum ShapeType
271
- {
272
- ShapeRectangle,
273
- ShapeSquare,
274
- ShapeEllipse,
275
- ShapeCircle,
276
- ShapeSVG
277
- };
278
-
279
- enum SizeType
280
- {
281
- SizeBuffer,
282
- SizeFixed,
283
- SizePercent
284
- };
285
-
286
- enum RotationType
287
- {
288
- RotationSync,
289
- RotationOffset,
290
- RotationFixed
291
- };
292
-
293
270
/** Units used for option sizes, before being converted to rendered sizes */
294
271
enum SizeUnit
295
272
{
@@ -299,14 +276,6 @@ class QgsPalLayerSettings
299
276
Percent
300
277
};
301
278
302
- enum ShadowType
303
- {
304
- ShadowLowest,
305
- ShadowText,
306
- ShadowBuffer,
307
- ShadowShape
308
- };
309
-
310
279
// update mDataDefinedNames QMap in constructor when adding/deleting enum value
311
280
enum DataDefinedProperties
312
281
{
@@ -443,13 +412,6 @@ class QgsPalLayerSettings
443
412
*/
444
413
QgsExpression* getLabelExpression();
445
414
446
- QFont textFont;
447
- QString textNamedStyle;
448
- bool fontSizeInMapUnits; //true if font size is in map units (otherwise in points)
449
- QgsMapUnitScale fontSizeMapUnitScale; // scale range for map units for font size
450
- QColor textColor;
451
- int textTransp;
452
- QPainter::CompositionMode blendMode;
453
415
QColor previewBkgrdColor;
454
416
455
417
//! Substitution collection for automatic text substitution with labels
@@ -460,7 +422,6 @@ class QgsPalLayerSettings
460
422
//-- text formatting
461
423
462
424
QString wrapChar;
463
- double multilineHeight; //0.0 to 10.0, leading between lines as multiplyer of line height
464
425
MultiLineAlign multilineAlign; // horizontal alignment of multi-line labels
465
426
466
427
// Adds '<' or '>', or user-defined symbol to the label string pointing to the
@@ -476,62 +437,6 @@ class QgsPalLayerSettings
476
437
int decimals;
477
438
bool plusSign;
478
439
479
- //-- text buffer
480
-
481
- bool bufferDraw;
482
- double bufferSize; // buffer size
483
- bool bufferSizeInMapUnits; //true if buffer is in map units (otherwise in mm)
484
- QgsMapUnitScale bufferSizeMapUnitScale; // scale range for map units for buffer size
485
- QColor bufferColor;
486
- bool bufferNoFill; //set interior of buffer to 100% transparent
487
- int bufferTransp;
488
- Qt::PenJoinStyle bufferJoinStyle;
489
- QPainter::CompositionMode bufferBlendMode;
490
-
491
- //-- shape background
492
-
493
- bool shapeDraw;
494
- ShapeType shapeType;
495
- QString shapeSVGFile;
496
- SizeType shapeSizeType;
497
- QPointF shapeSize;
498
- SizeUnit shapeSizeUnits;
499
- QgsMapUnitScale shapeSizeMapUnitScale;
500
- RotationType shapeRotationType;
501
- double shapeRotation;
502
- QPointF shapeOffset;
503
- SizeUnit shapeOffsetUnits;
504
- QgsMapUnitScale shapeOffsetMapUnitScale;
505
- QPointF shapeRadii;
506
- SizeUnit shapeRadiiUnits;
507
- QgsMapUnitScale shapeRadiiMapUnitScale;
508
- int shapeTransparency;
509
- QPainter::CompositionMode shapeBlendMode;
510
- QColor shapeFillColor;
511
- QColor shapeBorderColor;
512
- double shapeBorderWidth;
513
- SizeUnit shapeBorderWidthUnits;
514
- QgsMapUnitScale shapeBorderWidthMapUnitScale;
515
- Qt::PenJoinStyle shapeJoinStyle;
516
-
517
- //-- drop shadow
518
-
519
- bool shadowDraw;
520
- ShadowType shadowUnder;
521
- int shadowOffsetAngle;
522
- double shadowOffsetDist;
523
- SizeUnit shadowOffsetUnits;
524
- QgsMapUnitScale shadowOffsetMapUnitScale;
525
- bool shadowOffsetGlobal;
526
- double shadowRadius;
527
- SizeUnit shadowRadiusUnits;
528
- QgsMapUnitScale shadowRadiusMapUnitScale;
529
- bool shadowRadiusAlphaOnly;
530
- int shadowTransparency;
531
- int shadowScale;
532
- QColor shadowColor;
533
- QPainter::CompositionMode shadowBlendMode;
534
-
535
440
//-- placement
536
441
537
442
Placement placement;
@@ -700,33 +605,25 @@ class QgsPalLayerSettings
700
605
*/
701
606
QMap< QgsPalLayerSettings::DataDefinedProperties, QgsDataDefined* > dataDefinedProperties;
702
607
703
-
704
- /** Calculates pixel size (considering output size should be in pixel or map units, scale factors and optionally oversampling)
705
- * @param size size to convert
706
- * @param c rendercontext
707
- * @param unit SizeUnit enum value of size
708
- * @param rasterfactor whether to consider oversampling
709
- * @param mapUnitScale a mapUnitScale clamper
710
- * @return font pixel size
711
- */
712
- int sizeToPixel( double size, const QgsRenderContext& c, SizeUnit unit, bool rasterfactor = false, const QgsMapUnitScale& mapUnitScale = QgsMapUnitScale() ) const;
713
-
714
- /** Calculates size (considering output size should be in pixel or map units, scale factors and optionally oversampling)
715
- * @param size size to convert
716
- * @param c rendercontext
717
- * @param unit SizeUnit enum value of size
718
- * @param rasterfactor whether to consider oversampling
719
- * @param mapUnitScale a mapUnitScale clamper
720
- * @return size that will render, as double
721
- */
722
- double scaleToPixelContext( double size, const QgsRenderContext& c, SizeUnit unit, bool rasterfactor = false, const QgsMapUnitScale& mapUnitScale = QgsMapUnitScale() ) const;
723
-
724
608
/** Map of data defined enum to names and old-style indecies
725
609
* The QPair contains a new string for layer property key, and a reference to old-style numeric key (< QGIS 2.0)
726
610
* @note not available in python bindings;
727
611
*/
728
612
// QMap<QgsPalLayerSettings::DataDefinedProperties, QPair<QString, int> > dataDefinedNames() const;
729
613
614
+ /** Returns the label text formatting settings, eg font settings, buffer settings, etc.
615
+ * @see setFormat()
616
+ * @note added in QGIS 3.0
617
+ */
618
+ const QgsTextFormat& format() const;
619
+
620
+ /** Sets the label text formatting settings, eg font settings, buffer settings, etc.
621
+ * @param format label text format
622
+ * @see format()
623
+ * @note added in QGIS 3.0
624
+ */
625
+ void setFormat( const QgsTextFormat& format );
626
+
730
627
// temporary stuff: set when layer gets prepared or labeled
731
628
QgsFeature* mCurFeat;
732
629
QgsFields mCurFields;
@@ -741,9 +638,6 @@ class QgsPalLayerSettings
741
638
int mFeatsSendingToPal; // total features tested for sending into PAL (relative to maxNumLabels)
742
639
int mFeatsRegPal; // number of features registered in PAL, when using limitNumLabels
743
640
744
- QString mTextFontFamily;
745
- bool mTextFontFound;
746
-
747
641
bool showingShadowRects; // whether to show debug rectangles for drop shadows
748
642
};
749
643
0 commit comments