Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Get selection color from map canvas
- Loading branch information
|
@@ -269,6 +269,12 @@ Read property of QColor bgColor. |
|
|
.. versionadded:: 2.4 |
|
|
%End |
|
|
|
|
|
QColor selectionColor() const; |
|
|
%Docstring |
|
|
.. versionadded:: 3.0 |
|
|
:rtype: QColor |
|
|
%End |
|
|
|
|
|
void updateScale(); |
|
|
%Docstring |
|
|
Emits signal scaleChanged to update scale in main window |
|
|
|
@@ -9907,16 +9907,11 @@ void QgisApp::new3DMapCanvas() |
|
|
QgsProject *prj = QgsProject::instance(); |
|
|
QgsRectangle fullExtent = mMapCanvas->fullExtent(); |
|
|
|
|
|
int r = prj->readNumEntry( QStringLiteral( "Gui" ), QStringLiteral( "/SelectionColorRedPart" ), 255 ); |
|
|
int g = prj->readNumEntry( QStringLiteral( "Gui" ), QStringLiteral( "/SelectionColorGreenPart" ), 255 ); |
|
|
int b = prj->readNumEntry( QStringLiteral( "Gui" ), QStringLiteral( "/SelectionColorBluePart" ), 255 ); |
|
|
int a = prj->readNumEntry( QStringLiteral( "Gui" ), QStringLiteral( "/SelectionColorAlphaPart" ), 255 ); |
|
|
|
|
|
Map3D *map = new Map3D; |
|
|
map->crs = prj->crs(); |
|
|
map->originX = fullExtent.center().x(); |
|
|
map->originY = fullExtent.center().y(); |
|
|
map->setSelectionColor( QColor( r, g, b, a ) ); |
|
|
map->setSelectionColor( mMapCanvas->selectionColor() ); |
|
|
map->setBackgroundColor( mMapCanvas->canvasColor() ); |
|
|
map->setLayers( mMapCanvas->layers() ); |
|
|
|
|
|
|
@@ -1595,6 +1595,11 @@ void QgsMapCanvas::setSelectionColor( const QColor &color ) |
|
|
mSettings.setSelectionColor( color ); |
|
|
} |
|
|
|
|
|
QColor QgsMapCanvas::selectionColor() const |
|
|
{ |
|
|
return mSettings.selectionColor(); |
|
|
} |
|
|
|
|
|
int QgsMapCanvas::layerCount() const |
|
|
{ |
|
|
return mapSettings().layers().size(); |
|
|
|
@@ -259,6 +259,10 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView |
|
|
//! \since QGIS 2.4 |
|
|
void setSelectionColor( const QColor &color ); |
|
|
|
|
|
//! Returns color for selected features |
|
|
//! \since QGIS 3.0 |
|
|
QColor selectionColor() const; |
|
|
|
|
|
//! Emits signal scaleChanged to update scale in main window |
|
|
void updateScale(); |
|
|
|
|
|