Bug report #17779
Customization: no way to hide the Locator widget
|Affected QGIS version:||3.7(master)||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||25675|
The Locator Widget is not listed in the QgsCustomizationDialog, as it has no objectName.
After setting its objectName, it's properly included to the tree, however, unticking its checbox is not effective.
#2 Updated by Borys Jurgiel over 2 years ago
I have more details. If I set the objectName in qgisapp.cpp:
mLocatorWidget->setObjectName( QStringLiteral( "mLocatorWidget" ) );
the widget is properly identified and QgsCustomization::updateMainWindow() tries to remove it by calling (qgscustomization.cpp:758):
sb->removeWidget( widget );
However, this call seems to take no effect.
Furthermore, if I modify inserting the widget and put it to the right:
qgisapp.cpp : 2912 - mStatusBar->addPermanentWidget( mLocatorWidget, 0, QgsStatusBar::AnchorLeft ); + mStatusBar->addPermanentWidget( mLocatorWidget, 0 );
The result is strange: qgisapp.cpp successfully places it to the right and then the customization framework moves it to the "normal" (left) position instead of hiding it. IIRC, when I completely commented out the line above, the widget was still visible in the status bar. Is it added in another part of the code? Further investigations needed.