Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

confused about the layout when comboBox added



  • I put several comboBox in a widget, and when I click on the comboBox, it pops up the menu, and at the same time, the whole widget size changed, what should I do to prevent the widget size change. I tried to use grid layout or horizental layout and put spacer around the comboBox, but it still changes size when comboBox pop up menu



  • @mrjj thanks, I know why this happens, I overload the mouseMoveEvent function, when click on the comboBox, although we didnot see the mouse move, but the mouseMoveEvent is triggered


  • Lifetime Qt Champion

    Hi
    That normally do not happen.
    Do you use plain comboBoxs ?
    alt text

    alt text



  • @mrjj thanks, I know why this happens, I overload the mouseMoveEvent function, when click on the comboBox, although we didnot see the mouse move, but the mouseMoveEvent is triggered


Log in to reply