Set two control in same column in Gridlayout



  • Hi,
    How to set the two widget in same column in gridlayout.


  • Lifetime Qt Champion

    Hi,

    What do you mean by same column ? Two widget at the same place or two widget in the same column on different rows ?



  • You can nest layouts, so you can put a RowLayout as an item inside a GridLayout. The other solution is to use columnSpan>1 on the other rows in the layout.



  • Hi
    let me explain the problem

    My requirement is i need to place two widgets on the same position for that i made use of grid layout.one widget has a transparent portion and the second one need to be placed exactly at the transparent area here the widget is list(need to be placed at transparent area).the placement is fine but the selection of index starting from above the list.

    thanks in advance



  • I think it might be easier to follow if you show a code example of what you have tried to do and explain what is wrong with that or show a crude drawing of what you are trying to achieve.

    I don't really get from the description that anything is wrong with your grid layout at all. Wrapping an item inside another is simply done by parenting and anchors on the same item.



  • Hi,
    For your reference i pasted a image file.In that image file the white area is a transparent place.so i want to fit the listview in that transparent area.so i used gridlayout to insert the widget like

    grid->addwidget(list,0,0,...)
    grid->addwidget(image,0,0,..)
    ...
    ....

    But i face the index problem in listview.if i click the outside of listview also the list selected.

    Thanks


Log in to reply
 

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