Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add API to allow generation of icons for 3d symbols from app
(still not implement -- but a necessary prerequisite to proper icons)
- Loading branch information
1 parent
c938de4
commit 1484a30
Showing
7 changed files
with
223 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
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,37 @@ | ||
/*************************************************************************** | ||
qgs3dicongenerator.cpp | ||
--------------- | ||
begin : July 2020 | ||
copyright : (C) 2020 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 "qgs3dicongenerator.h" | ||
#include "qgsapplication.h" | ||
|
||
Qgs3DIconGenerator::Qgs3DIconGenerator( QObject *parent ) | ||
: QgsAbstractStyleEntityIconGenerator( parent ) | ||
{ | ||
|
||
} | ||
|
||
void Qgs3DIconGenerator::generateIcon( QgsStyle *, QgsStyle::StyleEntity type, const QString &name ) | ||
{ | ||
QIcon icon; | ||
const QList< QSize > sizes = iconSizes(); | ||
if ( sizes.isEmpty() ) | ||
icon.addFile( QgsApplication::defaultThemePath() + QDir::separator() + QStringLiteral( "3d.svg" ), QSize( 24, 24 ) ); | ||
for ( const QSize &s : sizes ) | ||
{ | ||
icon.addFile( QgsApplication::defaultThemePath() + QDir::separator() + QStringLiteral( "3d.svg" ), s ); | ||
} | ||
|
||
emit iconGenerated( type, name, icon ); | ||
} |
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,34 @@ | ||
/*************************************************************************** | ||
qgs3dicongenerator.h | ||
--------------- | ||
begin : July 2020 | ||
copyright : (C) 2020 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 QGS3DICONGENERATOR_H | ||
#define QGS3DICONGENERATOR_H | ||
|
||
#include "qgsstylemodel.h" | ||
|
||
class QgsSymbol; | ||
|
||
class Qgs3DIconGenerator : public QgsAbstractStyleEntityIconGenerator | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
|
||
Qgs3DIconGenerator( QObject *parent ); | ||
|
||
void generateIcon( QgsStyle *style, QgsStyle::StyleEntity type, const QString &name ) override; | ||
}; | ||
|
||
#endif //QGS3DICONGENERATOR_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
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