This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How not to show the placemark info?

Tags: None
(comma "," separated)
strag
Registered Member
Posts
11
Karma
0
OS

How not to show the placemark info?

Mon Oct 30, 2017 11:24 am
Hello!

I am using marble within my own Qt application to show technical objects on the map. I am using the 15.08 release of marble.

I want to work with placemarks in two modes:
1. Click on the placemark to show placemark information.
It works good.
2. Click on the placemark to add it into the list of objects (that will be used later). In other words, user selects some placemarks on the map clicking on them by mouse.
In this case I don't want to show the placemark information window. How can I block it? I didn't find any methods for it.

Thanks in advance for your help.
strag
Registered Member
Posts
11
Karma
0
OS
There was a very simple solution. As I understood, place information window is displayed using private slot MarbleWidgetPopupMenu::slotInfoDialog(). In order to switch off this slot you can block all signals:
Code: Select all
foreach (QObject* obj, marbleWidget->popupMenu()->children())
            obj->blockSignals(true);


Respectively to switch on displaying of the place information window you should unblock signals:
Code: Select all
foreach (QObject* obj, marbleWidget->popupMenu()->children())
            obj->blockSignals(false);


This solution is not very clean, I think. If someone knows better solution, please, write it here.
legitname
Registered Member
Posts
3
Karma
0
To disable:
Code: Select all
marbleWidget->inputHandler()->setMouseButtonPopupEnabled(Qt::LeftButton, false);

To enable:
Code: Select all
marbleWidget->inputHandler()->setMouseButtonPopupEnabled(Qt::LeftButton, true);

Found here.
https://forum.kde.org/viewtopic.php?t=108798

It certainly works with my application using marble library 0.27.1 version. Haven't tried it with 15.08 release which is 0.21.80 (0.22 Beta 1) library version. According to the source code of 15.08, it should work and should be faster compared to previously posted solution.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]