I am using a horizontal tilelist in flex to display an image gallery with only one item in horiz. tilelist being shown at a time. I have next and previous buttons on both sides.
The problem is I want to display a particular item/image in that list when user clicks on a thumb image from another thumbimages tilelist at bottom.
I used someTilelist.selectedIndex property but it just selects that particular index in list, it does not show that particular item/image. I want the list to show that particular image, not just select it. Please take note that the horiz. tilelist shows only one image at time.
tilelist.scrollToIndex(index);
Related
I have a list of 6 Services and I want to wrap each service list in Accordion. Whenever the user clicks the "+" button for the specific service I want that list to be displayed with slides down with a growing margin-bottom, depending on the number of items in the respective list without overlapping the below element. The problem is now it overlaps the below elements. Kindly check my code in code sandbox.
codesandbox link
I have dynamic list with 20~ cells.
I have 3 types of cells so i can't use Listview.
I am using ScrollView that contains StackLayout with the cell elements.
each cell element is also a StackLayout that contains some labels and buttons
the scrolling is smooth.
I have option in each cell to add image by a pressing a button inside the cell.
After the image is added, the scroll is getting very slow when arriving to the cell with the image.
when scrolling beyond the image, the scroll become smooth again
I have also tried TableView but the scrolling is not smooth when presenting the Cells (without adding the image)
How can i improve the rendering of the image ?
I have 3 types of cells so i can't use Listview.
Actually you can use a ListView, by using a DataTemplateSelector. As long as you have a collection containing all of the objects to be displayed, and each object in the collection indicates the cell type (usually because of it model's type), ListView with DataTemplateSelector will work great.
Whether you stick with ScrollView or move to ListView, look into FFImageLoading for displaying images if possible. While it doesn't solve all image display problems, it often does help with responsiveness and image size issues.
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.
I'm using QListWidget with setItemWidget and when adding items to the list and scrolling down to the bottom I get this result:
So there's an area which is completely blank at the bottom (not selectable, in the image above the last item in the list has been selected)
How can I get rid of this blank area at the bottom of the list?
Please note that the height of the rows can be different within a list
Grateful for help and with kind regards,
Tord
It's possible to change the type of vertical scrolling that is done for list by using setVerticalScrollMode for the QListWidget so that the scrolling is done per pixel (instead of per item which is the default):
self.list_widget.setVerticalScrollMode(QtWidgets.QAbstractItemView.ScrollPerPixel)
The result is that rows that are in the top-most part of the QListWidget box can be drawn only in part, which in turn means that the blank area that exists when scrolling per item will disappear:
Reference documentation:
https://doc.qt.io/qt-5/qabstractitemview.html#verticalScrollMode-prop
I'm using exactly the same approach and I get rid of the blank area by creating a widget that contains my QListWidget and use :
listwidget.setFixedSize(widget.width(), listwidget.sizeHintForRow(0) * listwidget.count() + 2 * listwidget.frameWidth())
listwidget is you QListWidget object
widget is the widget that contains your QListWidget object
I have a list where every element has a share button, when I press on the
share button a box/bubble opens up with the social mdia buttons.
when the share box opens it should go over the list items (even if it covers the next elements on the list), how can I achieve that?
current state
The box shouldn't push the height of the item list it should be on top of everything