Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e12541
commit 7fdc804
Showing
11 changed files
with
252 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
python/core/auto_generated/layout/qgslayoutitemelevationprofile.sip.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/layout/qgslayoutitemelevationprofile.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
class QgsLayoutItemElevationProfile: QgsLayoutItem | ||
{ | ||
%Docstring(signature="appended") | ||
A layout item subclass for elevation profile plots. | ||
|
||
.. versionadded:: 3.30 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgslayoutitemelevationprofile.h" | ||
%End | ||
public: | ||
|
||
QgsLayoutItemElevationProfile( QgsLayout *layout ); | ||
%Docstring | ||
Constructor for QgsLayoutItemElevationProfile, with the specified parent ``layout``. | ||
%End | ||
|
||
static QgsLayoutItemElevationProfile *create( QgsLayout *layout ) /Factory/; | ||
%Docstring | ||
Returns a new elevation profile item for the specified ``layout``. | ||
|
||
The caller takes responsibility for deleting the returned object. | ||
%End | ||
|
||
virtual int type() const; | ||
|
||
virtual QIcon icon() const; | ||
|
||
|
||
public slots: | ||
|
||
virtual void refresh(); | ||
|
||
|
||
protected: | ||
virtual void draw( QgsLayoutItemRenderContext &context ); | ||
|
||
virtual bool writePropertiesToElement( QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context ) const; | ||
|
||
virtual bool readPropertiesFromElement( const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context ); | ||
|
||
|
||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/layout/qgslayoutitemelevationprofile.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/*************************************************************************** | ||
qgslayoutitemelevationprofile.cpp | ||
--------------------------------- | ||
begin : January 2023 | ||
copyright : (C) 2023 by Nyall Dawson | ||
email : nyall dot dawson at gmail dot com | ||
***************************************************************************/ | ||
|
||
/*************************************************************************** | ||
* * | ||
* 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. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#include "qgslayoutitemelevationprofile.h" | ||
#include "qgslayoutitemregistry.h" | ||
|
||
|
||
QgsLayoutItemElevationProfile::QgsLayoutItemElevationProfile( QgsLayout *layout ) | ||
: QgsLayoutItem( layout ) | ||
{ | ||
//get default layout font from settings | ||
const QgsSettings settings; | ||
const QString defaultFontString = settings.value( QStringLiteral( "LayoutDesigner/defaultFont" ), QVariant(), QgsSettings::Gui ).toString(); | ||
if ( !defaultFontString.isEmpty() ) | ||
{ | ||
// QFont f = mFormat.font(); | ||
// f.setFamily( defaultFontString ); | ||
// mFormat.setFont( f ); | ||
} | ||
|
||
//default to a 10 point font size | ||
//mFormat.setSize( 10 ); | ||
//mFormat.setSizeUnit( QgsUnitTypes::RenderPoints ); | ||
|
||
//default to no background | ||
setBackgroundEnabled( false ); | ||
} | ||
|
||
QgsLayoutItemElevationProfile *QgsLayoutItemElevationProfile::create( QgsLayout *layout ) | ||
{ | ||
return new QgsLayoutItemElevationProfile( layout ); | ||
} | ||
|
||
int QgsLayoutItemElevationProfile::type() const | ||
{ | ||
return QgsLayoutItemRegistry::LayoutElevationProfile; | ||
} | ||
|
||
QIcon QgsLayoutItemElevationProfile::icon() const | ||
{ | ||
return QgsApplication::getThemeIcon( QStringLiteral( "/mLayoutItemLabel.svg" ) ); | ||
} | ||
|
||
void QgsLayoutItemElevationProfile::draw( QgsLayoutItemRenderContext &context ) | ||
{ | ||
|
||
} | ||
|
||
bool QgsLayoutItemElevationProfile::writePropertiesToElement( QDomElement &layoutLabelElem, QDomDocument &doc, const QgsReadWriteContext &rwContext ) const | ||
{ | ||
|
||
|
||
return true; | ||
} | ||
|
||
bool QgsLayoutItemElevationProfile::readPropertiesFromElement( const QDomElement &itemElem, const QDomDocument &, const QgsReadWriteContext &context ) | ||
{ | ||
|
||
return true; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/*************************************************************************** | ||
qgslayoutitemelevationprofile.h | ||
------------------------------- | ||
begin : January 2023 | ||
copyright : (C) 2023 by Nyall Dawson | ||
email : nyall dot dawson at gmail dot com | ||
***************************************************************************/ | ||
|
||
/*************************************************************************** | ||
* * | ||
* 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. * | ||
* * | ||
***************************************************************************/ | ||
#ifndef QGSLAYOUTITEMELEVATIONPROFILE_H | ||
#define QGSLAYOUTITEMELEVATIONPROFILE_H | ||
|
||
#include "qgis_core.h" | ||
#include "qgslayoutitem.h" | ||
|
||
/** | ||
* \ingroup core | ||
* \brief A layout item subclass for elevation profile plots. | ||
* \since QGIS 3.30 | ||
*/ | ||
class CORE_EXPORT QgsLayoutItemElevationProfile: public QgsLayoutItem | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
|
||
/** | ||
* Constructor for QgsLayoutItemElevationProfile, with the specified parent \a layout. | ||
*/ | ||
QgsLayoutItemElevationProfile( QgsLayout *layout ); | ||
|
||
/** | ||
* Returns a new elevation profile item for the specified \a layout. | ||
* | ||
* The caller takes responsibility for deleting the returned object. | ||
*/ | ||
static QgsLayoutItemElevationProfile *create( QgsLayout *layout ) SIP_FACTORY; | ||
|
||
int type() const override; | ||
QIcon icon() const override; | ||
|
||
public slots: | ||
|
||
void refresh() override; | ||
|
||
protected: | ||
void draw( QgsLayoutItemRenderContext &context ) override; | ||
bool writePropertiesToElement( QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context ) const override; | ||
bool readPropertiesFromElement( const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context ) override; | ||
|
||
private: | ||
|
||
}; | ||
|
||
#endif //QGSLAYOUTITEMELEVATIONPROFILE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters