Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- tensorflow
- python
- 유니티
- port
- IOS
- pandas
- 다이어트
- node.js
- flutter
- 라즈베리파이
- Excel
- 맛집
- MS-SQL
- urllib
- GIT
- Linux
- javascript
- 함수
- MySQL
- Unity
- 리눅스
- PyQt5
- ubuntu
- swift
- 날짜
- PyQt
- mssql
- sqlite
- ASP
- PER
Archives
아미(아름다운미소)
PyQt5 : QHeaderView의 헤더를 클릭하면 QTableView를 정렬하는 방법 본문
QHeaderView의 헤더를 클릭하면 QTableView를 정렬하는 방법입니다.
다음 과 같은 함수를 DataFrame사용하면 올바르게 정렬됩니다.def sort(self, Ncol, order):
"""Sort table by given column number."""
self.layoutAboutToBeChanged.emit()
self.data = self.data.sort_values(self.headers[Ncol],
ascending=order == Qt.AscendingOrder)
self.layoutChanged.emit()
'랭귀지 > python' 카테고리의 다른 글
| Python PyQt5 submenu (0) | 2018.12.11 |
|---|---|
| python CSV 파일 쓰기 (0) | 2018.12.09 |
| python 서버 시간 확인 (0) | 2018.12.05 |
| python PyQt5 현재시간 출력 (0) | 2018.12.04 |
| 이클립스 실행 오류, 로딩 화면이 깜빡하고 사라지면서 실행이 안되는 현상 (0) | 2018.12.03 |
Comments