개정판 17747be3
issue #628: fix data load and image scale
Change-Id: I980c01079002022e6cf6f4d62f28d91ee91873c4
DTI_PID/DTI_PID/AppDocData.py | ||
---|---|---|
623 | 623 |
|
624 | 624 |
with self.project.database.connect() as conn: |
625 | 625 |
cursor = conn.cursor() |
626 |
sql = f"select UID,Symbol_UID from Libraries where User='{os.environ['COMPUTERNAME'].upper()}'"
|
|
626 |
sql = f"select UID,Symbol_UID from Libraries where [User]='{os.environ['COMPUTERNAME'].upper()}'"
|
|
627 | 627 |
try: |
628 | 628 |
cursor.execute(sql) |
629 | 629 |
return cursor.fetchall() |
DTI_PID/DTI_PID/Configuration_UI.py | ||
---|---|---|
846 | 846 |
self.label_21.setText(_translate("ConfigurationDialog", "Erosion Size : ")) |
847 | 847 |
self.label_37.setText(_translate("ConfigurationDialog", "Allowed Single Text : ")) |
848 | 848 |
self.label_43.setText(_translate("ConfigurationDialog", "OCR Engine Mode")) |
849 |
self.labelTesseractVersion.setText(_translate("ConfigurationDialog", "TextLabel"))
|
|
849 |
self.labelTesseractVersion.setText(_translate("ConfigurationDialog", "TesseractVersion"))
|
|
850 | 850 |
self.label_39.setText(_translate("ConfigurationDialog", "Page segmentations modes")) |
851 | 851 |
self.label_19.setText(_translate("ConfigurationDialog", "OCR Source : ")) |
852 | 852 |
self.label_20.setText(_translate("ConfigurationDialog", "Expansion Size : ")) |
DTI_PID/DTI_PID/LibraryItem.py | ||
---|---|---|
24 | 24 |
app_doc_data = AppDocData.instance() |
25 | 25 |
self.favorites = app_doc_data.get_favorite_libraries() |
26 | 26 |
|
27 |
for idx, symbol in enumerate(self._symbol_tree_widget.symbols): |
|
28 |
matches = [favorite for favorite in self.favorites if symbol.getUid() == favorite['Symbol_UID']] |
|
27 |
idx = 0 |
|
28 |
for _, symbol in enumerate(self._symbol_tree_widget.symbols): |
|
29 |
matches = [favorite for favorite in self.favorites if symbol.getUid() == favorite[1]] |
|
29 | 30 |
if matches: |
30 |
self.layout.addWidget(LibraryItem(symbol), int(idx / LibraryItemWidget.COLUMN),
|
|
31 |
self.layout.addWidget(LibraryItem(symbol), idx // LibraryItemWidget.COLUMN, \
|
|
31 | 32 |
idx % LibraryItemWidget.COLUMN) |
33 |
idx += 1 |
|
32 | 34 |
except Exception as ex: |
33 | 35 |
from App import App |
34 | 36 |
|
... | ... | |
66 | 68 |
import os |
67 | 69 |
import uuid |
68 | 70 |
|
69 |
row = int((self.layout.count()) / LibraryItemWidget.COLUMN)
|
|
70 |
col = (self.layout.count()) % LibraryItemWidget.COLUMN
|
|
71 |
row = self.layout.count() // LibraryItemWidget.COLUMN
|
|
72 |
col = self.layout.count() % LibraryItemWidget.COLUMN
|
|
71 | 73 |
self.layout.addWidget(item, row, col) |
72 | 74 |
|
73 | 75 |
app_doc_data = AppDocData.instance() |
... | ... | |
110 | 112 |
QFrame.__init__(self) |
111 | 113 |
self.id = f"{symbol.getType()}.{symbol.getName()}" |
112 | 114 |
self._symbol = symbol |
115 |
self.setMaximumSize(64, 64) |
|
113 | 116 |
# An Icon and a label below |
114 | 117 |
icon = QLabel() |
118 |
#icon.setSizePolicy(QSizePolicy.Ignored,QSizePolicy.Ignored) |
|
119 |
icon.setScaledContents(True) |
|
115 | 120 |
#icon.resize(symbol.pixmap.width(), symbol.pixmap.height()) |
116 | 121 |
icon.setPixmap(symbol.pixmap) |
117 | 122 |
layout = QGridLayout() |
... | ... | |
122 | 127 |
title.setFont(font) |
123 | 128 |
layout.addWidget(title, 1, 0, Qt.AlignTop | Qt.AlignHCenter) |
124 | 129 |
self.setLayout(layout) |
125 |
self.setMaximumSize(96, 96) |
|
126 | 130 |
|
127 | 131 |
@property |
128 | 132 |
def symbol(self): |
DTI_PID/DTI_PID/UI/Configuration.ui | ||
---|---|---|
336 | 336 |
<item row="0" column="2" colspan="2"> |
337 | 337 |
<widget class="QLabel" name="labelTesseractVersion"> |
338 | 338 |
<property name="text"> |
339 |
<string>TextLabel</string>
|
|
339 |
<string>TesseractVersion</string>
|
|
340 | 340 |
</property> |
341 | 341 |
<property name="alignment"> |
342 | 342 |
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> |
... | ... | |
1716 | 1716 |
</connections> |
1717 | 1717 |
<buttongroups> |
1718 | 1718 |
<buttongroup name="buttonGroup"/> |
1719 |
<buttongroup name="buttonGroup_2"/> |
|
1720 |
<buttongroup name="buttonGroup_3"/> |
|
1721 | 1719 |
<buttongroup name="buttonGroup_5"/> |
1722 | 1720 |
<buttongroup name="buttonGroup_4"/> |
1723 | 1721 |
<buttongroup name="buttonGroup_6"/> |
1722 |
<buttongroup name="buttonGroup_3"/> |
|
1723 |
<buttongroup name="buttonGroup_2"/> |
|
1724 | 1724 |
</buttongroups> |
1725 | 1725 |
</ui> |
내보내기 Unified diff