Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] QML chart and drawings widget #7801

Merged
merged 43 commits into from Sep 14, 2018
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
5acd33b
Work in progress
m-kuhn Jun 26, 2018
a5d7c17
Make string translatable
m-kuhn Jul 23, 2018
ae68549
Initial work on QML widget configuration
m-kuhn Jul 23, 2018
493bdb1
f
m-kuhn Aug 3, 2018
a780feb
Add some configuration
m-kuhn Aug 3, 2018
35898f9
Modernize
m-kuhn Aug 14, 2018
f41aaa7
Yay, more QML!
m-kuhn Aug 17, 2018
e8e32fa
Configuration and display
signedav Aug 30, 2018
016b0cb
get attributes from current feature
signedav Sep 3, 2018
bb6702f
basics with configurable code and attributes
signedav Sep 3, 2018
7fd8732
open on drop
signedav Sep 3, 2018
6ac41b4
preview
signedav Sep 3, 2018
3d8d3ac
layout and expressions
signedav Sep 3, 2018
abbe5c5
expressions
signedav Sep 4, 2018
ccdd4df
expressions on qml widget
signedav Sep 4, 2018
561ea3b
improved gui handling
signedav Sep 4, 2018
4ad7067
layout
signedav Sep 4, 2018
ae3176f
docstrings and beautification
signedav Sep 5, 2018
5e1df29
remove unused qmlwidget class
signedav Sep 5, 2018
d6c0899
fixed qml example
signedav Sep 5, 2018
df8862b
return if no widget
signedav Sep 5, 2018
ae1333d
preview feature
signedav Sep 5, 2018
76df5b0
docs and replacement of qmlexpression
signedav Sep 5, 2018
4504845
moved QmlExpression back to header
signedav Sep 5, 2018
5f4acde
some more fixes
signedav Sep 6, 2018
1308966
spelling and missing case in qgsquick
signedav Sep 6, 2018
21a772f
spelling american
signedav Sep 6, 2018
9a6d319
doc
signedav Sep 6, 2018
f6f895a
initialization
signedav Sep 6, 2018
0acf991
add doxygen commands in cpp
signedav Sep 6, 2018
a5fc391
no case default and removed unused doc
signedav Sep 10, 2018
d80ad3d
form_mode for qmlwidgetwrapper expression
signedav Sep 10, 2018
4da6e69
implementation for containers
signedav Sep 11, 2018
05b1e83
update container visibilty on mode change
signedav Sep 11, 2018
b3e4755
Enum Mode in QgsAttributeEditorContext
signedav Sep 11, 2018
533ab61
last fixes and sip_include
signedav Sep 11, 2018
72eb702
QtChart in CMake file
signedav Sep 13, 2018
aa14593
include Qt5chars INCLUDE_DIRECTORIES
signedav Sep 13, 2018
43c47b0
add qt5chartslib
signedav Sep 13, 2018
e0dd43c
qt5charts lib in dockerfile
signedav Sep 13, 2018
6d16b59
qt5charts5 library
signedav Sep 13, 2018
be7cc68
more includes
signedav Sep 14, 2018
b8b737f
removed qt5charts stuff from cmakelist
signedav Sep 14, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
35 changes: 34 additions & 1 deletion python/core/auto_generated/qgsattributeeditorelement.sip.in
Expand Up @@ -47,7 +47,8 @@ layer.
AeTypeContainer,
AeTypeField,
AeTypeRelation,
AeTypeInvalid
AeTypeInvalid,
AeTypeQmlElement
};

QgsAttributeEditorElement( AttributeEditorType type, const QString &name, QgsAttributeEditorElement *parent = 0 );
Expand Down Expand Up @@ -345,6 +346,38 @@ Determines if the "unlink feature" button should be shown

};

class QgsAttributeEditorQmlElement : QgsAttributeEditorElement
{
%Docstring
An attribute editor widget that will represent arbitrary QML code.

.. versionadded:: 3.4
%End

%TypeHeaderCode
#include "qgsattributeeditorelement.h"
%End
public:
QgsAttributeEditorQmlElement( const QString &name, QgsAttributeEditorElement *parent );

virtual QgsAttributeEditorElement *clone( QgsAttributeEditorElement *parent ) const /Factory/;


QString qmlCode() const;
%Docstring
The QML code that will be represented within this widget.

.. versionadded:: 3.4
%End

void setQmlCode( const QString &qmlCode );
%Docstring
The QML code that will be represented within this widget.

@param qmlCode
%End

};

