eric6/UI/SymbolsWidget.py

Sat, 27 Feb 2021 12:08:23 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 27 Feb 2021 12:08:23 +0100
changeset 8138
169e65a6787c
parent 7923
91e843545d9a
child 8143
2c730d5fd177
permissions
-rw-r--r--

Shell: added functionality to show a prompt when the main client process has exited (e.g. a script ended).

365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7923
91e843545d9a Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7781
diff changeset
3 # Copyright (c) 2010 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a widget to select a symbol in various formats.
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
4970
dcbb14191a3b Redid the SymbolsWidget fix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
10 import sys
dcbb14191a3b Redid the SymbolsWidget fix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
11 import unicodedata
7192
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
12 import html.entities
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13
7264
bedbe458d792 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
14 from PyQt5.QtCore import (
bedbe458d792 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
15 pyqtSlot, pyqtSignal, QAbstractTableModel, QModelIndex, Qt,
bedbe458d792 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
16 QItemSelectionModel, QLocale
bedbe458d792 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
17 )
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
18 from PyQt5.QtGui import QColor
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
19 from PyQt5.QtWidgets import QWidget, QHeaderView, QAbstractItemView
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 from .Ui_SymbolsWidget import Ui_SymbolsWidget
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22
369
64d423a83450 Added code to set the window icon to the new symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 367
diff changeset
23 import UI.PixmapCache
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
24 import Preferences
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
25
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
26
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 class SymbolsModel(QAbstractTableModel):
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 Class implementing the model for the symbols widget.
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 """
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
31 def __init__(self, parent=None):
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 Constructor
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 @param parent reference to the parent object (QObject)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 """
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2302
diff changeset
37 super(SymbolsModel, self).__init__(parent)
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38
4467
fc6f2095a423 Fixed several issues with the symbols viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
39 self.__locale = QLocale()
fc6f2095a423 Fixed several issues with the symbols viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
40
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41 self.__headerData = [
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
42 self.tr("Code"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
43 self.tr("Char"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
44 self.tr("Hex"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
45 self.tr("HTML"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
46 self.tr("Name"),
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47 ]
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48
2603
2efe1c237c33 Implemented a fix for the Symbols Viewer for Python builds with sys.maxunicode = 0xffff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
49 self.__tables = [
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
50 # first last display name
3539
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
51 (0x0, 0x1f, self.tr("Control Characters")),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
52 (0x20, 0x7f, self.tr("Basic Latin")),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
53 (0x80, 0xff, self.tr("Latin-1 Supplement")),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
54 (0x100, 0x17f, self.tr("Latin Extended-A")),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
55 (0x180, 0x24f, self.tr("Latin Extended-B")),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
56 (0x250, 0x2af, self.tr("IPA Extensions")),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
57 (0x2b0, 0x2ff, self.tr("Spacing Modifier Letters")),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
58 (0x300, 0x36f, self.tr("Combining Diacritical Marks")),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
59 (0x370, 0x3ff, self.tr("Greek and Coptic")),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
60 (0x400, 0x4ff, self.tr("Cyrillic")),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
61 (0x500, 0x52f, self.tr("Cyrillic Supplement")),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
62 (0x530, 0x58f, self.tr("Armenian")),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
63 (0x590, 0x5ff, self.tr("Hebrew")),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
64 (0x600, 0x6ff, self.tr("Arabic")),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
65 (0x700, 0x74f, self.tr("Syriac")),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
66 (0x780, 0x7bf, self.tr("Thaana")),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
67 (0x7c0, 0x7ff, self.tr("N'Ko")),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
68 (0x800, 0x83f, self.tr("Samaritan")),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
69 (0x840, 0x85f, self.tr("Mandaic")),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
70 (0x8a0, 0x8ff, self.tr("Arabic Extended-A")),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
71 (0x900, 0x97f, self.tr("Devanagari")),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
72 (0x980, 0x9ff, self.tr("Bengali")),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
73 (0xa00, 0xa7f, self.tr("Gurmukhi")),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
74 (0xa80, 0xaff, self.tr("Gujarati")),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
75 (0xb00, 0xb7f, self.tr("Oriya")),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
76 (0xb80, 0xbff, self.tr("Tamil")),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
77 (0xc00, 0xc7f, self.tr("Telugu")),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
78 (0xc80, 0xcff, self.tr("Kannada")),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
79 (0xd00, 0xd7f, self.tr("Malayalam")),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
80 (0xd80, 0xdff, self.tr("Sinhala")),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
81 (0xe00, 0xe7f, self.tr("Thai")),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
82 (0xe80, 0xeff, self.tr("Lao")),
0c2dc1446ebf Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
83 (0xf00, 0xfff, self.tr("Tibetan")),
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
84 (0x1000, 0x109f, self.tr("Myanmar")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
85 (0x10a0, 0x10ff, self.tr("Georgian")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
86 (0x1100, 0x11ff, self.tr("Hangul Jamo")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
87 (0x1200, 0x137f, self.tr("Ethiopic")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
88 (0x1380, 0x139f, self.tr("Ethiopic Supplement")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
89 (0x13a0, 0x13ff, self.tr("Cherokee")),
3012
d177226027e2 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2605
diff changeset
90 (0x1400, 0x167f,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
91 self.tr("Unified Canadian Aboriginal Syllabics")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
92 (0x1680, 0x169f, self.tr("Ogham")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
93 (0x16a0, 0x16ff, self.tr("Runic")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
94 (0x1700, 0x171f, self.tr("Tagalog")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
95 (0x1720, 0x173f, self.tr("Hanunoo")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
96 (0x1740, 0x175f, self.tr("Buhid")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
97 (0x1760, 0x177f, self.tr("Tagbanwa")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
98 (0x1780, 0x17ff, self.tr("Khmer")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
99 (0x1800, 0x18af, self.tr("Mongolian")),
3012
d177226027e2 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2605
diff changeset
100 (0x18b0, 0x18ff,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
101 self.tr("Unified Canadian Aboriginal Syllabics Extended")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
102 (0x1900, 0x194f, self.tr("Limbu")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
103 (0x1950, 0x197f, self.tr("Tai Le")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
104 (0x19e0, 0x19ff, self.tr("Khmer Symbols")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
105 (0x1a00, 0x1a1f, self.tr("Buginese")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
106 (0x1a20, 0x1aaf, self.tr("Tai Tham")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
107 (0x1b00, 0x1b7f, self.tr("Balinese")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
108 (0x1b80, 0x1bbf, self.tr("Sundanese")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
109 (0x1bc0, 0x1bff, self.tr("Batak")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
110 (0x1c00, 0x1c4f, self.tr("Lepcha")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
111 (0x1c50, 0x1c7f, self.tr("Ol Chiki")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
112 (0x1cc0, 0x1ccf, self.tr("Sundanese Supplement")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
113 (0x1cd0, 0x1cff, self.tr("Vedic Extensions")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
114 (0x1d00, 0x1d7f, self.tr("Phonetic Extensions")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
115 (0x1d80, 0x1dbf, self.tr("Phonetic Extensions Supplement")),
3012
d177226027e2 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2605
diff changeset
116 (0x1dc0, 0x1dff,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
117 self.tr("Combining Diacritical Marks Supplement")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
118 (0x1e00, 0x1eff, self.tr("Latin Extended Additional")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
119 (0x1f00, 0x1fff, self.tr("Greek Extended")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
120 (0x2000, 0x206f, self.tr("General Punctuation")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
121 (0x2070, 0x209f, self.tr("Superscripts and Subscripts")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
122 (0x20a0, 0x20cf, self.tr("Currency Symbols")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
123 (0x20d0, 0x20ff, self.tr("Combining Diacritical Marks")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
124 (0x2100, 0x214f, self.tr("Letterlike Symbols")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
125 (0x2150, 0x218f, self.tr("Number Forms")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
126 (0x2190, 0x21ff, self.tr("Arcolumns")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
127 (0x2200, 0x22ff, self.tr("Mathematical Operators")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
128 (0x2300, 0x23ff, self.tr("Miscellaneous Technical")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
129 (0x2400, 0x243f, self.tr("Control Pictures")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
130 (0x2440, 0x245f, self.tr("Optical Character Recognition")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
131 (0x2460, 0x24ff, self.tr("Enclosed Alphanumerics")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
132 (0x2500, 0x257f, self.tr("Box Drawing")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
133 (0x2580, 0x259f, self.tr("Block Elements")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
134 (0x25A0, 0x25ff, self.tr("Geometric Shapes")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
135 (0x2600, 0x26ff, self.tr("Miscellaneous Symbols")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
136 (0x2700, 0x27bf, self.tr("Dingbats")),
3012
d177226027e2 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2605
diff changeset
137 (0x27c0, 0x27ef,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
138 self.tr("Miscellaneous Mathematical Symbols-A")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
139 (0x27f0, 0x27ff, self.tr("Supplement Arcolumns-A")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
140 (0x2800, 0x28ff, self.tr("Braille Patterns")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
141 (0x2900, 0x297f, self.tr("Supplement Arcolumns-B")),
3012
d177226027e2 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2605
diff changeset
142 (0x2980, 0x29ff,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
143 self.tr("Miscellaneous Mathematical Symbols-B")),
3012
d177226027e2 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2605
diff changeset
144 (0x2a00, 0x2aff,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
145 self.tr("Supplemental Mathematical Operators")),
3012
d177226027e2 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2605
diff changeset
146 (0x2b00, 0x2bff,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
147 self.tr("Miscellaneous Symbols and Arcolumns")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
148 (0x2c00, 0x2c5f, self.tr("Glagolitic")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
149 (0x2c60, 0x2c7f, self.tr("Latin Extended-C")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
150 (0x2c80, 0x2cff, self.tr("Coptic")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
151 (0x2d00, 0x2d2f, self.tr("Georgian Supplement")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
152 (0x2d30, 0x2d7f, self.tr("Tifinagh")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
153 (0x2d80, 0x2ddf, self.tr("Ethiopic Extended")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
154 (0x2de0, 0x2dff, self.tr("Cyrillic Extended-A")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
155 (0x2e00, 0x2e7f, self.tr("Supplemental Punctuation")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
156 (0x2e80, 0x2eff, self.tr("CJK Radicals Supplement")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
157 (0x2f00, 0x2fdf, self.tr("KangXi Radicals")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
158 (0x2ff0, 0x2fff, self.tr("Ideographic Description Chars")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
159 (0x3000, 0x303f, self.tr("CJK Symbols and Punctuation")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
160 (0x3040, 0x309f, self.tr("Hiragana")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
161 (0x30a0, 0x30ff, self.tr("Katakana")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
162 (0x3100, 0x312f, self.tr("Bopomofo")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
163 (0x3130, 0x318f, self.tr("Hangul Compatibility Jamo")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
164 (0x3190, 0x319f, self.tr("Kanbun")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
165 (0x31a0, 0x31bf, self.tr("Bopomofo Extended")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
166 (0x31c0, 0x31ef, self.tr("CJK Strokes")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
167 (0x31f0, 0x31ff, self.tr("Katakana Phonetic Extensions")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
168 (0x3200, 0x32ff, self.tr("Enclosed CJK Letters and Months")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
169 (0x3300, 0x33ff, self.tr("CJK Compatibility")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
170 (0x3400, 0x4dbf, self.tr("CJK Unified Ideogr. Ext. A")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
171 (0x4dc0, 0x4dff, self.tr("Yijing Hexagram Symbols")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
172 (0x4e00, 0x9fff, self.tr("CJK Unified Ideographs")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
173 (0xa000, 0xa48f, self.tr("Yi Syllables")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
174 (0xa490, 0xa4cf, self.tr("Yi Radicals")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
175 (0xa4d0, 0xa4ff, self.tr("Lisu")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
176 (0xa500, 0xa63f, self.tr("Vai")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
177 (0xa640, 0xa69f, self.tr("Cyrillic Extended-B")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
178 (0xa6a0, 0xa6ff, self.tr("Bamum")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
179 (0xa700, 0xa71f, self.tr("Modifier Tone Letters")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
180 (0xa720, 0xa7ff, self.tr("Latin Extended-D")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
181 (0xa800, 0xa82f, self.tr("Syloti Nagri")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
182 (0xa830, 0xa83f, self.tr("Common Indic Number Forms")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
183 (0xa840, 0xa87f, self.tr("Phags-pa")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
184 (0xa880, 0xa8df, self.tr("Saurashtra")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
185 (0xa8e0, 0xa8ff, self.tr("Devanagari Extended")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
186 (0xa900, 0xa92f, self.tr("Kayah Li")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
187 (0xa930, 0xa95f, self.tr("Rejang")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
188 (0xa960, 0xa97f, self.tr("Hangul Jamo Extended-A")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
189 (0xa980, 0xa9df, self.tr("Javanese")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
190 (0xaa00, 0xaa5f, self.tr("Cham")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
191 (0xaa60, 0xaa7f, self.tr("Myanmar Extended-A")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
192 (0xaa80, 0xaadf, self.tr("Tai Viet")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
193 (0xaae0, 0xaaff, self.tr("Meetei Mayek Extensions")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
194 (0xab00, 0xab2f, self.tr("Ethiopic Extended-A")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
195 (0xabc0, 0xabff, self.tr("Meetei Mayek")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
196 (0xac00, 0xd7af, self.tr("Hangul Syllables")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
197 (0xd7b0, 0xd7ff, self.tr("Hangul Jamo Extended-B")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
198 (0xd800, 0xdb7f, self.tr("High Surrogates")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
199 (0xdb80, 0xdbff, self.tr("High Private Use Surrogates")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
200 (0xdc00, 0xdfff, self.tr("Low Surrogates")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
201 (0xe000, 0xf8ff, self.tr("Private Use")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
202 (0xf900, 0xfaff, self.tr("CJK Compatibility Ideographs")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
203 (0xfb00, 0xfb4f, self.tr("Alphabetic Presentation Forms")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
204 (0xfb50, 0xfdff, self.tr("Arabic Presentation Forms-A")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
205 (0xfe00, 0xfe0f, self.tr("Variation Selectors")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
206 (0xfe10, 0xfe1f, self.tr("Vertical Forms")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
207 (0xfe20, 0xfe2f, self.tr("Combining Half Marks")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
208 (0xfe30, 0xfe4f, self.tr("CJK Compatibility Forms")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
209 (0xfe50, 0xfe6f, self.tr("Small Form Variants")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
210 (0xfe70, 0xfeff, self.tr("Arabic Presentation Forms-B")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
211 (0xff00, 0xffef, self.tr("Half- and Fullwidth Forms")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
212 (0xfff0, 0xffff, self.tr("Specials")),
2603
2efe1c237c33 Implemented a fix for the Symbols Viewer for Python builds with sys.maxunicode = 0xffff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
213 ]
2efe1c237c33 Implemented a fix for the Symbols Viewer for Python builds with sys.maxunicode = 0xffff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
214 if sys.maxunicode > 0xffff:
2efe1c237c33 Implemented a fix for the Symbols Viewer for Python builds with sys.maxunicode = 0xffff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
215 self.__tables.extend([
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
216 (0x10000, 0x1007f, self.tr("Linear B Syllabary")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
217 (0x10080, 0x100ff, self.tr("Linear B Ideograms")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
218 (0x10100, 0x1013f, self.tr("Aegean Numbers")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
219 (0x10140, 0x1018f, self.tr("Ancient Greek Numbers")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
220 (0x10190, 0x101cf, self.tr("Ancient Symbols")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
221 (0x101d0, 0x101ff, self.tr("Phaistos Disc")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
222 (0x10280, 0x1029f, self.tr("Lycian")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
223 (0x102a0, 0x102df, self.tr("Carian")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
224 (0x10300, 0x1032f, self.tr("Old Italic")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
225 (0x10330, 0x1034f, self.tr("Gothic")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
226 (0x10380, 0x1039f, self.tr("Ugaritic")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
227 (0x103a0, 0x103df, self.tr("Old Persian")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
228 (0x10400, 0x1044f, self.tr("Deseret")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
229 (0x10450, 0x1047f, self.tr("Shavian")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
230 (0x10480, 0x104af, self.tr("Osmanya")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
231 (0x10800, 0x1083f, self.tr("Cypriot Syllabary")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
232 (0x10840, 0x1085f, self.tr("Imperial Aramaic")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
233 (0x10900, 0x1091f, self.tr("Phoenician")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
234 (0x10920, 0x1093f, self.tr("Lydian")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
235 (0x10980, 0x1099f, self.tr("Meroitic Hieroglyphs")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
236 (0x109a0, 0x109ff, self.tr("Meroitic Cursive")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
237 (0x10a00, 0x10a5f, self.tr("Kharoshthi")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
238 (0x10a60, 0x10a7f, self.tr("Old South Arabian")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
239 (0x10b00, 0x10b3f, self.tr("Avestan")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
240 (0x10b40, 0x10b5f, self.tr("Inscriptional Parthian")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
241 (0x10b60, 0x10b7f, self.tr("Inscriptional Pahlavi")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
242 (0x10c00, 0x10c4f, self.tr("Old Turkic")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
243 (0x10e60, 0x10e7f, self.tr("Rumi Numeral Symbols")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
244 (0x11000, 0x1107f, self.tr("Brahmi")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
245 (0x11080, 0x110cf, self.tr("Kaithi")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
246 (0x110d0, 0x110ff, self.tr("Sora Sompeng")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
247 (0x11100, 0x1114f, self.tr("Chakma")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
248 (0x11180, 0x111df, self.tr("Sharada")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
249 (0x11680, 0x116cf, self.tr("Takri")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
250 (0x12000, 0x123ff, self.tr("Cuneiform")),
3012
d177226027e2 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2605
diff changeset
251 (0x12400, 0x1247f,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
252 self.tr("Cuneiform Numbers and Punctuation")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
253 (0x13000, 0x1342f, self.tr("Egyptian Hieroglyphs")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
254 (0x16800, 0x16a3f, self.tr("Bamum Supplement")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
255 (0x16f00, 0x16f9f, self.tr("Miao")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
256 (0x1b000, 0x1b0ff, self.tr("Kana Supplement")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
257 (0x1d000, 0x1d0ff, self.tr("Byzantine Musical Symbols")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
258 (0x1d100, 0x1d1ff, self.tr("Musical Symbols")),
3012
d177226027e2 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2605
diff changeset
259 (0x1d200, 0x1d24f,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
260 self.tr("Ancient Greek Musical Notation")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
261 (0x1d300, 0x1d35f, self.tr("Tai Xuan Jing Symbols")),
3012
d177226027e2 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2605
diff changeset
262 (0x1d360, 0x1d37f,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
263 self.tr("Counting Rod Numerals")),
3012
d177226027e2 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2605
diff changeset
264 (0x1d400, 0x1d7ff,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
265 self.tr("Mathematical Alphanumeric Symbols")),
3012
d177226027e2 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2605
diff changeset
266 (0x1ee00, 0x1eeff,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
267 self.tr("Arabic Mathematical Alphabetic Symbols")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
268 (0x1f000, 0x1f02f, self.tr("Mahjong Tiles")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
269 (0x1f030, 0x1f09f, self.tr("Domino Tiles")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
270 (0x1f0a0, 0x1f0ff, self.tr("Playing Cards")),
3012
d177226027e2 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2605
diff changeset
271 (0x1f100, 0x1f1ff,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
272 self.tr("Enclosed Alphanumeric Supplement")),
3012
d177226027e2 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2605
diff changeset
273 (0x1f200, 0x1f2ff,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
274 self.tr("Enclosed Ideographic Supplement")),
3012
d177226027e2 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2605
diff changeset
275 (0x1f300, 0x1f5ff,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
276 self.tr("Miscellaneous Symbols And Pictographs")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
277 (0x1f600, 0x1f64f, self.tr("Emoticons")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
278 (0x1f680, 0x1f6ff, self.tr("Transport And Map Symbols")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
279 (0x1f700, 0x1f77f, self.tr("Alchemical Symbols")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
280 (0x20000, 0x2a6df, self.tr("CJK Unified Ideogr. Ext. B")),
3012
d177226027e2 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2605
diff changeset
281 (0x2a700, 0x2b73f,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
282 self.tr("CJK Unified Ideographs Extension C")),
3012
d177226027e2 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2605
diff changeset
283 (0x2b740, 0x2b81f,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
284 self.tr("CJK Unified Ideographs Extension D")),
3012
d177226027e2 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2605
diff changeset
285 (0x2f800, 0x2fa1f,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
286 self.tr("CJK Compatapility Ideogr. Suppl.")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
287 (0xe0000, 0xe007f, self.tr("Tags")),
3012
d177226027e2 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2605
diff changeset
288 (0xe0100, 0xe01ef,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
289 self.tr("Variation Selectors Supplement")),
3012
d177226027e2 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2605
diff changeset
290 (0xf0000, 0xfffff,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
291 self.tr("Supplementary Private Use Area-A")),
3012
d177226027e2 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2605
diff changeset
292 (0x100000, 0x10ffff,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
293 self.tr("Supplementary Private Use Area-B")),
2603
2efe1c237c33 Implemented a fix for the Symbols Viewer for Python builds with sys.maxunicode = 0xffff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
294 ])
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
295 self.__currentTableIndex = 0
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
296
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
297 def getTableNames(self):
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
298 """
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
299 Public method to get a list of table names.
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
300
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
301 @return list of table names (list of strings)
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
302 """
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
303 return [table[2] for table in self.__tables]
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
304
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
305 def getTableBoundaries(self, index):
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
306 """
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
307 Public method to get the first and last character position
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
308 of the given table.
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
309
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
310 @param index index of the character table (integer)
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
311 @return first and last character position (integer, integer)
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
312 """
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
313 return self.__tables[index][0], self.__tables[index][1]
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
314
367
e66ebdb3b6a2 Corrected a few things in the new symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 366
diff changeset
315 def getTableIndex(self):
e66ebdb3b6a2 Corrected a few things in the new symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 366
diff changeset
316 """
3591
2f2a4a76dd22 Corrected a bunch of source docu issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3539
diff changeset
317 Public method to get the current table index.
367
e66ebdb3b6a2 Corrected a few things in the new symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 366
diff changeset
318
e66ebdb3b6a2 Corrected a few things in the new symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 366
diff changeset
319 @return current table index (integer)
e66ebdb3b6a2 Corrected a few things in the new symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 366
diff changeset
320 """
e66ebdb3b6a2 Corrected a few things in the new symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 366
diff changeset
321 return self.__currentTableIndex
e66ebdb3b6a2 Corrected a few things in the new symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 366
diff changeset
322
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
323 def selectTable(self, index):
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
324 """
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
325 Public method to select the shown character table.
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
326
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
327 @param index index of the character table (integer)
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
328 """
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
329 self.beginResetModel()
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
330 self.__currentTableIndex = index
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
331 self.endResetModel()
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
332
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
333 def headerData(self, section, orientation, role=Qt.DisplayRole):
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
334 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
335 Public method to get header data from the model.
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
336
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
337 @param section section number (integer)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
338 @param orientation orientation (Qt.Orientation)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
339 @param role role of the data to retrieve (integer)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
340 @return requested data
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
341 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
342 if orientation == Qt.Horizontal and role == Qt.DisplayRole:
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
343 return self.__headerData[section]
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
344
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
345 return QAbstractTableModel.headerData(self, section, orientation, role)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
346
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
347 def data(self, index, role=Qt.DisplayRole):
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
348 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
349 Public method to get data from the model.
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
350
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
351 @param index index to get data for (QModelIndex)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
352 @param role role of the data to retrieve (integer)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
353 @return requested data
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
354 """
5603
4f2dd0850803 Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5587
diff changeset
355 symbolId = self.__tables[self.__currentTableIndex][0] + index.row()
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
356
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
357 if role == Qt.DisplayRole:
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
358 col = index.column()
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
359 if col == 0:
5603
4f2dd0850803 Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5587
diff changeset
360 return self.__locale.toString(symbolId)
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
361 elif col == 1:
5603
4f2dd0850803 Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5587
diff changeset
362 return chr(symbolId)
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
363 elif col == 2:
5603
4f2dd0850803 Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5587
diff changeset
364 return "0x{0:04x}".format(symbolId)
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
365 elif col == 3:
7192
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
366 if symbolId in html.entities.codepoint2name:
5603
4f2dd0850803 Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5587
diff changeset
367 return "&{0};".format(
7192
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
368 html.entities.codepoint2name[symbolId])
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
369 elif col == 4:
5603
4f2dd0850803 Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5587
diff changeset
370 return unicodedata.name(chr(symbolId), '').title()
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
371
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
372 if role == Qt.BackgroundColorRole:
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
373 if index.column() == 0:
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
374 return QColor(Qt.lightGray)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
375
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
376 if role == Qt.TextColorRole:
5603
4f2dd0850803 Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5587
diff changeset
377 char = chr(symbolId)
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
378 if self.__isDigit(char):
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
379 return QColor(Qt.darkBlue)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
380 elif self.__isLetter(char):
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
381 return QColor(Qt.darkGreen)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
382 elif self.__isMark(char):
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
383 return QColor(Qt.darkRed)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
384 elif self.__isSymbol(char):
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
385 return QColor(Qt.black)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
386 elif self.__isPunct(char):
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
387 return QColor(Qt.darkMagenta)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
388 else:
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
389 return QColor(Qt.darkGray)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
390
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
391 if role == Qt.TextAlignmentRole:
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
392 if index.column() in [0, 1, 3]:
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
393 return Qt.AlignHCenter
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
394
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
395 return None
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
396
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
397 def columnCount(self, parent):
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
398 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
399 Public method to get the number of columns of the model.
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
400
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
401 @param parent parent index (QModelIndex)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
402 @return number of columns (integer)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
403 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
404 if parent.column() > 0:
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
405 return 0
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
406 else:
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
407 return len(self.__headerData)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
408
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
409 def rowCount(self, parent):
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
410 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
411 Public method to get the number of rows of the model.
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
412
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
413 @param parent parent index (QModelIndex)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
414 @return number of columns (integer)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
415 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
416 if parent.isValid():
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
417 return 0
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
418 else:
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
419 first, last = self.__tables[self.__currentTableIndex][:2]
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
420 return last - first + 1
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
421
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
422 def __isDigit(self, char):
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
423 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
424 Private method to check, if a character is a digit.
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
425
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
426 @param char character to test (one character string)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
427 @return flag indicating a digit (boolean)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
428 """
4467
fc6f2095a423 Fixed several issues with the symbols viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
429 return unicodedata.category(str(char)) == "Nd"
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
430
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
431 def __isLetter(self, char):
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
432 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
433 Private method to check, if a character is a letter.
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
434
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
435 @param char character to test (one character string)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
436 @return flag indicating a letter (boolean)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
437 """
4467
fc6f2095a423 Fixed several issues with the symbols viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
438 return unicodedata.category(str(char)) in ["Lu", "Ll", "Lt", "Lm",
fc6f2095a423 Fixed several issues with the symbols viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
439 "Lo"]
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
440
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
441 def __isMark(self, char):
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
442 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
443 Private method to check, if a character is a mark character.
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
444
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
445 @param char character to test (one character string)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
446 @return flag indicating a mark character (boolean)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
447 """
4467
fc6f2095a423 Fixed several issues with the symbols viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
448 return unicodedata.category(str(char)) in ["Mn", "Mc", "Me"]
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
449
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
450 def __isSymbol(self, char):
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
451 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
452 Private method to check, if a character is a symbol.
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
453
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
454 @param char character to test (one character string)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
455 @return flag indicating a symbol (boolean)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
456 """
4467
fc6f2095a423 Fixed several issues with the symbols viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
457 return unicodedata.category(str(char)) in ["Sm", "Sc", "Sk", "So"]
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
458
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
459 def __isPunct(self, char):
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
460 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
461 Private method to check, if a character is a punctuation character.
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
462
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
463 @param char character to test (one character string)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
464 @return flag indicating a punctuation character (boolean)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
465 """
4467
fc6f2095a423 Fixed several issues with the symbols viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
466 return unicodedata.category(str(char)) in ["Pc", "Pd", "Ps", "Pe",
fc6f2095a423 Fixed several issues with the symbols viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
467 "Pi", "Pf", "Po"]
fc6f2095a423 Fixed several issues with the symbols viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
468
fc6f2095a423 Fixed several issues with the symbols viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
469 def getLocale(self):
fc6f2095a423 Fixed several issues with the symbols viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
470 """
fc6f2095a423 Fixed several issues with the symbols viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
471 Public method to get the used locale.
fc6f2095a423 Fixed several issues with the symbols viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
472
fc6f2095a423 Fixed several issues with the symbols viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
473 @return used locale
fc6f2095a423 Fixed several issues with the symbols viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
474 @rtype QLocale
fc6f2095a423 Fixed several issues with the symbols viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
475 """
fc6f2095a423 Fixed several issues with the symbols viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
476 return self.__locale
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
477
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
478
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
479 class SymbolsWidget(QWidget, Ui_SymbolsWidget):
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
480 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
481 Class implementing a widget to select a symbol in various formats.
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
482
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
483 @signal insertSymbol(str) emitted after the user has selected a symbol
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
484 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
485 insertSymbol = pyqtSignal(str)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
486
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
487 def __init__(self, parent=None):
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
488 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
489 Constructor
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
490
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
491 @param parent reference to the parent widget (QWidget)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
492 """
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2302
diff changeset
493 super(SymbolsWidget, self).__init__(parent)
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
494 self.setupUi(self)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
495
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7366
diff changeset
496 self.setWindowIcon(UI.PixmapCache.getIcon("eric"))
369
64d423a83450 Added code to set the window icon to the new symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 367
diff changeset
497
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
498 self.__model = SymbolsModel(self)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
499 self.symbolsTable.setModel(self.__model)
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
500 self.symbolsTable.selectionModel().currentRowChanged.connect(
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
501 self.__currentRowChanged)
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
502
7198
684261ef2165 Removed the Qt4 runtime stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
503 self.symbolsTable.horizontalHeader().setSectionResizeMode(
684261ef2165 Removed the Qt4 runtime stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
504 QHeaderView.Fixed)
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
505 fm = self.fontMetrics()
7366
bd743eacfbca Changed code to avoid some obsoleted Qt functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
506 try:
bd743eacfbca Changed code to avoid some obsoleted Qt functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
507 em = fm.horizontalAdvance("M")
bd743eacfbca Changed code to avoid some obsoleted Qt functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
508 except AttributeError:
bd743eacfbca Changed code to avoid some obsoleted Qt functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
509 em = fm.width("M")
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
510 self.symbolsTable.horizontalHeader().resizeSection(0, em * 5)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
511 self.symbolsTable.horizontalHeader().resizeSection(1, em * 5)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
512 self.symbolsTable.horizontalHeader().resizeSection(2, em * 6)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
513 self.symbolsTable.horizontalHeader().resizeSection(3, em * 8)
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
514 self.symbolsTable.horizontalHeader().resizeSection(4, em * 85)
3012
d177226027e2 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2605
diff changeset
515 self.symbolsTable.verticalHeader().setDefaultSectionSize(
d177226027e2 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2605
diff changeset
516 fm.height() + 4)
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
517
3012
d177226027e2 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2605
diff changeset
518 tableIndex = int(
d177226027e2 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2605
diff changeset
519 Preferences.Prefs.settings.value("Symbols/CurrentTable", 1))
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
520 self.tableCombo.addItems(self.__model.getTableNames())
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
521 self.tableCombo.setCurrentIndex(tableIndex)
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
522
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
523 index = self.__model.index(
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
524 int(Preferences.Prefs.settings.value("Symbols/Top", 0)),
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
525 0)
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
526 self.symbolsTable.scrollTo(index, QAbstractItemView.PositionAtTop)
3030
4a0a82ddd9d2 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3012
diff changeset
527 self.symbolsTable.selectionModel().setCurrentIndex(
4a0a82ddd9d2 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3012
diff changeset
528 index,
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
529 QItemSelectionModel.SelectCurrent | QItemSelectionModel.Rows)
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
530
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
531 @pyqtSlot(QModelIndex)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
532 def on_symbolsTable_activated(self, index):
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
533 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
534 Private slot to signal the selection of a symbol.
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
535
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
536 @param index index of the selected symbol (QModelIndex)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
537 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
538 txt = self.__model.data(index)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
539 if txt:
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
540 self.insertSymbol.emit(txt)
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
541
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
542 @pyqtSlot()
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
543 def on_symbolSpinBox_editingFinished(self):
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
544 """
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
545 Private slot to move the table to the entered symbol id.
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
546 """
5603
4f2dd0850803 Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5587
diff changeset
547 symbolId = self.symbolSpinBox.value()
3012
d177226027e2 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2605
diff changeset
548 first, last = self.__model.getTableBoundaries(
d177226027e2 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2605
diff changeset
549 self.__model.getTableIndex())
5603
4f2dd0850803 Continued fixing code style issues detected by the extended style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5587
diff changeset
550 row = symbolId - first
367
e66ebdb3b6a2 Corrected a few things in the new symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 366
diff changeset
551 self.symbolsTable.selectRow(row)
365
0686ac00256e Added a symbols viewer with capability to insert the selected symbol by double-clicking it.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
552 self.symbolsTable.scrollTo(
367
e66ebdb3b6a2 Corrected a few things in the new symbols widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 366
diff changeset
553 self.__model.index(row, 0), QAbstractItemView.PositionAtCenter)
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
554
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
555 @pyqtSlot(int)
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
556 def on_tableCombo_currentIndexChanged(self, index):
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
557 """
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
558 Private slot to select the current character table.
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
559
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
560 @param index index of the character table (integer)
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
561 """
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
562 self.symbolsTable.setUpdatesEnabled(False)
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
563 self.__model.selectTable(index)
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
564 self.symbolsTable.setUpdatesEnabled(True)
4467
fc6f2095a423 Fixed several issues with the symbols viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
565 self.symbolsTable.resizeColumnsToContents()
366
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
566
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
567 first, last = self.__model.getTableBoundaries(index)
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
568 self.symbolSpinBox.setMinimum(first)
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
569 self.symbolSpinBox.setMaximum(last)
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
570
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
571 Preferences.Prefs.settings.setValue("Symbols/CurrentTable", index)
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
572
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
573 def __currentRowChanged(self, current, previous):
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
574 """
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
575 Private slot recording the currently selected row.
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
576
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
577 @param current current index (QModelIndex)
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
578 @param previous previous current index (QModelIndex)
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
579 """
58f2122a5d6a Changed the symbol table to just show characters of a selectable character table.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 365
diff changeset
580 Preferences.Prefs.settings.setValue("Symbols/Top", current.row())
4467
fc6f2095a423 Fixed several issues with the symbols viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
581 self.symbolSpinBox.setValue(self.__model.getLocale().toInt(
fc6f2095a423 Fixed several issues with the symbols viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
582 self.__model.data(self.__model.index(current.row(), 0)))[0])

eric ide

mercurial