./PaxHeaders.2135/frozencolumn 0000644 0000000 0000000 00000000132 13073367110 013327 x ustar 00 30 mtime=1491988040.462253638
30 atime=1491988040.982259138
30 ctime=1491988040.462253638
frozencolumn/ 0000775 0001750 0004256 00000000000 13073367110 013227 5 ustar 00hp lisa 0000000 0000000 frozencolumn/PaxHeaders.2135/grades.qrc 0000644 0000000 0000000 00000000074 13037674712 015241 x ustar 00 30 atime=1491919673.847770551
30 ctime=1491919672.835759781
frozencolumn/grades.qrc 0000664 0001750 0004256 00000000132 13037674712 015210 0 ustar 00hp lisa 0000000 0000000
grades.txt
frozencolumn/PaxHeaders.2135/grades.txt 0000644 0000000 0000000 00000000074 13037674712 015273 x ustar 00 30 atime=1491919673.847770551
30 ctime=1491919672.843759865
frozencolumn/grades.txt 0000664 0001750 0004256 00000003355 13037674712 015254 0 ustar 00hp lisa 0000000 0000000 France , Norway , YDS , UK(tech.), UK(adj.) , UIAA , Ger , Australia , Finland , Brazil
1, , 5.2, , , I , I , , , Isup
2, , 5.3, , , II , II , 11, , II
3, 3, 5.4, , , III , III , 12, , IIsup
4, 4, 5.5, 4a , VD , IV , IV , 12, , III
5a , 5-, 5.6, , S , V- , V , 13, 5-, IIIsup
5b , 5, 5.7, 4b , HS , V , VI , 14, 5, IV
, , , 4c , , V+ , , 15, ,
5c , 5+, 5.8, , VS , VI- , VIIa , 16, 5, IVsup
6a , 6-, 5.9, 5a , HVS , VI , VIIb , 17, , V
6a+ , 6-/6 , 5.10a , , E1 , VI+ , VIIc , 18, 6-, VI
6b , , 5.10b , 5b , , , , 19, , VI/VI+
6b+ , 6, 5.10c , , E2 , VII- , VIIIa , 20, 6, VIsup/VI+
6c , 6+, 5.10d , 5c , , VII , VIIIb , 21, , VIsup
6c+ , 7-, 5.11a , , E3 , VII+ , VIIIc , 22, 6, 7a
6c+ , 7, 5.11b , , , , , 23, , 7b
7a , 7+, 5.11c , 6a , E4 , VIII- , IXa , 24, 7-, 7c
7a , 7+/8- , 5.11d , , , VIII , IXb , , , 7c
7a+ , 8-, 5.12a , , E5 , VIII+ , IXc , 25, 7, 8a
7b , 8, 5.12b , 6b , , , , 26, 8-, 8b
7b+ , 8/8+ , 5.12c , , E6 , IX- , Xa , 27, 8, 8c
7c , 8+, 5.12d , 6c , , IX , Xb , 28, 8, 9a
7c+ , 9-, 5.13a , , E7 , IX+ , Xc , 29, 9-, 9b
8a , , 5.13b , , , , , , 9, 9c
8a+ , 9-/9 , 5.13c , 7a , , X- , , 30, 9, 10a
8b , 9, 5.13d , , E8 , X , , 31, 10-, 10b
8b+ , 9/9+ , 5.14a , , , X+ , , 32, 10, 10c
8c , 9+, 5.14b , 7b , , , , 33, 10, 11a
8c+ , 10-, 5.14c , , E9 , XI- , , 34, 11-, 11b
9a , 10, 5.14d , 7c , , XI , , 35, 11, 11c
9a+ , , 5.15a , , , XI+ , , , , 12a
9b , , 5.15b , , , , , , , 12b
# Wikipedia contributors. Grade (climbing). Wikipedia, The Free Encyclopedia. May 15, 2009, 20:42 UTC.
# Available at: http://en.wikipedia.org/w/index.php?title=Grade_(climbing)&oldid=290165724. Accessed May 28, 2009.
frozencolumn/PaxHeaders.2135/grades_rc.py 0000644 0000000 0000000 00000000132 13073177203 015554 x ustar 00 30 mtime=1491926659.641437486
30 atime=1491945076.648685988
30 ctime=1491926659.641437486
frozencolumn/grades_rc.py 0000664 0001750 0004256 00000017634 13073177203 015547 0 ustar 00hp lisa 0000000 0000000 # -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.8.0)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x06\xed\
\x20\
\x46\x72\x61\x6e\x63\x65\x20\x2c\x20\x4e\x6f\x72\x77\x61\x79\x20\
\x2c\x20\x59\x44\x53\x20\x2c\x20\x55\x4b\x28\x74\x65\x63\x68\x2e\
\x29\x2c\x20\x55\x4b\x28\x61\x64\x6a\x2e\x29\x20\x2c\x20\x55\x49\
\x41\x41\x20\x2c\x20\x47\x65\x72\x20\x2c\x20\x41\x75\x73\x74\x72\
\x61\x6c\x69\x61\x20\x2c\x20\x46\x69\x6e\x6c\x61\x6e\x64\x20\x2c\
\x20\x42\x72\x61\x7a\x69\x6c\x0a\x0a\x31\x2c\x20\x20\x20\x2c\x20\
\x35\x2e\x32\x2c\x20\x20\x20\x2c\x20\x20\x20\x2c\x20\x49\x20\x2c\
\x20\x49\x20\x2c\x20\x20\x20\x2c\x20\x20\x20\x2c\x20\x49\x73\x75\
\x70\x0a\x32\x2c\x20\x20\x20\x2c\x20\x35\x2e\x33\x2c\x20\x20\x20\
\x2c\x20\x20\x20\x2c\x20\x49\x49\x20\x2c\x20\x49\x49\x20\x2c\x20\
\x31\x31\x2c\x20\x20\x20\x2c\x20\x49\x49\x0a\x33\x2c\x20\x33\x2c\
\x20\x35\x2e\x34\x2c\x20\x20\x20\x2c\x20\x20\x20\x2c\x20\x49\x49\
\x49\x20\x2c\x20\x49\x49\x49\x20\x2c\x20\x31\x32\x2c\x20\x20\x20\
\x2c\x20\x49\x49\x73\x75\x70\x0a\x34\x2c\x20\x34\x2c\x20\x35\x2e\
\x35\x2c\x20\x34\x61\x20\x2c\x20\x56\x44\x20\x2c\x20\x49\x56\x20\
\x2c\x20\x49\x56\x20\x2c\x20\x31\x32\x2c\x20\x20\x20\x2c\x20\x49\
\x49\x49\x0a\x35\x61\x20\x2c\x20\x35\x2d\x2c\x20\x35\x2e\x36\x2c\
\x20\x20\x20\x2c\x20\x53\x20\x2c\x20\x56\x2d\x20\x2c\x20\x56\x20\
\x2c\x20\x31\x33\x2c\x20\x35\x2d\x2c\x20\x49\x49\x49\x73\x75\x70\
\x0a\x35\x62\x20\x2c\x20\x35\x2c\x20\x35\x2e\x37\x2c\x20\x34\x62\
\x20\x2c\x20\x48\x53\x20\x2c\x20\x56\x20\x2c\x20\x56\x49\x20\x2c\
\x20\x31\x34\x2c\x20\x35\x2c\x20\x49\x56\x0a\x20\x20\x2c\x20\x20\
\x20\x2c\x20\x20\x20\x2c\x20\x34\x63\x20\x2c\x20\x20\x20\x2c\x20\
\x56\x2b\x20\x2c\x20\x20\x20\x2c\x20\x31\x35\x2c\x20\x20\x20\x2c\
\x20\x20\x0a\x35\x63\x20\x2c\x20\x35\x2b\x2c\x20\x35\x2e\x38\x2c\
\x20\x20\x20\x2c\x20\x56\x53\x20\x2c\x20\x56\x49\x2d\x20\x2c\x20\
\x56\x49\x49\x61\x20\x2c\x20\x31\x36\x2c\x20\x35\x2c\x20\x49\x56\
\x73\x75\x70\x0a\x36\x61\x20\x2c\x20\x36\x2d\x2c\x20\x35\x2e\x39\
\x2c\x20\x35\x61\x20\x2c\x20\x48\x56\x53\x20\x2c\x20\x56\x49\x20\
\x2c\x20\x56\x49\x49\x62\x20\x2c\x20\x31\x37\x2c\x20\x20\x20\x2c\
\x20\x56\x0a\x36\x61\x2b\x20\x2c\x20\x36\x2d\x2f\x36\x20\x2c\x20\
\x35\x2e\x31\x30\x61\x20\x2c\x20\x20\x20\x2c\x20\x45\x31\x20\x2c\
\x20\x56\x49\x2b\x20\x2c\x20\x56\x49\x49\x63\x20\x2c\x20\x31\x38\
\x2c\x20\x36\x2d\x2c\x20\x56\x49\x0a\x36\x62\x20\x2c\x20\x20\x20\
\x2c\x20\x35\x2e\x31\x30\x62\x20\x2c\x20\x35\x62\x20\x2c\x20\x20\
\x20\x2c\x20\x20\x20\x2c\x20\x20\x20\x2c\x20\x31\x39\x2c\x20\x20\
\x20\x2c\x20\x56\x49\x2f\x56\x49\x2b\x0a\x36\x62\x2b\x20\x2c\x20\
\x36\x2c\x20\x35\x2e\x31\x30\x63\x20\x2c\x20\x20\x20\x2c\x20\x45\
\x32\x20\x2c\x20\x56\x49\x49\x2d\x20\x2c\x20\x56\x49\x49\x49\x61\
\x20\x2c\x20\x32\x30\x2c\x20\x36\x2c\x20\x56\x49\x73\x75\x70\x2f\
\x56\x49\x2b\x0a\x36\x63\x20\x2c\x20\x36\x2b\x2c\x20\x35\x2e\x31\
\x30\x64\x20\x2c\x20\x35\x63\x20\x2c\x20\x20\x20\x2c\x20\x56\x49\
\x49\x20\x2c\x20\x56\x49\x49\x49\x62\x20\x2c\x20\x32\x31\x2c\x20\
\x20\x20\x2c\x20\x56\x49\x73\x75\x70\x0a\x36\x63\x2b\x20\x2c\x20\
\x37\x2d\x2c\x20\x35\x2e\x31\x31\x61\x20\x2c\x20\x20\x20\x2c\x20\
\x45\x33\x20\x2c\x20\x56\x49\x49\x2b\x20\x2c\x20\x56\x49\x49\x49\
\x63\x20\x2c\x20\x32\x32\x2c\x20\x36\x2c\x20\x37\x61\x0a\x36\x63\
\x2b\x20\x2c\x20\x37\x2c\x20\x35\x2e\x31\x31\x62\x20\x2c\x20\x20\
\x20\x2c\x20\x20\x20\x2c\x20\x20\x20\x2c\x20\x20\x20\x2c\x20\x32\
\x33\x2c\x20\x20\x20\x2c\x20\x37\x62\x0a\x37\x61\x20\x2c\x20\x37\
\x2b\x2c\x20\x35\x2e\x31\x31\x63\x20\x2c\x20\x36\x61\x20\x2c\x20\
\x45\x34\x20\x2c\x20\x56\x49\x49\x49\x2d\x20\x2c\x20\x49\x58\x61\
\x20\x2c\x20\x32\x34\x2c\x20\x37\x2d\x2c\x20\x37\x63\x0a\x37\x61\
\x20\x2c\x20\x37\x2b\x2f\x38\x2d\x20\x2c\x20\x35\x2e\x31\x31\x64\
\x20\x2c\x20\x20\x20\x2c\x20\x20\x20\x2c\x20\x56\x49\x49\x49\x20\
\x2c\x20\x49\x58\x62\x20\x2c\x20\x20\x20\x2c\x20\x2c\x20\x37\x63\
\x0a\x37\x61\x2b\x20\x2c\x20\x38\x2d\x2c\x20\x35\x2e\x31\x32\x61\
\x20\x2c\x20\x20\x20\x2c\x20\x45\x35\x20\x2c\x20\x56\x49\x49\x49\
\x2b\x20\x2c\x20\x49\x58\x63\x20\x2c\x20\x32\x35\x2c\x20\x37\x2c\
\x20\x38\x61\x0a\x37\x62\x20\x2c\x20\x38\x2c\x20\x35\x2e\x31\x32\
\x62\x20\x2c\x20\x36\x62\x20\x2c\x20\x20\x20\x2c\x20\x20\x20\x2c\
\x20\x20\x20\x2c\x20\x32\x36\x2c\x20\x38\x2d\x2c\x20\x38\x62\x0a\
\x37\x62\x2b\x20\x2c\x20\x38\x2f\x38\x2b\x20\x2c\x20\x35\x2e\x31\
\x32\x63\x20\x2c\x20\x20\x20\x2c\x20\x45\x36\x20\x2c\x20\x49\x58\
\x2d\x20\x2c\x20\x58\x61\x20\x2c\x20\x32\x37\x2c\x20\x38\x2c\x20\
\x38\x63\x0a\x37\x63\x20\x2c\x20\x38\x2b\x2c\x20\x35\x2e\x31\x32\
\x64\x20\x2c\x20\x36\x63\x20\x2c\x20\x20\x20\x2c\x20\x49\x58\x20\
\x2c\x20\x58\x62\x20\x2c\x20\x32\x38\x2c\x20\x38\x2c\x20\x39\x61\
\x0a\x37\x63\x2b\x20\x2c\x20\x39\x2d\x2c\x20\x35\x2e\x31\x33\x61\
\x20\x2c\x20\x20\x20\x2c\x20\x45\x37\x20\x2c\x20\x49\x58\x2b\x20\
\x2c\x20\x58\x63\x20\x2c\x20\x32\x39\x2c\x20\x39\x2d\x2c\x20\x39\
\x62\x0a\x38\x61\x20\x2c\x20\x20\x20\x2c\x20\x35\x2e\x31\x33\x62\
\x20\x2c\x20\x20\x20\x2c\x20\x20\x20\x2c\x20\x20\x20\x2c\x20\x20\
\x20\x2c\x20\x20\x20\x2c\x20\x39\x2c\x20\x39\x63\x0a\x38\x61\x2b\
\x20\x2c\x20\x39\x2d\x2f\x39\x20\x2c\x20\x35\x2e\x31\x33\x63\x20\
\x2c\x20\x37\x61\x20\x2c\x20\x20\x20\x2c\x20\x58\x2d\x20\x2c\x20\
\x20\x20\x2c\x20\x33\x30\x2c\x20\x39\x2c\x20\x31\x30\x61\x0a\x38\
\x62\x20\x2c\x20\x39\x2c\x20\x35\x2e\x31\x33\x64\x20\x2c\x20\x20\
\x20\x2c\x20\x45\x38\x20\x2c\x20\x58\x20\x2c\x20\x20\x20\x2c\x20\
\x33\x31\x2c\x20\x31\x30\x2d\x2c\x20\x31\x30\x62\x0a\x38\x62\x2b\
\x20\x2c\x20\x39\x2f\x39\x2b\x20\x2c\x20\x35\x2e\x31\x34\x61\x20\
\x2c\x20\x20\x20\x2c\x20\x20\x20\x2c\x20\x58\x2b\x20\x2c\x20\x20\
\x20\x2c\x20\x33\x32\x2c\x20\x31\x30\x2c\x20\x31\x30\x63\x0a\x38\
\x63\x20\x2c\x20\x39\x2b\x2c\x20\x35\x2e\x31\x34\x62\x20\x2c\x20\
\x37\x62\x20\x2c\x20\x20\x20\x2c\x20\x20\x20\x2c\x20\x20\x20\x2c\
\x20\x33\x33\x2c\x20\x31\x30\x2c\x20\x31\x31\x61\x0a\x38\x63\x2b\
\x20\x2c\x20\x31\x30\x2d\x2c\x20\x35\x2e\x31\x34\x63\x20\x2c\x20\
\x20\x20\x2c\x20\x45\x39\x20\x2c\x20\x58\x49\x2d\x20\x2c\x20\x20\
\x20\x2c\x20\x33\x34\x2c\x20\x31\x31\x2d\x2c\x20\x31\x31\x62\x0a\
\x39\x61\x20\x2c\x20\x31\x30\x2c\x20\x35\x2e\x31\x34\x64\x20\x2c\
\x20\x37\x63\x20\x2c\x20\x20\x20\x2c\x20\x58\x49\x20\x2c\x20\x20\
\x20\x2c\x20\x33\x35\x2c\x20\x31\x31\x2c\x20\x31\x31\x63\x0a\x39\
\x61\x2b\x20\x2c\x20\x20\x20\x2c\x20\x35\x2e\x31\x35\x61\x20\x2c\
\x20\x2c\x20\x20\x20\x2c\x20\x58\x49\x2b\x20\x2c\x20\x20\x20\x2c\
\x20\x20\x20\x2c\x20\x20\x20\x2c\x20\x31\x32\x61\x0a\x39\x62\x20\
\x2c\x20\x2c\x20\x35\x2e\x31\x35\x62\x20\x20\x2c\x20\x2c\x20\x20\
\x20\x2c\x20\x2c\x20\x2c\x20\x2c\x20\x2c\x20\x31\x32\x62\x0a\x0a\
\x23\x20\x57\x69\x6b\x69\x70\x65\x64\x69\x61\x20\x63\x6f\x6e\x74\
\x72\x69\x62\x75\x74\x6f\x72\x73\x2e\x20\x47\x72\x61\x64\x65\x20\
\x28\x63\x6c\x69\x6d\x62\x69\x6e\x67\x29\x2e\x20\x57\x69\x6b\x69\
\x70\x65\x64\x69\x61\x2c\x20\x54\x68\x65\x20\x46\x72\x65\x65\x20\
\x45\x6e\x63\x79\x63\x6c\x6f\x70\x65\x64\x69\x61\x2e\x20\x4d\x61\
\x79\x20\x31\x35\x2c\x20\x32\x30\x30\x39\x2c\x20\x32\x30\x3a\x34\
\x32\x20\x55\x54\x43\x2e\x20\x0a\x23\x20\x41\x76\x61\x69\x6c\x61\
\x62\x6c\x65\x20\x61\x74\x3a\x20\x68\x74\x74\x70\x3a\x2f\x2f\x65\
\x6e\x2e\x77\x69\x6b\x69\x70\x65\x64\x69\x61\x2e\x6f\x72\x67\x2f\
\x77\x2f\x69\x6e\x64\x65\x78\x2e\x70\x68\x70\x3f\x74\x69\x74\x6c\
\x65\x3d\x47\x72\x61\x64\x65\x5f\x28\x63\x6c\x69\x6d\x62\x69\x6e\
\x67\x29\x26\x6f\x6c\x64\x69\x64\x3d\x32\x39\x30\x31\x36\x35\x37\
\x32\x34\x2e\x20\x41\x63\x63\x65\x73\x73\x65\x64\x20\x4d\x61\x79\
\x20\x32\x38\x2c\x20\x32\x30\x30\x39\x2e\x20\x0a\
"
qt_resource_name = b"\
\x00\x0a\
\x0a\xcb\x8b\x14\
\x00\x67\
\x00\x72\x00\x61\x00\x64\x00\x65\x00\x73\x00\x2e\x00\x74\x00\x78\x00\x74\
"
qt_resource_struct = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
"
def qInitResources():
QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)
def qCleanupResources():
QtCore.qUnregisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)
qInitResources()
frozencolumn/PaxHeaders.2135/frozencolumn.py 0000644 0000000 0000000 00000000132 13073211400 016330 x ustar 00 30 mtime=1491931904.568857023
30 atime=1491945076.572685184
30 ctime=1491931904.572857066
frozencolumn/frozencolumn.py 0000664 0001750 0004256 00000015753 13073211400 016323 0 ustar 00hp lisa 0000000 0000000 #!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2017 Hans-Peter Jansen
## Copyright (C) 2016 The Qt Company Ltd.
##
## This file is part of the examples of the Qt Toolkit.
##
## $QT_BEGIN_LICENSE:BSD$
## Commercial License Usage
## Licensees holding valid commercial Qt licenses may use this file in
## accordance with the commercial license agreement provided with the
## Software or, alternatively, in accordance with the terms contained in
## a written agreement between you and The Qt Company. For licensing terms
## and conditions see https:#www.qt.io/terms-conditions. For further
## information use the contact form at https:#www.qt.io/contact-us.
##
## BSD License Usage
## Alternatively, you may use self file under the terms of the BSD license
## as follows:
##
## "Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions are
## met:
## * Redistributions of source code must retain the above copyright
## notice, self list of conditions and the following disclaimer.
## * Redistributions in binary form must reproduce the above copyright
## notice, self list of conditions and the following disclaimer in
## the documentation and/or other materials provided with the
## distribution.
## * Neither the name of The Qt Company Ltd nor the names of its
## contributors may be used to endorse or promote products derived
## from self software without specific prior written permission.
##
##
## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
##
## $QT_END_LICENSE$
##
#############################################################################
from PyQt5.QtGui import QStandardItem, QStandardItemModel
from PyQt5.QtCore import QFile, Qt
from PyQt5.QtWidgets import QApplication, QHeaderView, QTableView
# generate with: pyrcc5 grades.qrc -o grades_rc.py
import grades_rc # __IGNORE_WARNING__
class FreezeTableWidget(QTableView):
def __init__(self, model):
super(FreezeTableWidget, self).__init__()
self.setModel(model)
self.frozenTableView = QTableView(self)
self.init()
self.horizontalHeader().sectionResized.connect(self.updateSectionWidth)
self.verticalHeader().sectionResized.connect(self.updateSectionHeight)
self.frozenTableView.verticalScrollBar().valueChanged.connect(
self.verticalScrollBar().setValue)
self.verticalScrollBar().valueChanged.connect(
self.frozenTableView.verticalScrollBar().setValue)
def init(self):
self.frozenTableView.setModel(self.model())
self.frozenTableView.setFocusPolicy(Qt.NoFocus)
self.frozenTableView.verticalHeader().hide()
self.frozenTableView.horizontalHeader().setSectionResizeMode(
QHeaderView.Fixed)
self.viewport().stackUnder(self.frozenTableView)
self.frozenTableView.setStyleSheet("""
QTableView { border: none;
background-color: #8EDE21;
selection-background-color: #999;
}""") # for demo purposes
self.frozenTableView.setSelectionModel(self.selectionModel())
for col in range(1, self.model().columnCount()):
self.frozenTableView.setColumnHidden(col, True)
self.frozenTableView.setColumnWidth(0, self.columnWidth(0))
self.frozenTableView.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.frozenTableView.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.frozenTableView.show()
self.updateFrozenTableGeometry()
self.setHorizontalScrollMode(self.ScrollPerPixel)
self.setVerticalScrollMode(self.ScrollPerPixel)
self.frozenTableView.setVerticalScrollMode(self.ScrollPerPixel)
def updateSectionWidth(self, logicalIndex, oldSize, newSize):
if self.logicalIndex == 0:
self.frozenTableView.setColumnWidth(0, newSize)
self.updateFrozenTableGeometry()
def updateSectionHeight(self, logicalIndex, oldSize, newSize):
self.frozenTableView.setRowHeight(logicalIndex, newSize)
def resizeEvent(self, event):
super(FreezeTableWidget, self).resizeEvent(event)
self.updateFrozenTableGeometry()
def moveCursor(self, cursorAction, modifiers):
current = super(FreezeTableWidget, self).moveCursor(cursorAction, modifiers)
if (cursorAction == self.MoveLeft and
self.current.column() > 0 and
self.visualRect(current).topLeft().x() <
self.frozenTableView.columnWidth(0)):
newValue = (self.horizontalScrollBar().value() +
self.visualRect(current).topLeft().x() -
self.frozenTableView.columnWidth(0))
self.horizontalScrollBar().setValue(newValue)
return current
def scrollTo(self, index, hint):
if index.column() > 0:
super(FreezeTableWidget, self).scrollTo(index, hint)
def updateFrozenTableGeometry(self):
self.frozenTableView.setGeometry(
self.verticalHeader().width() + self.frameWidth(),
self.frameWidth(), self.columnWidth(0),
self.viewport().height() + self.horizontalHeader().height())
def main(args):
def split_and_strip(s, splitter):
return [s.strip() for s in line.split(splitter)]
app = QApplication(args)
model = QStandardItemModel()
file = QFile(":/grades.txt")
if file.open(QFile.ReadOnly):
line = file.readLine(200).decode('utf-8')
header = split_and_strip(line, ',')
model.setHorizontalHeaderLabels(header)
row = 0
while file.canReadLine():
line = file.readLine(200).decode('utf-8')
if not line.startswith('#') and ',' in line:
fields = split_and_strip(line, ',')
for col, field in enumerate(fields):
newItem = QStandardItem(field)
model.setItem(row, col, newItem)
row += 1
file.close()
tableView = FreezeTableWidget(model)
tableView.setWindowTitle("Frozen Column Example")
tableView.resize(560, 680)
tableView.show()
return app.exec_()
if __name__ == '__main__':
import sys
main(sys.argv)