/************************************************************************
* This file has been generated automatically from *
Expand Down
Expand Up @@ -14,6 +14,7 @@
// so RTTI for casting is available in the whole module.
%ModuleCode
#include "qgsrelationwidgetwrapper.h"
#include "qgsqmlwidgetwrapper.h"
%End

class QgsWidgetWrapper : QObject
Expand All @@ -37,6 +38,8 @@ changed status of the widget will be saved.
sipType = sipType_QgsEditorWidgetWrapper;
else if ( qobject_cast<QgsRelationWidgetWrapper *>( sipCpp ) )
sipType = sipType_QgsRelationWidgetWrapper;
else if ( qobject_cast<QgsQmlWidgetWrapper *>( sipCpp ) )
sipType = sipType_QgsQmlWidgetWrapper;
else
sipType = 0;
%End
Expand Down
89 changes: 89 additions & 0 deletions python/gui/auto_generated/editorwidgets/qgsqmlwidgetwrapper.sip.in
@@ -0,0 +1,89 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/editorwidgets/qgsqmlwidgetwrapper.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/


class QgsQmlWidgetWrapper : QgsWidgetWrapper
{
%Docstring
*************************************************************************
qgsqmlwidgetwrapper.h

---------------------
begin : 25.6.2018
copyright : (C) 2018 by Matthias Kuhn
email : matthias@opengis.ch
**************************************************************************

This program is free software; you can redistribute it and/or modify *
it under the terms of the GNU General Public License as published by *
the Free Software Foundation; either version 2 of the License, or *
(at your option) any later version. *

**************************************************************************
%End

%TypeHeaderCode
#include "qgsqmlwidgetwrapper.h"
%End
public:

QgsQmlWidgetWrapper( QgsVectorLayer *layer, QWidget *editor, QWidget *parent );

virtual bool valid() const;


virtual QWidget *createWidget( QWidget *parent );


virtual void initWidget( QWidget *editor );


void reinitWidget();
%Docstring
Clears the content and makes new intialisaton
%End

void setQmlCode( const QString &qmlCode );
%Docstring
writes the ``qmlCode`` into a temporary file
%End

public slots:

virtual void setFeature( const QgsFeature &feature );

%Docstring
passes the ``feature`` into the context property of the widget
%End

};


class QmlExpression : QObject
{

%TypeHeaderCode
#include "qgsqmlwidgetwrapper.h"
%End
public:
void setExpressionContext( const QgsExpressionContext &context );

QVariant evaluate( const QString &expression ) const;
%Docstring
evaluates the value regarding the /a expression and the context
%End

};

/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/editorwidgets/qgsqmlwidgetwrapper.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
43 changes: 43 additions & 0 deletions python/gui/auto_generated/qgsqmlwidget.sip.in
@@ -0,0 +1,43 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsqmlwidget.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/


class QgsQmlWidget
{
%Docstring
*************************************************************************
qgsqmlwidget.h

---------------------
begin : 25.6.2018
copyright : (C) 2018 by Matthias Kuhn
email : matthias@opengis.ch
**************************************************************************

This program is free software; you can redistribute it and/or modify *
it under the terms of the GNU General Public License as published by *
the Free Software Foundation; either version 2 of the License, or *
(at your option) any later version. *

**************************************************************************
%End

%TypeHeaderCode
#include "qgsqmlwidget.h"
%End
public:
QgsQmlWidget();
};

/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsqmlwidget.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
1 change: 1 addition & 0 deletions python/gui/gui_auto.sip
Expand Up @@ -322,4 +322,5 @@
%Include auto_generated/processing/qgsprocessingtoolboxmodel.sip
%Include auto_generated/processing/qgsprocessingtoolboxtreeview.sip
%Include auto_generated/processing/qgsprocessingwidgetwrapper.sip
%Include auto_generated/editorwidgets/qgsqmlwidgetwrapper.sip
%Include auto_generated/qgsadvanceddigitizingcanvasitem.sip