mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-04 00:04:03 -04:00
Address PR comments
This commit is contained in:
parent
c7e62d619c
commit
100757000f
@ -966,7 +966,7 @@
|
||||
<file>themes/default/mIconFonts.svg</file>
|
||||
<file>themes/default/mActionNewFileGeodatabase.svg</file>
|
||||
<file>themes/default/mIconBrowserRelations.svg</file>
|
||||
<file>themes/default/mActionIdentifyByMouseMove.svg</file>
|
||||
<file>themes/default/mActionIdentifyByMouseOver.svg</file>
|
||||
<file>themes/default/gpsicons/mIconGpsConnect.svg</file>
|
||||
<file>themes/default/gpsicons/mIconGpsDisconnect.svg</file>
|
||||
<file>themes/default/gpsicons/mActionRecenter.svg</file>
|
||||
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
@ -466,12 +466,12 @@ void QgsIdentifyResultsDialog::initSelectionModes()
|
||||
mSelectModeButton = new QToolButton( mIdentifyToolbar );
|
||||
mSelectModeButton->setPopupMode( QToolButton::MenuButtonPopup );
|
||||
QList<QAction *> selectActions;
|
||||
selectActions << mActionSelectFeatures << mActionSelectFeaturesOnMouseMove << mActionSelectPolygon
|
||||
selectActions << mActionSelectFeatures << mActionSelectFeaturesOnMouseOver << mActionSelectPolygon
|
||||
<< mActionSelectFreehand << mActionSelectRadius;
|
||||
|
||||
QActionGroup *group = new QActionGroup( this );
|
||||
group->addAction( mActionSelectFeatures );
|
||||
group->addAction( mActionSelectFeaturesOnMouseMove );
|
||||
group->addAction( mActionSelectFeaturesOnMouseOver );
|
||||
group->addAction( mActionSelectPolygon );
|
||||
group->addAction( mActionSelectFreehand );
|
||||
group->addAction( mActionSelectRadius );
|
||||
@ -479,10 +479,11 @@ void QgsIdentifyResultsDialog::initSelectionModes()
|
||||
mSelectModeButton->addActions( selectActions );
|
||||
mSelectModeButton->setDefaultAction( mActionSelectFeatures );
|
||||
|
||||
|
||||
mIdentifyToolbar->addWidget( mSelectModeButton );
|
||||
|
||||
connect( mActionSelectFeatures, &QAction::triggered, this, &QgsIdentifyResultsDialog::setSelectionMode );
|
||||
connect( mActionSelectFeaturesOnMouseMove, &QAction::triggered, this, &QgsIdentifyResultsDialog::setSelectionMode );
|
||||
connect( mActionSelectFeaturesOnMouseOver, &QAction::triggered, this, &QgsIdentifyResultsDialog::setSelectionMode );
|
||||
connect( mActionSelectPolygon, &QAction::triggered, this, &QgsIdentifyResultsDialog::setSelectionMode );
|
||||
connect( mActionSelectFreehand, &QAction::triggered, this, &QgsIdentifyResultsDialog::setSelectionMode );
|
||||
connect( mActionSelectRadius, &QAction::triggered, this, &QgsIdentifyResultsDialog::setSelectionMode );
|
||||
@ -2402,6 +2403,13 @@ void QgsIdentifyResultsDialog::mActionAutoFeatureForm_toggled( bool checked )
|
||||
{
|
||||
QgsSettings settings;
|
||||
settings.setValue( QStringLiteral( "Map/identifyAutoFeatureForm" ), checked );
|
||||
mActionSelectFeaturesOnMouseOver->setEnabled( ! checked );
|
||||
if ( mSelectModeButton->defaultAction( ) == mActionSelectFeaturesOnMouseOver )
|
||||
{
|
||||
mSelectionMode = QgsMapToolSelectionHandler::SelectSimple;
|
||||
mSelectModeButton->setDefaultAction( mActionSelectFeatures );
|
||||
emit selectionModeChanged();
|
||||
}
|
||||
}
|
||||
|
||||
void QgsIdentifyResultsDialog::mActionHideDerivedAttributes_toggled( bool checked )
|
||||
@ -2545,10 +2553,10 @@ void QgsIdentifyResultsDialog::setSelectionMode()
|
||||
mSelectModeButton->setDefaultAction( mActionSelectPolygon );
|
||||
mSelectionMode = QgsMapToolSelectionHandler::SelectPolygon;
|
||||
}
|
||||
else if ( obj == mActionSelectFeaturesOnMouseMove )
|
||||
else if ( obj == mActionSelectFeaturesOnMouseOver )
|
||||
{
|
||||
mSelectModeButton->setDefaultAction( mActionSelectFeaturesOnMouseMove );
|
||||
mSelectionMode = QgsMapToolSelectionHandler::SelectOnMouseMove;
|
||||
mSelectModeButton->setDefaultAction( mActionSelectFeaturesOnMouseOver );
|
||||
mSelectionMode = QgsMapToolSelectionHandler::SelectOnMouseOver;
|
||||
}
|
||||
else if ( obj == mActionSelectFreehand )
|
||||
{
|
||||
@ -2562,7 +2570,10 @@ void QgsIdentifyResultsDialog::setSelectionMode()
|
||||
}
|
||||
|
||||
if ( oldMode != mSelectionMode )
|
||||
{
|
||||
mActionAutoFeatureForm->setEnabled( mSelectionMode != QgsMapToolSelectionHandler::SelectOnMouseOver );
|
||||
emit selectionModeChanged();
|
||||
}
|
||||
}
|
||||
|
||||
QgsMapToolSelectionHandler::SelectionMode QgsIdentifyResultsDialog::selectionMode() const
|
||||
|
@ -133,7 +133,7 @@ QgsMapTool::Flags QgsMapToolSelect::flags() const
|
||||
break;
|
||||
|
||||
case QgsMapToolSelectionHandler::SelectSimple:
|
||||
case QgsMapToolSelectionHandler::SelectOnMouseMove:
|
||||
case QgsMapToolSelectionHandler::SelectOnMouseOver:
|
||||
case QgsMapToolSelectionHandler::SelectFreehand:
|
||||
case QgsMapToolSelectionHandler::SelectRadius:
|
||||
return QgsMapTool::flags() | QgsMapTool::ShowContextMenu;
|
||||
|
@ -117,7 +117,7 @@ void QgsMapToolSelectionHandler::canvasReleaseEvent( QgsMapMouseEvent *e )
|
||||
switch ( mSelectionMode )
|
||||
{
|
||||
case QgsMapToolSelectionHandler::SelectSimple:
|
||||
case QgsMapToolSelectionHandler::SelectOnMouseMove:
|
||||
case QgsMapToolSelectionHandler::SelectOnMouseOver:
|
||||
selectFeaturesReleaseEvent( e );
|
||||
break;
|
||||
case QgsMapToolSelectionHandler::SelectPolygon:
|
||||
@ -136,7 +136,7 @@ void QgsMapToolSelectionHandler::canvasMoveEvent( QgsMapMouseEvent *e )
|
||||
{
|
||||
switch ( mSelectionMode )
|
||||
{
|
||||
case QgsMapToolSelectionHandler::SelectOnMouseMove:
|
||||
case QgsMapToolSelectionHandler::SelectOnMouseOver:
|
||||
case QgsMapToolSelectionHandler::SelectSimple:
|
||||
selectFeaturesMoveEvent( e );
|
||||
break;
|
||||
@ -156,7 +156,7 @@ void QgsMapToolSelectionHandler::canvasPressEvent( QgsMapMouseEvent *e )
|
||||
{
|
||||
switch ( mSelectionMode )
|
||||
{
|
||||
case QgsMapToolSelectionHandler::SelectOnMouseMove:
|
||||
case QgsMapToolSelectionHandler::SelectOnMouseOver:
|
||||
case QgsMapToolSelectionHandler::SelectSimple:
|
||||
selectFeaturesPressEvent( e );
|
||||
break;
|
||||
@ -196,14 +196,21 @@ void QgsMapToolSelectionHandler::selectFeaturesPressEvent( QgsMapMouseEvent *e )
|
||||
void QgsMapToolSelectionHandler::selectFeaturesMoveEvent( QgsMapMouseEvent *e )
|
||||
{
|
||||
|
||||
if ( mSelectionMode == QgsMapToolSelectionHandler::SelectOnMouseMove )
|
||||
if ( mSelectionMode == QgsMapToolSelectionHandler::SelectOnMouseOver )
|
||||
{
|
||||
mOnMouseMoveDelayTimer.reset( new QTimer( ) );
|
||||
// This is a (well known, according to google) false positive,
|
||||
// I tried all possible NOLINT placements without success, this
|
||||
// ugly ifdef seems to do the trick with silencing the warning.
|
||||
#ifndef __clang_analyzer__
|
||||
mOnMouseMoveDelayTimer = std::make_unique<QTimer>( );
|
||||
mOnMouseMoveDelayTimer->singleShot( 300, mOnMouseMoveDelayTimer.get(), [ = ]
|
||||
{
|
||||
setSelectedGeometry( QgsGeometry::fromPointXY( toMapCoordinates( e->pos() ) ), e->modifiers() );
|
||||
if ( mCanvas->underMouse() )
|
||||
{
|
||||
setSelectedGeometry( QgsGeometry::fromPointXY( toMapCoordinates( e->pos() ) ), e->modifiers() );
|
||||
}
|
||||
} );
|
||||
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -98,10 +98,10 @@ class QgsMapToolSelectionHandler : public QObject
|
||||
SelectRadius,
|
||||
|
||||
/**
|
||||
* SelectOnMouseMove - selection on mouse move
|
||||
* SelectOnMouseMove - selection on mouse over
|
||||
* \since QGIS 3.30
|
||||
*/
|
||||
SelectOnMouseMove
|
||||
SelectOnMouseOver
|
||||
};
|
||||
Q_ENUM( SelectionMode )
|
||||
|
||||
|
@ -325,16 +325,16 @@
|
||||
<string>Identify Features by area or single click</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="mActionSelectFeaturesOnMouseMove">
|
||||
<action name="mActionSelectFeaturesOnMouseOver">
|
||||
<property name="icon">
|
||||
<iconset resource="../../images/images.qrc">
|
||||
<normaloff>:/images/themes/default/mActionIdentifyByMouseMove.svg</normaloff>:/images/themes/default/mActionIdentifyByMouseMove.svg</iconset>
|
||||
<normaloff>:/images/themes/default/mActionIdentifyByMouseOver.svg</normaloff>:/images/themes/default/mActionIdentifyByMouseOver.svg</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Identify Feature(s) on mouse move</string>
|
||||
<string>Identify Feature(s) on mouse over</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Identify Features by mouse over</string>
|
||||
<string>Identify Features by hovering on a feature with the mouse</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="mActionSelectPolygon">
|
||||
|
Loading…
x
Reference in New Issue
Block a user