更新目录结构
This commit is contained in:
parent
19478c38f3
commit
02bcf2b365
9 changed files with 34 additions and 29 deletions
2
.settings/.gitignore
vendored
2
.settings/.gitignore
vendored
|
@ -1 +1 @@
|
||||||
org.eclipse.core.resources.prefs
|
*.prefs
|
||||||
|
|
|
@ -61,8 +61,8 @@ encoding//\u56FE\u8868/PyQtChart\u7EC3\u4E60/test/ToolTip2.py=utf-8
|
||||||
encoding//\u591A\u7EBF\u7A0B/moveToThread.py=utf-8
|
encoding//\u591A\u7EBF\u7A0B/moveToThread.py=utf-8
|
||||||
encoding//\u591A\u7EBF\u7A0B/\u7EE7\u627FQThread.py=utf-8
|
encoding//\u591A\u7EBF\u7A0B/\u7EE7\u627FQThread.py=utf-8
|
||||||
encoding//\u591A\u9875\u9762/QScrollArea/\u4EFFQQ\u8BBE\u7F6E\u9762\u677F/SettingUi.py=utf-8
|
encoding//\u591A\u9875\u9762/QScrollArea/\u4EFFQQ\u8BBE\u7F6E\u9762\u677F/SettingUi.py=utf-8
|
||||||
encoding//\u591A\u9875\u9762/QScrollArea/\u4EFFQQ\u8BBE\u7F6E\u9762\u677F/Window.py=utf-8
|
encoding//\u591A\u9875\u9762/QScrollArea/\u4EFFQQ\u8BBE\u7F6E\u9762\u677F/\u4EFFQQ\u8BBE\u7F6E\u9762\u677F.py=utf-8
|
||||||
encoding//\u591A\u9875\u9762/QStackedWidget/\u5DE6\u4FA7\u9009\u9879\u5361/LeftTabWidget.py=utf-8
|
encoding//\u591A\u9875\u9762/QStackedWidget/\u5DE6\u4FA7\u9009\u9879\u5361/\u5DE6\u4FA7\u9009\u9879\u5361.py=utf-8
|
||||||
encoding//\u6811\u7ED3\u6784/QTreeWidget/Json\u751F\u6210QTreeWidget/Json\u751F\u6210\u6811\u5F62\u7ED3\u6784.py=utf-8
|
encoding//\u6811\u7ED3\u6784/QTreeWidget/Json\u751F\u6210QTreeWidget/Json\u751F\u6210\u6811\u5F62\u7ED3\u6784.py=utf-8
|
||||||
encoding//\u6D4F\u89C8\u5668/QWebView/\u68A6\u5E7B\u6811/DreamTree.py=utf-8
|
encoding//\u6D4F\u89C8\u5668/QWebView/\u68A6\u5E7B\u6811/DreamTree.py=utf-8
|
||||||
encoding//\u754C\u9762\u7F8E\u5316/QFileSystemModel\u56FE\u6807/FileSystemModel.py=utf-8
|
encoding//\u754C\u9762\u7F8E\u5316/QFileSystemModel\u56FE\u6807/FileSystemModel.py=utf-8
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
# 仿QQ设置面板简单例子
|
|
||||||
|
|
||||||
左侧:
|
|
||||||
使用QListWidget点击左侧时得到索引,然后根据索引去找右侧的widget_0之类的
|
|
||||||
|
|
||||||
右侧:
|
|
||||||
使用QScrollArea控件,设置QVBoxLayout布局,然后一次添加Widget
|
|
||||||
|
|
||||||
事件:
|
|
||||||
- 1. 绑定左侧QListWidget的itemClicked的到该item的索引
|
|
||||||
- 2. 绑定右侧滚动条的valueChanged事件得到pos
|
|
||||||
|
|
||||||
注意:当itemClicked时定位滚动条的值时,需要设置一个标志位用来避免valueChanged重复调用item的定位
|
|
||||||
|
|
||||||
## 截图
|
|
||||||
![截图](ScreenShot/1.gif)
|
|
Before Width: | Height: | Size: 400 KiB After Width: | Height: | Size: 400 KiB |
|
@ -1,10 +0,0 @@
|
||||||
# 选项卡
|
|
||||||
|
|
||||||
### [Python3.4.4 or Python3.5][PyQt5]
|
|
||||||
|
|
||||||
### 1.方式一使用 (左边一个QListWidget + 右边QStackedWidget)
|
|
||||||
|
|
||||||
详细注释在代码中
|
|
||||||
|
|
||||||
# 截图
|
|
||||||
![截图](ScreenShot/1.gif)
|
|
Before Width: | Height: | Size: 201 KiB After Width: | Height: | Size: 201 KiB |
31
多页面/README.md
Normal file
31
多页面/README.md
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
# 多页面
|
||||||
|
|
||||||
|
## [1、QScrollArea](QScrollArea/)
|
||||||
|
|
||||||
|
[1、仿QQ设置面板](QScrollArea/仿QQ设置面板)
|
||||||
|
|
||||||
|
1. 左侧为`QListWidget`,右侧使用`QScrollArea`设置`QVBoxLayout`,然后依次往里面添加QWidget
|
||||||
|
2. 右侧添加`QWidget`的时候有两种方案
|
||||||
|
1. 左侧list根据序号来索引,右侧添加widget时给定带序号的变量名,如widget_0,widget_1,widget_2之类的,这样可以直接根据`QListWidget`的序号关联起来
|
||||||
|
2. 左侧list添加item时给定右侧对应的widget变量值
|
||||||
|
|
||||||
|
相关事件:
|
||||||
|
1. 绑定左侧`QListWidget`的`itemClicked`的到该item的索引
|
||||||
|
2. 绑定右侧滚动条的`valueChanged`事件得到pos
|
||||||
|
|
||||||
|
注意:当`itemClicked`时定位滚动条的值时,需要设置一个标志位用来避免`valueChanged`重复调用item的定位
|
||||||
|
|
||||||
|
![截图](QScrollArea/仿QQ设置面板/ScreenShot/仿QQ设置面板.gif)
|
||||||
|
|
||||||
|
## [2、QStackedWidget](QStackedWidget/)
|
||||||
|
|
||||||
|
[1、左侧选项卡](QStackedWidget/左侧选项卡)
|
||||||
|
|
||||||
|
本来使用QTabWidget可以实现多标签页面,但是当标签在左侧时会出现文字方向不对的问题,可以通过自定义`QTabBar`来解决,也可以采用QListWidget结合QStackedWidget的方式。
|
||||||
|
|
||||||
|
1. 左侧为`QListWidget`,右侧使用`QStackedWidget`,然后依次往里面添加QWidget
|
||||||
|
2. 右侧添加`QWidget`的时候有两种方案
|
||||||
|
1. 左侧list根据序号来索引,右侧添加widget时给定带序号的变量名,如widget_0,widget_1,widget_2之类的,这样可以直接根据`QListWidget`的序号关联起来
|
||||||
|
2. 左侧list添加item时给定右侧对应的widget变量值
|
||||||
|
|
||||||
|
![截图](QStackedWidget/左侧选项卡/ScreenShot/左侧选项卡.gif)
|
Loading…
Reference in a new issue