35186 Commits

Author SHA1 Message Date
Nyall Dawson
4166a3ea62 Fix most clazy qstring-unneeded-heap-allocations warnings
By flipping string literals to QStringLiteral/QLatin1String

see

https://woboq.com/blog/qstringliteral.html
2016-10-24 15:26:24 +10:00
Nyall Dawson
f6a344c2c1 Add QgsTextFormatPanelWidget for text format control inside panel 2016-10-24 12:02:00 +10:00
Nyall Dawson
8fa8167d7b Add a simple dialog for configuring text formatting 2016-10-24 12:02:00 +10:00
Nyall Dawson
4282474c26 Respect render context antialiasing setting in text renderer 2016-10-24 12:02:00 +10:00
Nyall Dawson
76c12ba94c Split QgsLabelingGui off into QgsTextFormatWidget
New widget allows for setting just the formatting properties
of text
2016-10-24 12:02:00 +10:00
Nyall Dawson
169b367c5b [FEATURE] Allow label font size in mm/pixels
And all other label sizes (eg buffer size) now accept sizes in
pixels too
2016-10-24 12:02:00 +10:00
Nyall Dawson
25b3c63370 Remove unused QgsLabelPreview class 2016-10-24 12:02:00 +10:00
Nyall Dawson
0b88de2487 New widget QgsTextPreview for previewing all formatting for QgsTextRenderer
Switch the labeling gui to use this widget, which has the benefits:
- previews all label settings, including shadow and background
- previews at a specified scale, so that any sizes using map units
will be correct
2016-10-24 12:02:00 +10:00
Nyall Dawson
e3517c6f4c Fix text renderer not respecting min/max mm scale for map units (fix #14698) 2016-10-24 12:02:00 +10:00
Nyall Dawson
a5356011fc Test masks 2016-10-24 12:02:00 +10:00
Nyall Dawson
e820da3c20 Fix unit handling for labeling dialog 2016-10-24 12:02:00 +10:00
Nyall Dawson
08143475ed [FEATURE] QgsTextRenderer class for rich text rendering
Moves all the drawing code out of labeling into a new class
which just handles rendering text. This allows other parts
of the code to utilise all the advanced formatting options
that labeling supports, eg rendering text with shadows,
buffers and backgrounds.
2016-10-24 12:02:00 +10:00
Nyall Dawson
074ae4219d Restore separate handling of label component opacity
...in a way that avoids unnecessary detachments of the
settings objects
2016-10-24 12:02:00 +10:00
Nyall Dawson
5495f20589 Minor refactor of label drawing
Remove use of scale factors from PAL layer settings and use
render context factors directly
2016-10-24 12:02:00 +10:00
Nyall Dawson
aac2622816 Remove option to show label shadow rectangles from GUI
...and instead just make it #ifdef out
2016-10-24 12:02:00 +10:00
Nyall Dawson
4d5e7536d9 Flip QgsPalLayerSettings to use QgsTextRenderer classes 2016-10-24 12:02:00 +10:00
Nyall Dawson
5f241d6288 Implicitly shared text settings classes 2016-10-24 12:02:00 +10:00
Nyall Dawson
687c66f5d6 Add Points as valid render unit (for font sizes) 2016-10-24 12:02:00 +10:00
Nyall Dawson
796711031b Merge pull request #3663 from nyalldawson/clazy3
Clazy qt5 optimisations - round 2
2016-10-24 11:59:54 +10:00
Nyall Dawson
2fab1b8bbe Fix doxygen warnings/missing docs 2016-10-24 11:42:02 +10:00
Nyall Dawson
b4e310120f Fix bad snapping signal names 2016-10-24 11:25:00 +10:00
Nyall Dawson
5eb875d63b [processing] Add algorithm to strip null geometries 2016-10-24 11:24:37 +10:00
Nyall Dawson
2fb8695dbe Use isEmpty() rather than size() to check for empty lists 2016-10-24 10:36:24 +10:00
Nyall Dawson
44289084e9 Optimise passing of variables by ref/value 2016-10-24 10:36:23 +10:00
Nyall Dawson
8a742e9445 Fix some clazy container-inside-loop warnings
From the clazy docs:

"Finds places defining containers inside loops. Defining them
outside the loop and using resize(0) will save memory allocations."
2016-10-24 10:36:23 +10:00
Nyall Dawson
bdc39ff659 Fix clazy reserve-candidates suggestions
Avoids repeated memory allocations
2016-10-24 10:36:22 +10:00
Nyall Dawson
904b004de9 Fix clazy missing-typeinfo warnings
From the clazy docs:

"Suggests usage of Q_PRIMITIVE_TYPE or Q_MOVABLE_TYPE in cases where
you're using QList<T> and sizeof(T) > sizeof(void*) or using
QVector<T>, unless they already have a type info classification."
2016-10-24 10:36:22 +10:00
Nyall Dawson
3272964f58 Fix classes which violate the rule-of-three
(identified using clazy analyser)
2016-10-24 10:36:22 +10:00
Nyall Dawson
12a7bb34e8 [processing] Fix qgis zonal stats algorithm 2016-10-24 08:41:16 +10:00
Matthias Kuhn
96a649e37f Add missing bindings 2016-10-23 21:14:42 +02:00
Matthias Kuhn
54b953f433 Cleanup and modernize QgsProject code 2016-10-23 20:54:41 +02:00
Juergen E. Fischer
28abbf9513 add *.py to .gitattributes 2016-10-23 08:38:36 +02:00
Paolo Cavallini
66b66ed450 Update r.mapcalc.txt
Better description of r.mapcalc
2016-10-23 07:42:51 +02:00
Matthias Kuhn
1445647065 QgsVectorDataProvider API cleanup 2016-10-22 23:03:57 +02:00
Nyall Dawson
ec25df1565 Merge pull request #3659 from nyalldawson/clazy3
Fix clazy level 0 checks
2016-10-23 05:20:47 +10:00
Nyall Dawson
1dca938306 Fix some clazy "inefficient-qlist-soft" warnings
From the clazy docs:

Finds QList<T> where sizeof(T) > sizeof(void*).
QVector<T> should be used instead.
2016-10-22 22:46:18 +10:00
Nyall Dawson
498d03b88a Fix clazy qstring-left warnings
From the clazy docs:

Finds places where you're using QString::left(0) instead
of QString::at(0). The later form is cheaper.
2016-10-22 22:46:18 +10:00
Nyall Dawson
368a04a4d1 Fix clazy "detaching-temporary" warnings
From the clazy docs:

Finds places where you're calling non-const member functions on
temporaries. For example getList().first(), which would detach
if the container is shared.
2016-10-22 22:46:18 +10:00
Nyall Dawson
06cf59a4c2 Add missing references in Q_FOREACH loops 2016-10-22 22:46:17 +10:00
Nyall Dawson
35ecdd1a98 Fix issues with writing to temporary objects 2016-10-22 22:46:17 +10:00
Nyall Dawson
a3968a29bd Fix clazy qmap-with-pointer-key warnings
From the clazy docs:

Finds cases where you're using QMap<K,T> and K is a pointer.

QMap has the particularity of sorting it's keys, but sorting
by memory address makes no sense. Use QHash instead, which
provides faster lookups.
2016-10-22 22:46:16 +10:00
Nyall Dawson
bd20fe425f Fix clazy qvariant-template-instantiation warning
From the clazy docs:

Detects when you're using QVariant::value<Foo>() instead
of QVariant::toFoo().

The former results in more code being generated.
2016-10-22 22:46:16 +10:00
Nyall Dawson
ad13699a23 Fix clazy temporary-iterator warning
Calling constBegin/constEnd on temporary container can result
in endless loop
2016-10-22 22:46:16 +10:00
Nyall Dawson
9459831422 Remove unused variables 2016-10-22 22:46:15 +10:00
Nyall Dawson
fae8071a1e Fix clazy qstring-arg warnings
Avoid chained QString::arg() calls and instead use the multi-arg
overload to save memory allocations
2016-10-22 22:46:15 +10:00
Nyall Dawson
f2672151c2 Fix clazy qfileinfo-exists warnings
From the clazy docs:

Finds places using QFileInfo("foo").exists() instead of the faster
version QFileInfo::exists("foo"). According to Qt's docs: "Using
this function is faster than using QFileInfo(file).exists() for
file system access."
2016-10-22 22:46:14 +10:00
Nyall Dawson
ef5110732b Fix clazy "qstring-ref" warnings
From the clazy docs:

Finds places where QString::fooRef() should be used instead of
QString::foo(), to avoid temporary heap allocations

eg

str.mid(5).toInt(ok) // BAD

str.midRef(5).toInt(ok) // GOOD
2016-10-22 22:46:14 +10:00
Juergen E. Fischer
6acf0f745f msvc: use /bigobj for sip modules
(cherry picked from commit d0b3e39cdab1da17d7a977ba3def5ce1b64ff707)
2016-10-22 12:28:44 +02:00
Juergen E. Fischer
2cb6982113 release.pl: stay on same master* branch
(cherry picked from commit cc429785edd16a91f7118cb7a1b964492988546f)
2016-10-22 12:28:44 +02:00
Nyall Dawson
a51bebdacc Fix missing doc warning 2016-10-22 13:19:32 +10:00