ScrollView clips all its contents to its size. Is it possible to make it work only for top and bottom but allow children to go out of parent's frame on the right and on the left?
How to make ScrollView clip only vertically?
3.1k views Asked by Rinat Veliakhmedov At
2
There are 2 answers
0
Paul-Sebastian Manole
On
If what you want is to only scroll in one direction, then just set the width/height of the content item to the width/height of the ScrollView, using property bindings (because items inside ScrollView are reparented to ScrollView.contentItem). The below example will scroll only vertically. I've tested it, if you need confirmation that it actually works.
Item {
ScrollView {
id: scrollview1
anchors.fill: parent
anchors.margins: 20
clip: true
ColumnLayout {
width: scrollview1.width
}
}
}
Related Questions in QT
- qt c++ fonction converting adress to coordinates (longitude, latitude)
- Qml table and chart using python
- Qt: running callback in the main thread from the worker thread
- i have installed qt version 6.0.3 and this error QMYSQL driver not loaded displaying again and again
- Frameless Qt + WinAPI maximized window size is bigger than the availableGeometry()
- new window with c++ qt
- How to get scaling from transformation matrix
- How to build just Qt core libraries from Qt sources
- doxyqml not documenting qml files properly
- Incorrect assignment from a QStringList to a char * array
- How to make QT Chart size larger than widget size?
- Queued async operations with QtConcurrent interfere QImage from freed
- Questions about qt5 dynamic link library
- how to document QML files inside C++ project?
- How do I keep my screen contents centered and also have a scrollbar in QT?
Related Questions in QML
- Qml table and chart using python
- doxyqml not documenting qml files properly
- how to document QML files inside C++ project?
- Combining Dependent DLL Files with Executable using windeployqt
- How to resolve this loop call caused by property changed in qml, can I stop binding somewhere?
- Object.keys, Object.values and JSON.stringify give empty results in QML
- Qt Quick QML Unit Test linkage module not found/custom component 'not a type' error with createTemporaryQmlObject
- QML WebEngineView doesn't play YouTube video if the video hasn't 480p quality
- SplitView elements both in horizontally and vertically in qml
- Run QML in Beaglebone Black
- Splitview inside a Layout in QML is not working properly
- Qt and Unity Texture Sharing
- Why are my Buttons overlapping in QML ColumnLayout?
- SplitView in Rows in QML
- Color change in Line series chartview in qml
Related Questions in SCROLLVIEW
- ScrollView with multiple LazyVGrids jumping around when using .scrollPosition
- Why does my ViewPager not show anything when i add a scrollview?
- How to know when the user stop interacting with a SwiftUI Scrollview
- Add block vigets one button
- Weird animation bug inside scrollview with lazyhstack
- Use SwiftUI to turn the text overlapping the rectangle in ScrollView white
- Lag on LazyVStack
- SwiftUI: Chat like scrolling and keyboard behaviour
- Content inside ScrollView React Native can't be scrolled
- How to extend color beyond the top edge in SwiftUI
- How to detect user scrolll on the scrollview
- QML ScrollView does not remove default ScrollBar when using custom ScrollBar. Why? How to solve this?
- Interpolation from reanimated doesn't work on scroll indicator from inside flatlist
- Enable FlatList bouncing iOS behavior for Android
- How to update an item inside if a TabView with .tabViewStyle(.page) in ios lower than 17?
Related Questions in CLIPPING
- AI tools for generating clean clipping paths
- Use text as a clipping mask over an image during hover
- Random spawning (non-rigidbody) object clipping with ragdoll
- Simulating older 3D games per-polygon clipping in Unity?
- OpenGl clipping with potentially infinite hierarchy
- why does clipPath/mask become invisbile when clipped?
- How would I clip numbers in a list based on upper and lower limits?
- Why am I creating an extra row and column when I use rasterio.mask to clip a raster image?
- Problem with clipping northern Canada polygons in R- geometry may not contain other geometry
- Application dialog appears clipped
- Printing metafile that includes clipping to PDF comes out blank
- How to achieve similar 2D "overflow-hidden" effect in 3D react-three-fiber?
- Convert depth index of Data3Texture to z-coordinate of NDC
- Restoring Clipped Sinusoidal Data
- How can I expand a clipping path to contain variable content?
Related Questions in QT5.5
- Unable to update open source qt version from 5.13.1 to 6.5.2 on windows 10 for visual studio 2019?
- How to add a menu bar and a push button in the same UI using Qt?
- Qt Quick 3D custom geometry in Qt5/Qt6
- Adding new places to the QML map is not working
- QML module was not found
- Is it possible to add a QML item to the window created in mainwindow.ui form?
- Changing the central widget to vertical layout
- Project ERROR: Unknown module(s) in QT: x11extras
- 'https' link is not loading in qwebview in qt creator
- QApplication and SIGTERM
- How to open other tab of same window using a pushbutton on qt?
- TestCase mouseDrag only clicks item inside Flickable but does not drag
- Grandchild breaks repeater
- Qt has removed version 5.5?
- QML ListView anchor, margin = 0 goes outside parent fill?
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
I can only imagine one reason, why you don't set the
ScrollView's width to a higher value (thecontentItem's width).To be able to do so, while not constraining the
ScrollViewin it's width, you can use a simple trick:You'll wrap it in the
Item, anchor to this, and you'll be good. Alternatively you could use masks, but this would be... more complicated.Per se it is not possible to clip only horizontal or vertical, as the clipping is done using the
Item's bounding box.