Accessing Image inside a Tab



  • I have a TabView in which Tab elements are added dynamically with a child Scrollview and Image, to make the image scrollable.

    I use the addTab(title, component) method of TabView to add this Component:
    @
    Component {
    id: itemTab

    ScrollView {
        anchors.fill: parent
    
        Image {
            fillMode: Image.PreserveAspectFit
            width: tabView.width
            height: tabView.height
        }
    }
    

    }
    @
    Now, as my image source has to be dynamic, how can I access the Image element to set its source from the addTab() method?



  • well, I solved the issue by setting an alias property for image in ScrollView and accessing the ScrollView using the item property of Tab.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.