Selected property of a Map control in Power Apps remains blank - dictionary

I have created an app with Power Apps for door to door agents using a Map component as the main part. The agent would see a bunch of pins on the map and select a pin nearby. The information behind this pin is then populated in a form next to the map. The datasource is a Sharepoint List.
Setup below is a new simplified version of the app: a screen with two controls:
Map (mapTest): source = Sharepoint List with 4 columns (Title, Label, Lat, Long)
Label (labelTest): Text property = mapTest.Selected.Label
When I start the app, the pin is shown, so the data gets fetched from the Sharepoint List.
When I click on the pin, the info card with all values is shown but the mapTest.Selected value stays blank.
I'm aware that I should use variables but even then it doesn't work.
The app worked fine for a couple of weeks but since today the Selected property of the Map stays blank when I select a pin on the map. I haven't changed anything to the app. I've created a new app to find the cause but no success. Is it possible that Microsoft pushed an update without warning?

I also noticed that the onclick events fire both, when a pin is selected and when the map is clicked. It did not use to do so.
We used the "click map" to re-center/zoom and the "select" to pick the information from the Pin. Now it re-centers both when you click a pin and when you click the map (and it does not pick the information from the pin) :(

Related

QComboBox Does Not Display Current Text in UI When a Non-Default Value is Selected

I am developing a UWP application for Windows 10 using Qt for UWP.
One of the UI elements in my application is a QComboBox. The application's logic and the corresponding UI works as expected when the default value (text) is not changed.
However, when I select a different value from the drop-down list, the selected value is not displayed once the drop-down list closes. The box still shows the default value (text). But when I observe the value received by currentIndex, it corresponds to the selected value. Whenever I select a non-default value, the UI seems to be blocked. I cannot interact with any other UI elements except the QComboBox element.
Has anyone faced this problem before? How do I ensure that the current selected values is displayed in the QComboBox?
UPDATE:
I built a demo application to check the QComboBox functionality on its own and I see the same behavior. I just added a few items to the QComboBox widget and built the application with both msvc2017_64 and winrt_x64_msvc2017 of Qt 5.14.1.
When I launch the app that was build using msvc2017_64, I get a window with the QComboBox widget. When I select a value, that value is displayed when the drop-down menu closes.
However, when this is not the case with the UWP application that I build with winrt_x64_msvc2017. It does not show me the updated value. It stays stuck at the default value.
Another problem that I observed in my original UWP app was that whenever I click on the QComboBox and select a value, I do not get control of the UI back. Everything in the UI is stuck but whichever button I click is emitting the signal in the background. The UI does not respond at all.
UPDATE 2
I was tinkering around trying to understand what was causing this behavior. During this process, I stumbled upon a workaround to get the UI to respond again. If I launch a QMessageBox within the QComboBox's currentTextChanged signal, I get the UI control back (the currentText changes to the value that I previously selected) when I press OK on the QMessageBox pop-up.
I do not understand why this workaround gives me back control of the UI and gets things working. Please help me understand this.

Reactivate drag control fails in openlayers

all. I have this little Problem and i'am looking for some help:
first I have a function which contains the following:
var point = new OpenLayers.Geometry.Point(imageConfig.XPos, imageConfig.YPos);
var imageFeature = new OpenLayers.Feature.Vector(point);
layers.imageLayer.addFeatures([imageFeature]);
So a point is be drawn on the layer. On this layer there is also an openlayers drag control. It is activated after the point was drawn. Now I can drag the point around. Works like a charm.
This is a little part of a user driven step by step procedure. So after dragging is done the next steps doing something with the point. While these other steps the drag control is deactivated. In the procedure it is possible to jump between steps so the de/activate of the drag control is needed. This works fine.
At the end of all steps the point is removed from the layer. Also this works great.
BUT: if I call again the function which draws the point on the layer (of cause now it is a new one) and activate the drag control I cant drag the new point any more even if I try to select the point with mouse click?!
I controlled with firbug:
feature is there
feature is on the right layer
control is there
control is on the right layer
control is activated
Maybe I' am missing a simple thing here. But I breaking my hed on this for two days now and can't find an answer.
By the way I found that in the first step sequence (when all works great) the controls feature property is set with the point feature. But in the second not. The same in the controls drag handler feature property.
I tried to set it manually by:
control.feature = imageFeature
and:
control.handler.drag.feature = imageFeature
I was looking for a function to set the new feature to the control. But can't find any on the openlayers docs.
Other controls at not active at the same time (controlled it with firebug).
But no luck. Didn't help. Why this? I'am sure that this should work. What am I doing wrong or miss under standing here???
Every help appreciated.
Thanks
Figured it out by my self. Problem was that I used a geoext feature store to display points in a grid. This grid was configured wit a geoext feature selection model. I just copied this...
The selection model also asign a feature select control on the map. In the first round this do no conflicts to the drag control because it is loaded after.
When the the tool enters the first step again all controls are loaded to the map. the select control and the drag control is enabled. this can't be handled by open layers. It seems the last to map added control is the one which comes with priority. So you can enable the drag control after again and again. The select control wins.
The trick is to decativate the select control. Then all works perfect.

How to detect a mouse click inside a tooltip in Qt?

I have a Qt application in which certain QLabel's display a tooltip if a certain internal condition occurs.
Since the tooltip has a timeout and is hidden by Qt automatically, the tooltip is kept alive by the application by showing the tooltip every 3 seconds (I did not find any mechanism to tell Qt to show a tooltip indefinitely).
The tooltip is displayed until the user clicks on the QLabel itself: the tooltip is not refreshed any more and disappears.
I now have a new requirement that the tooltip should also disappear if the user clicks on the tooltip itself. Is there a signal that is sent when the user clicks on a visible tooltip? Or is it necessary to use some more sophisticated technique?
EDIT
I have checked my code again, here is some extra information.
Qt does detect a mouse click on a tooltip and hides it, but the application immediately shows the tooltip again.
What I would like to do is that Qt informs my code of the mouse-clicked event, so that it stops showing the tooltip again and again. I have two possible solutions in mind, but I do not know if either of them is technically feasible:
Remove tooltip timeout: when a tooltip is shown, it remains visible as long as the user does not click on it. How can I display a tooltip without a timeout in Qt?
Keep the tooltip visible by repeatedly showing it; detect a mouse clicked on the tooltip in order to stop the keep-alive loop. How do I receive a signal when the user clicks on a tooltip?
Under the hood, the actual class that implements the tooltip is a private QLabel-derived class called QTipLabel:
http://qt.gitorious.org/qt/qt/blobs/4.7/src/gui/kernel/qtooltip.cpp#line119
There's nothing published in the interface to get at an instance of that class from QToolTip, so intercepting clicks would only be done with some sort of ill-advised hack.
That said: among the events that should "hideTipImmediately" is QEvent::mouseButtonPress...in fact, there's an event filter installed so that any click in the app will hide it:
http://qt.gitorious.org/qt/qt/blobs/4.7/src/gui/kernel/qtooltip.cpp#line325
So if you're not seeing the tooltip disappear when it's being clicked on, there's a bug. (Clicking on tooltips hides them for me in Qt-based apps under Kubuntu.)
Note the definition of QToolTip::showText:
void QToolTip::showText ( const QPoint & pos, const QString & text,
QWidget * w, const QRect & rect ) [static] Shows text as a tool tip,
with the global position pos as the point of interest. The tool tip
will be shown with a platform specific offset from this point of
interest.
If you specify a non-empty rect the tip will be hidden as soon as you
move your cursor out of this area.
The rect is in the coordinates of the widget you specify with w. If
the rect is not empty you must specify a widget. Otherwise this
argument can be 0 but it is used to determine the appropriate screen
on multi-head systems.
If text is empty the tool tip is hidden. If the text is the same as
the currently shown tooltip, the tip will not move. You can force
moving by first hiding the tip with an empty text, and then showing
the new tip at the new position.
Thus, you can supply the rectangle in which the QToolTip is to be presented. Then, if what you want to do is close the QToolTip only when the user clicks on it, you can capture mouseButtonPress events as #HostileFork pointed out and then close the tooltip only when the coordinates of the event fall within it.

Storing a state of a dialog box

if I have a dialog box with some checkboxes, some ratiobuttons etc, and I select some of them after I close this dialog and open it again all checkboxes are unchecked. What is the best way to store the state of this dialog box?
If you want to keep the state while the app is running - simply keep the dialog around and show/hide it as necessary.
If you need to keep state for next time the app is run then you need to store the individual settings separately (see QSettings) - this makes sense if say an update of your app add new settings.

Show alert if moving on without saving in Flex?

Functionnaly :
On one of my components of my application, I have an editing/lock system. When a user starts editing, he locks the file so other users cannot edit it.
Problem scenario : When the user activates "edition mode" and leaves screen, I would like to show a alert with two options : save changes, or discard changes.
There are different ways to exit screen :
There is a List on the left side containing other possible editabel data. A click changes the data in my component.
There is a menubar on top leading to other screens.
The edition component is embedded in a Tab navigator. When changing tabs, the alert has to show.
Closing browser.
Do I have to catch all of these events and plug at all those places?
Is there any kind of focusout mecanism?
The answer to the first question is: YES.
You need to watch all possible exit events that could harm the currently edited data.
Well, the problem is now how to manage this properly. Using an MVC framework you would trigger the appropriate commands from your components:
CHANGE_LIST_ITEM (new item)
CHANGE_TAB (new tab)
CHANGE_SCREEN (new screen)
Each command then checks if the currently edited tab has been saved or not. If not, it displays the Alert. Else, if there are no changes, it allows the list, the screen chooser and the tab bar to continue.
So your components (list, screens, tabs) need to implement some kind of rollback or preventDefault mechanism. Generally, changing their state must be allowed by a central validator (in MVC the command).
In the case of the list: I would suggest that the list is not selectable by mouse click but only programmatically. You set a listener on the list item click event. If the command allows setting of a new item it will notify the list. In MVC usually by sending an async message that gets received by the list's mediator. [[And even more correct: The command would set some model properties (e.g. currentListItem) and the model than sends an async message.]]
Edit: For the browser close event, you need to call a JavaScript expert.

Resources