How align center in FlowLayout?

Aimon Z.

how to set the center alignment of FlowLayout

i tried:

myLayout = new FlowLayout;
myLayout->setAlignment(Qt::AlignHCenter);

but it did not help

I want the child widgets to be in the center and not snuggle to the left

Hoang Minh

If you look into implementation of FlowLayout::doLayout() you will find that nothing dealing with layout's alignment, that is why your approach not works at all. You may directly edit FlowLayout::doLayout() and adding if-else case for FlowLayout::alignment() to make it fit your requirement. Notice that you must also change geometry of previously added item when adding new item, so it will be quite more complicated than the default implementation.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related