highlight item in spark list - apache-flex

I have two spark lists and want to drag items from one list to the other. When im dragging an item and over the other list item, i want the target item to change the background coloer.
Basically instead of showing the black line indicating that I will drop between elements, I want to see the target item highlight.
Thanks in advance.
Edit: Something that would look similar to this drag and drop:
(source: blogspot.com)

I would ask you to point out a UI precedent where this is standard / expected behavior.
When you drag an itemA onto itemB; and itemB is highlighted somehow, it usually means you're dragging into ItemB. But, in this case you are not dragging item from List1 into the item from List2. [I assume at least].
You'd have to override the list code drag and drop features to make this happen.

Related

How to easily recognize searched item in a dense QGraphicsScene?

I have a QGraphicsScene with many QGraphicsItem like circle, rectangle, polylines, arc etc.
Every QGraphicsItem has a name. And I have a Search feature which highlights searched items using that name. When scene contains fewer items, highlighted items are seen properly. But when scene contains many items ( 100 + ) then identifying the highlighted item becomes difficult. For that I need to scroll up - down or left - right to check where is that highlighted item is.
So I want my highlighted item to be easily recognizable.
For that I was suggested, some approach like
Take searched item in front
Or
Add some marker
But I do not know, how to implement it , which Qt class should I use etc.
QGraphicsScene displays items depending on their stacking, i.e., when you call .items(), the first item in the QList is the topmost item on the scene.
The ordering of the items is depending on their respective Z-values which you can set for the QGraphicsItem by calling .setZValue()
You can read more about this on the following link: https://doc.qt.io/qt-5/qgraphicsitem.html#sorting
As for your question on how to put them in front. If you implemented your own children classes of QGraphicsItem, you can add a method or a slot to toggle them "on-top". E.g., all of the items usually have a Z-order of 0, so your method could just set it to 1 when the item is highlighted and revert it to 0 when it's not.

QML: GridView/SwipeView with drag and drop

I have a list of lets say 20 buttons (this number can change dynamically) in a listView which I want to display using a grid on a swipeView or gridView. Only 6 buttons should be visible at once. In addition, it should be possible to exchange the position of buttons via drag and drop (see http://doc.qt.io/qt-5/qtquick-draganddrop-example.html). In case gridView is the way to go, is it possible to have it behave like swipeView, so that the buttons can not be moved to an arbitrary position but lock onto their column?
You might want to give snapMode a try.
You have the choice of:
GridView.NoSnap (default) - the view stops anywhere within the visible area.
GridView.SnapToRow - the view settles with a row (or column for GridView.FlowTopToBottom flow) aligned with the start of the view.
GridView.SnapOneRow - the view will settle no more than one row (or column for GridView.FlowTopToBottom flow) away from the first visible row at the time the mouse button is released. This mode is particularly useful for moving one page at a time.
You need to make sure, that the size of the GridView really fits your desired amount of delegates, for it will only make sure, that the first element is aligned, not that there is no element paritally protruding the view.

Setting the hovered-over (not selected) list item in Flash Builder

I have three lists stuck together horizontally in Flex that I would like to act like columns of the same list. I've put a method on change to make the same index on all three lists in sync with each other when an item is selected in any list. I want to do the same for hover; that is, when you hover over an item and the light blue background appears, and I want the same index on the other two lists to also show that light blue background.
Is there a way to get and set the "hovered-over item" in a list, or create a visually analogous effect?

QListView drop indicator styling

I am using QListView to show a list of items that I can drag and drop to change their order.
The problem is that:
the drop indicator is just a very small line (1px thickness)
the drop area is so narrow so one needs to be really accurate to drop an item correctly between two other items.
I wonder if it is possible to change the styling of the drop indicator of QListView so the line is thicker and the drop area is wider.
Style of drop indicator can be changed using QStyle. QStyle::PE_IndicatorItemViewItemDrop enum value corresponds for it and can be used for setting style for indicator that is drawn to show where an item in an item view is about to be dropped during a drag-and-drop operation in an item view

Flex: change item Style on certain Tree based ItemRenderers

I have a question concerning Tree items. I want to show where a drop action would be placed... The item will be placed in between two existing elements. So what I want to do is, to take the upper item and draw a line underneath it. But I struggling to address the itemRenderer...
I have the index for the itemrenderer, but I dont get a instance of that object.
Any help is appreciated!
Markus
If you're doing drag & drop right, it should be showing a line where you are going to drop the dragItem. That is standard behavior. You shouldn't have to do that in the itemRenderer.

Resources