10186 Commits

Author SHA1 Message Date
Nyall Dawson
02d0a046f8 Add some shortcuts to zoom to layout/layout width in status bar combobox 2017-07-11 12:23:30 +10:00
Nyall Dawson
e27a32d41c Add status bar zoom control to layout designer 2017-07-11 11:48:22 +10:00
Nyall Dawson
ac83093570 Port zoom actions from composer to layout designer 2017-07-11 11:06:36 +10:00
Nyall Dawson
cf488d34a4 Split layout item registry into two separate registries
Instead of relying on forward declared c++ classes from
gui in QgsLayoutItemRegistry, instead create a
QgsLayoutItemGuiRegistry which handles registration
of all the GUI specific behavior relating to layout items.

Remove all GUI related code from QgsLayoutItemRegistry.

This creates a cleaner split between core/gui code, and
given that there'll be a lot of gui specific behavior
which needs to be handled by a registry it makes sense
to keep this isolated in gui.

It also plays nicer with the sip bindings, which can't
handle forward declared gui classes in core.
2017-07-11 11:06:36 +10:00
Nyall Dawson
0307cac325 Port ability to pan layouts with middle mouse button depressed 2017-07-11 11:06:36 +10:00
Nyall Dawson
b9bbd91754 Port ability to navigate layouts using space-pan and ctrl-space zoom 2017-07-11 11:06:36 +10:00
Nyall Dawson
179c51c953 Don't auto populate QgsLayoutItemRegistry
Initially create an empty registry, allow it to be populated
at a later stage.
2017-07-11 11:06:36 +10:00
Nyall Dawson
20ca51b59c Port ability to wheel zoom into/out of layout designer 2017-07-11 11:06:36 +10:00
Nyall Dawson
4065a7ff67 Add shell for non-functional layout select tool 2017-07-11 11:06:36 +10:00
Nyall Dawson
dc0425abee Update cursor on alt press/release for zoom tool 2017-07-11 11:06:36 +10:00
Nyall Dawson
7974597c08 Add a zoom tool to designer dialog 2017-07-11 11:06:36 +10:00
Nyall Dawson
41b98aa23c Add layout zoom tool 2017-07-11 11:06:36 +10:00
Nyall Dawson
867bdb6117 Move click-and-drag detection to QgsLayoutViewTool 2017-07-11 11:06:36 +10:00
Nyall Dawson
5cac2f71f0 Allow setting pen/brush for QgsLayoutViewRubberBand 2017-07-11 11:06:36 +10:00
Nyall Dawson
a346736df2 Handle tool changes mid press-release operation
Because it's possible for users to change the tool while a
press release operation is mid-way, e.g. by pressing a tool
shortcut key.
2017-07-11 11:06:36 +10:00
Nyall Dawson
3f66520828 Add layout panning tool 2017-07-11 11:06:36 +10:00
Nyall Dawson
db62a745eb Add a temporary layout item type for testing 2017-07-11 11:06:36 +10:00
Nyall Dawson
86bc8af216 Add some unit tests 2017-07-11 11:06:36 +10:00
Nyall Dawson
3843b5ef37 Create rubber band classes for layout views
c++ QgsLayoutItem metadata classes can directly register
a function which creates a QgsLayoutViewRubberBand for the item
subclass.

Python code cannot utilise this shortcut (due to inaccessibility
of forward declared gui classes from core Python classes), so
there's a separate gui registry utility class added for registering
prototypes for rubber bands for already registered item types.
2017-07-11 11:06:36 +10:00
Nyall Dawson
4ebea75e6a Subclass QMouseEvent to QgsLayoutViewMouseEvent
For easy access to mouse event coordinates in layout coordinate
space (and future use with snapped item coordinates)
2017-07-11 11:06:35 +10:00
Nyall Dawson
a6ccd63bc8 Start implementing an add item tool 2017-07-11 11:06:35 +10:00
Nyall Dawson
25034979e3 Add some unit tests for layout tools 2017-07-11 11:06:35 +10:00
Nyall Dawson
99f34300b9 Add shell classes for layout view tools
Copy the same model as QgsMapCanvas uses, with separate
classes for individual interaction tools instead of keeping
all the logic in the QGraphicsView subclass (as is done
with composer)
2017-07-11 11:06:35 +10:00
Nyall Dawson
4c2447fd89 Add shell for QgsLayoutView 2017-07-11 11:06:35 +10:00
Nyall Dawson
67c6e8f2b8 Merge pull request #4834 from mhugo/fix_attribute_element_sip
Fix QgsAttributeEditorContainer SIP
2017-07-11 11:02:25 +10:00
Hugo Mercier
224c4c1313 Fix QgsAttributeEditorContainer SIP 2017-07-10 17:02:54 +02:00
Nyall Dawson
2b8e06719e Add sip subclass code for QgsProcessingAlgorithm 2017-07-10 17:09:42 +10:00
Nyall Dawson
326d6f5fc7 Allow child algorithm configuration to be stored and handled by models 2017-07-10 17:02:23 +10:00
Nyall Dawson
9e8a114553 Allow specifying algorithm configuration when calling create 2017-07-10 16:41:35 +10:00
Nyall Dawson
1e13d733c2 Move declaration of algorithm parameters/outputs to a new virtual
initAlgorithm() method

