qscrollarea

PyQt: wrap-around layout of widgets inside a QScrollArea

我怕爱的太早我们不能终老 提交于 2019-11-28 00:32:10
I am developing an app for memorizing text using PyQt4. I want to show all the words in bubbles so that you see how long the word is. But when I have all the bubbles in my QScrollArea , they are aligned one under the other. I would like to have them aligned side-by-side, but with word-wrap. I got the bubbles to work using a QLabel with rounded borders. But now that I have the words in QLabel's , PyQt doesn't consider them as words - but as widgets. So PyQt puts one widget under the other. I would like the widgets to be aligned side-by-side until they reach the end of the line, and then they

How do i resize the contents of a QScrollArea as more widgets are placed inside

雨燕双飞 提交于 2019-11-27 14:30:37
问题 I have a QScrollArea Widget, which starts empty; It has a vertical layout, with a QGridLayout, and a vertical spacer to keep it at the top, and prevent it from stretching over the whole scroll area; Elsewhere in the program, there is a QTextEdit, which when changed, has its contents scanned for "species" elements, and then they are added to the QGridLayout. Any species elements which have been removed are removed too. This bit works; I have turned the vertical scrollbar on all the time, so

QScrollArea with dynamically changing contents

泄露秘密 提交于 2019-11-27 09:09:27
I have a QScrollArea with some buttons in it, like shown on the picture. The idea of the layout is: 1. The left and right button should be used for scrolling the buttons when they are too wide 2.The numbers of buttons in the scroll area can be changed dynamically 3. Any free space should be used to expand the scroll area as much as possible. If no such space exist navigation buttons should be used for scrolling. With my current implementation when i increase the buttons i have this: But there is free space on the right, so this should look like: If i increase once more to 10 for example, then

QScrollArea with dynamically changing contents

跟風遠走 提交于 2019-11-26 17:48:30
问题 I have a QScrollArea with some buttons in it, like shown on the picture. The idea of the layout is: 1. The left and right button should be used for scrolling the buttons when they are too wide 2.The numbers of buttons in the scroll area can be changed dynamically 3. Any free space should be used to expand the scroll area as much as possible. If no such space exist navigation buttons should be used for scrolling. With my current implementation when i increase the buttons i have this: But there

PyQt: wrap-around layout of widgets inside a QScrollArea

我只是一个虾纸丫 提交于 2019-11-26 14:42:16
问题 I am developing an app for memorizing text using PyQt4. I want to show all the words in bubbles so that you see how long the word is. But when I have all the bubbles in my QScrollArea , they are aligned one under the other. I would like to have them aligned side-by-side, but with word-wrap. I got the bubbles to work using a QLabel with rounded borders. But now that I have the words in QLabel's , PyQt doesn't consider them as words - but as widgets. So PyQt puts one widget under the other. I