I have an XY Graph in Labview. I have no problems with its basic functionality.
I'd like to have a marker on the plot (independent on the cursor) which would stay in a certain position that I could read out and display in the GUI. Also I want the user to be able to move the marker to a new position.
How can I implement this functionality?
I know the title isn't very well-chosen, so I'll be grateful for any edits.
Edited:
You can just add cursor.
Add a cursor, select the point style you like and click on Allow dragging as shown on the picture below.
You can modify or read the current position of the point using Cursor Position property of the XY Graph.
They’re called “annotations”; you can add an array of them via a property node.
Related
I have added some drawing tools to my Mapbox map using the following code provided on the Mapbox website... https://docs.mapbox.com/mapbox-gl-js/example/mapbox-gl-draw/
I removed anything to do with the area measurement calculation as I only wanted to be able to draw on the map.
However, the map is set to default draw without having to click the drawing icon. This means when the page opens rather than being able to pan around the map the cursor is a crosshair and begins drawing.
I noted the following section in the script but not sure what to put in place of "draw_polygon" to stop it from being the default.
// Set mapbox-gl-draw to draw by default.
// The user does not have to click the polygon control button first.
defaultMode: 'draw_polygon'
});
Anyone have any ideas how to stop draw polygon from being the default?
Also any other ideas on other/better drawing tools?
The default mode is simple_select, so you can either add this in place of draw_polygon, or just remove the defaultMode option altogether and it will start in simple_select mode.
I have a custom QTabWidget with a custom QTabBar. I need to determine if a point is in the area next to the QTabBar. (see image)
I have a function that accepts a point representing a mouse cursor position. Using the mapFromGlobal() function and the QTabBar.rect().contains() function I can easily determine if the point is inside the QTabBar or not. I then thought it would be easy to determine if the point was inside the tab content or not in a similar way. However, the "page" is larger than the content widget. So by eliminating the QTabBar and the tab content, I can only determine if the point is inside the area shown below:
How can I determine if the point is next to the QTabBar as shown in the first image? Is there a way that I can access the underlying "page" that contains the tab content?
Right after posting I realized that there was a very simple solution.
After mapping the mouse cursor point from global, determine if the QPoint.y() value is less than QTabBar.height().
Is it possible show a tree view in a tooltip in Qt? Or represent a tree view with a QString and then show it in a tooltip?
doc states:
The tip is a short piece of text reminding the user of the widget's function. It is drawn immediately below the given position in a distinctive black-on-yellow color combination. The tip can be any rich text formatted string.
Rich text displayed in a tool tip is implicitly word-wrapped unless specified differently with <p style='white-space:pre'>.
Then I would suggest the simplest way could be to use a nested HTML list, something like <ul><li>...<ul><li>...</ul>...</ul> that could be easy to get from your structure
I think you need create treeview dynamically and show it when user stop moving mouse.
Create widget containing QTreeView and name like ToolTipTree
Make TooltipTree to follow mouse
When user stop moving mouse, set ToolTipTree shown. I user move mouse again, hide ToolTipTree
I'm working on a PyQt project. I have a map with points on it (The map is a QGraphicsScene and my points are QGraphicsEllipseItem).
I would like to display some informations on the points when they receive a hover event.
The information will be: a picture, some text and a treeview fill with data.
I don't want to open a new window, I want it to float over the map exactly how a tooltip will do.
I don't know how to do it, I can't find any widget who fill my needs.
Thank you for any help !
Create a new widget/window with windowflag Qt::ToolTip. According to the docs Qt's tooltips are nothing else. http://doc.qt.io/qt-5/qt.html#WindowType-enum
I have been searching regards this question for months.
By default, the iconFunction of List and Tree return only Class as the icon, which is for embeded images or iconUtility kindly provided by this site http://blog.benstucki.net/?p=42. It works very well with pre-created images.
But what I really want is to accept a completely runtime generate sprite object, similar to what is done by Legend, with the color changes according to what the current status. I assume I could do something to make the ListBase to accept icon argument other than Class. Am I rite? or please kindly advise what I shall do.
Thank you very much!
Wildog
Instead of setting the icon for the tree item, I would create a custom item renderer using TreeItemRenderer as a starting point. Then put whatever component you want to the left of the text and move the text to the right a bit. Another advantage of this approach is that you can have your sprite change dynamically as the data that gets set to the item renderer changes. Hope that helps.
I'm not sure if this is exactly what you want to do, but you can turn your sprite into BitmapData easily enough (Which you can use to create a BitmapAsset)
e.g.
var bmp:BitmapData = new BitmapData(sprite.width, sprite.height);
bmp.draw(sprite);
var bmpasset:BitmapAsset = new BitmapAsset(bmp);