This allows 2 benefits:
- algorithms can be subclassed and have subclasses add additional
parameters/outputs to the algorithm. With the previous approach
of declaring parameters/outputs in the constructor, it's not
possible to call virtual methods to add additional parameters/
outputs (since you can't call virtual methods from a constructor).

- initAlgorithm takes a variant map argument, allowing the algorithm
to dynamically adjust its declared parameters and outputs according
to this configuration map. This potentially allows model algorithms which
can be configured to have variable numbers of parameters and
outputs at run time. E.g. a "router" algorithm which directs
features to one of any number of output sinks depending on some
user configured criteria.
2017-07-10 16:31:14 +10:00
Nyall Dawson
fc221a6ebe Add sip VirtualCatcherCode to avoid algorithm copies being
destroyed by the python garbage collector

The code generated with the /Factory/ annotation was not sufficient
to correctly transfer the ownership of objects created in Python
back to c++ (despite mailing list messages which hint that it
is).

Anyway, this awful abomination works. Let's all move on to more
useful ways to spend our time...
2017-07-10 15:51:02 +10:00
Nyall Dawson
03275bbace Split QgsProcessingAlgorithm::create into non virtual-create
and pure virtual createInstance

Allows us to add logic which always need applying within
create(), leaving createInstance() free to just return a
raw new instance of the class
2017-07-10 10:07:32 +10:00
Nyall Dawson
7753ba11f7 Model child algorithms store a copy of the algorithm itself
Instead of always retrieving it from the registry
2017-07-09 17:17:29 +10:00
Nyall Dawson
cd6e7d78cf Add method to processing registry to create a new instance of an algorithm directly 2017-07-09 17:14:45 +10:00
Nyall Dawson
fedf88ea3d Remove redundant sip file 2017-07-08 20:53:02 +10:00
Nyall Dawson
f49b603443 Split QgsProcessingModelAlgorithm into separate components
The cpp/h file was getting too large, so split off the individual
subcomponents into their own h/cpp files to keep code
maintainable.
2017-07-08 20:49:17 +10:00
Nyall Dawson
cfa18039af Fix incorrect icon size in processing windows
Well... kind of. It fixes the toolbar button size, but for some
reason the actual icon content itself isn't being resized. I can't
work out why this is...
2017-07-08 20:49:17 +10:00
Nyall Dawson
a3fdb95d0a Update model input type names 2017-07-08 20:49:17 +10:00
Nyall Dawson
7db1a9dfd3 Save and restore window geometry for modeler dialogs 2017-07-08 20:49:17 +10:00
Nyall Dawson
3665e462c8 Use a filter line edit for outputs 2017-07-08 20:49:17 +10:00
Nyall Dawson
0836c60712 Make model editor dialog more robust while loading models 2017-07-08 20:49:17 +10:00
Nyall Dawson
9d04f87249 Rename "output" style parameters for clarity
The previous naming was too easily confused with processing outputs.
Rename them to QgsProcessingParameterFileDestination, etc... to
make it clearer what they are used for.
2017-07-08 20:49:17 +10:00
Nyall Dawson
f82b41e001 Move an enum to new QgsProcessing class 2017-07-08 20:49:17 +10:00
Nyall Dawson
febf0a0e6e Rename method to more generic name - it's usable by vector layer outputs too 2017-07-08 20:49:17 +10:00
Nyall Dawson
d443bb3cbe Expose compatible vector layer parameter evaluation to QgsProcessingAlgorithm 2017-07-08 20:49:17 +10:00
Nyall Dawson
9e184feaed Add method to evaluate parameters to compatible vector layers
of a specified type
2017-07-08 20:49:17 +10:00
Matthias Kuhn
e2c84f1a50 Merge pull request #4669 from nyalldawson/spinbox_ctrl
When holding ctrl while mouse wheeling on spin box, increase in smaller amounts
2017-07-08 10:37:00 +02:00
Matthias Kuhn
875a5d6d9d Merge pull request #4818 from DelazJ/spelling
Fix some spelling issues
2017-07-08 10:20:40 +02:00
Matthias Kuhn
efff5f1670 [FEATURE] Add with_variable function
This function sets a variable for parts of an expression, therefore
avoiding to repeatedly recalculate complex values.
2017-07-07 12:59:43 +02:00
Matthias Kuhn
9581fe0a10 [FEATURE] Add snapping results to default value calculation
... as @snapping_results variable
2017-07-07 12:58:55 +02:00