Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
devwiki:python_qt [2023/12/12 06:39] – [Visibility and Style] ying | devwiki:python_qt [2024/01/10 03:08] (current) – [Layout and Container] ying | ||
---|---|---|---|
Line 1161: | Line 1161: | ||
my_layout.setAlignment(QtCore.Qt.AlignTop) | my_layout.setAlignment(QtCore.Qt.AlignTop) | ||
</ | </ | ||
- | * QGridLayout <code python> | + | * QGridLayout <code python> |
+ | |||
+ | # -- make grid equal size for all cells | ||
+ | cur_layout = ui[' | ||
+ | # for i in range( cur_layout.rowCount() ): | ||
+ | # cur_layout.setRowStretch( i, 1) | ||
+ | for j in range( cur_layout.columnCount() ): | ||
+ | cur_layout.setColumnStretch( j, 1 ) | ||
+ | |||
+ | </ | ||
* QFormLayout | * QFormLayout | ||
* QSplitter <code python> | * QSplitter <code python> | ||
Line 1174: | 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 ===== | ||
Line 1201: | Line 1229: | ||
self.uiList[' | self.uiList[' | ||
self.uiList[' | self.uiList[' | ||
+ | </ | ||
+ | * QLineEdit password hide <code python> | ||
+ | self.uiList[' | ||
</ | </ | ||
* QTextEdit make it accept plain text only <code python> | * QTextEdit make it accept plain text only <code python> |