Adding scroll signal to listwidget's scrollbar in PYQT5
().(lambda :print(1))
This method is also used for other controls with scrollbars
Supplementary: Setting the QtreeWidget Horizontal Scrollbar in PyQt5
This problem, confused me for some time, the Internet to find a lot of information, all kinds of attempts have not been resolved, vaguely in a forum in an author mentioned a sentence, only to be resolved.
The problem is described below:
During the development process, sometimes we will go to develop the interface of tree display, especially when the file management system. Because pyqt5 python alone documentation is relatively small, mostly based on C + + + written documents, so everyone in the development of the time, basically experience plus feel the way across the river in python to develop Qt interface.
In the interface above, there are obviously too many nodes, but a horizontal scrollbar should reasonably appear, but it doesn't.
prescription
The correct interface should be as above, and it's really a matter of a piece of code to solve.
self._tree.setColumnCount(1) self._tree.setHeaderLabels(['Remote Projects']) self._tree.header().setMinimumSectionSize(500) #Actually, it's this one sentence,To add,Try to set the size of this column as large as possible,That's it.
The above is a personal experience, I hope it can give you a reference, and I hope you can support me more. If there is any mistake or something that has not been fully considered, please do not hesitate to advise me.