Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
devwiki:python_qt [2024/01/06 20:35] – [Text Widget] ying | devwiki:python_qt [2024/01/10 03:08] (current) – [Layout and Container] ying | ||
---|---|---|---|
Line 1183: | Line 1183: | ||
* customize look <code python> | * customize look <code python> | ||
my_tab.setStyleSheet(" | my_tab.setStyleSheet(" | ||
+ | </ | ||
+ | * QScrollArea | ||
+ | * put widget into a scroll area <code python> | ||
+ | # main_layout is top most layout | ||
+ | main_scroll = QtWidgets.QScrollArea() | ||
+ | main_scroll.setWidgetResizable(1) | ||
+ | |||
+ | content_widget = QtWidgets.QWidget() | ||
+ | content_layout = QtWidgets.QVBoxLayout(content_widget) | ||
+ | |||
+ | main_scroll.setWidget(content_widget) | ||
+ | |||
+ | test_label = QtWidgets.QLabel(' | ||
+ | test_label.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse) | ||
+ | content_layout.addWidget(tmpLabel) | ||
+ | |||
+ | main_layout.addWidget(main_scroll) | ||
+ | # optional | ||
+ | main_layout.setStyleSheet(" | ||
</ | </ | ||
===== QWidget Property ===== | ===== QWidget Property ===== |