mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2025-01-15 08:53:53 +08:00
...
This commit is contained in:
parent
cba64e3ee6
commit
c1cad12cd9
@ -315,7 +315,6 @@ class showocrimage(saveposwindow):
|
|||||||
gobject.baseobject.textgetmethod(text, False)
|
gobject.baseobject.textgetmethod(text, False)
|
||||||
|
|
||||||
def __init__(self, parent, cached):
|
def __init__(self, parent, cached):
|
||||||
self.img1 = None
|
|
||||||
self.originimage = None
|
self.originimage = None
|
||||||
super().__init__(parent, poslist=globalconfig["showocrgeo"])
|
super().__init__(parent, poslist=globalconfig["showocrgeo"])
|
||||||
self.setWindowIcon(qtawesome.icon("fa.picture-o"))
|
self.setWindowIcon(qtawesome.icon("fa.picture-o"))
|
||||||
@ -330,17 +329,30 @@ class showocrimage(saveposwindow):
|
|||||||
hb = QHBoxLayout()
|
hb = QHBoxLayout()
|
||||||
hb.addWidget(icon)
|
hb.addWidget(icon)
|
||||||
hb.addWidget(button)
|
hb.addWidget(button)
|
||||||
|
self.dial = QSpinBox(self)
|
||||||
|
self.dial.setRange(0, 359)
|
||||||
|
self.dial.setWrapping(True)
|
||||||
|
self.dial.valueChanged.connect(self.onValueChanged)
|
||||||
|
self.dial.setSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed)
|
||||||
|
hb.addWidget(self.dial)
|
||||||
self.layout1.addLayout(hb)
|
self.layout1.addLayout(hb)
|
||||||
self.layout1.addWidget(self.originlabel)
|
self.layout1.addWidget(self.originlabel)
|
||||||
self.setimage.connect(self.setimagefunction)
|
self.setimage.connect(self.setimagefunction)
|
||||||
if cached:
|
if cached:
|
||||||
self.setimagefunction(cached)
|
self.setimagefunction(cached)
|
||||||
|
|
||||||
|
def onValueChanged(self, value):
|
||||||
|
transform = QTransform()
|
||||||
|
transform.rotate(value)
|
||||||
|
rotated_image = self.originimage.transformed(transform)
|
||||||
|
self.originlabel.showpixmap(QPixmap.fromImage(rotated_image))
|
||||||
|
|
||||||
def retest(self):
|
def retest(self):
|
||||||
if self.originimage is None:
|
if self.originimage is None:
|
||||||
return
|
return
|
||||||
|
transform = QTransform()
|
||||||
text, infotype = ocr_run(self.originimage)
|
transform.rotate(self.dial.value())
|
||||||
|
text, infotype = ocr_run(self.originimage.transformed(transform))
|
||||||
if infotype:
|
if infotype:
|
||||||
gobject.baseobject.displayinfomessage(text, infotype)
|
gobject.baseobject.displayinfomessage(text, infotype)
|
||||||
else:
|
else:
|
||||||
@ -348,8 +360,7 @@ class showocrimage(saveposwindow):
|
|||||||
|
|
||||||
def setimagefunction(self, originimage):
|
def setimagefunction(self, originimage):
|
||||||
self.originimage = originimage
|
self.originimage = originimage
|
||||||
self.img1 = QPixmap.fromImage(originimage)
|
self.originlabel.showpixmap(QPixmap.fromImage(originimage))
|
||||||
self.originlabel.showpixmap(self.img1)
|
|
||||||
|
|
||||||
|
|
||||||
def getocrgrid(self):
|
def getocrgrid(self):
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
try:
|
try:
|
||||||
from PyQt5 import QtSvg
|
from PyQt5 import QtSvg
|
||||||
from PyQt5.QtWidgets import QFrame,QListView,QCheckBox,QAbstractItemView,QTextEdit,QTableView,QHeaderView,QColorDialog,QSpinBox,QDoubleSpinBox,QComboBox,QDialogButtonBox,QMainWindow,QMessageBox,QDialog,QGridLayout,QTextBrowser,QGraphicsDropShadowEffect,QWidget,QSizePolicy,QScrollArea,QApplication,QPushButton,QSystemTrayIcon,QPlainTextEdit,QAction,QMenu,QFileDialog,QKeySequenceEdit,QLabel,QSpacerItem,QWidgetItem,QLayout,QTextBrowser,QLineEdit,QFormLayout,QSizePolicy,QTabWidget,QTabBar,QSplitter,QListWidget,QListWidgetItem,QHBoxLayout,QVBoxLayout,QSizeGrip,QFontComboBox,QProgressBar,QRadioButton,QButtonGroup,QSlider,QToolTip,QGroupBox,QGraphicsOpacityEffect,QStackedWidget,QStyledItemDelegate,QStyleOptionViewItem,QFontDialog
|
from PyQt5.QtWidgets import QFrame,QListView,QCheckBox,QAbstractItemView,QTextEdit,QTableView,QHeaderView,QColorDialog,QSpinBox,QDoubleSpinBox,QComboBox,QDialogButtonBox,QMainWindow,QMessageBox,QDialog,QGridLayout,QTextBrowser,QGraphicsDropShadowEffect,QWidget,QSizePolicy,QScrollArea,QApplication,QPushButton,QSystemTrayIcon,QPlainTextEdit,QAction,QMenu,QFileDialog,QKeySequenceEdit,QLabel,QSpacerItem,QWidgetItem,QLayout,QTextBrowser,QLineEdit,QFormLayout,QSizePolicy,QTabWidget,QTabBar,QSplitter,QListWidget,QListWidgetItem,QHBoxLayout,QVBoxLayout,QSizeGrip,QFontComboBox,QProgressBar,QRadioButton,QButtonGroup,QSlider,QToolTip,QGroupBox,QGraphicsOpacityEffect,QStackedWidget,QStyledItemDelegate,QStyleOptionViewItem,QFontDialog
|
||||||
from PyQt5.QtGui import QIconEngine,QIntValidator,QStandardItem,QStandardItemModel,QImageWriter,QIcon,QTextCharFormat,QTextBlockFormat,QResizeEvent,QTextCursor,QFontMetricsF,QMouseEvent,QImage,QPainter,QRegion,QCloseEvent,QFontDatabase,QKeySequence,QPixmap,QCursor,QColor,QFont,QPen,QPainterPath,QBrush,QFontMetrics,QShowEvent,QWheelEvent,QPaintEvent,QTextLayout, QTextOption,QDragEnterEvent, QDropEvent
|
from PyQt5.QtGui import QIconEngine,QIntValidator,QStandardItem,QStandardItemModel,QImageWriter,QIcon,QTextCharFormat,QTextBlockFormat,QResizeEvent,QTextCursor,QFontMetricsF,QMouseEvent,QImage,QPainter,QRegion,QCloseEvent,QFontDatabase,QKeySequence,QPixmap,QCursor,QColor,QFont,QPen,QPainterPath,QBrush,QFontMetrics,QShowEvent,QWheelEvent,QPaintEvent,QTextLayout, QTextOption,QDragEnterEvent, QDropEvent,QTransform
|
||||||
from PyQt5.QtCore import QObject,pyqtSignal,Qt,QSize,QByteArray,QBuffer,QPointF,QPoint,QRect,QEvent,QModelIndex,QTimer,QRectF,QVariantAnimation,QUrl,QPropertyAnimation,QLocale,QSignalBlocker
|
from PyQt5.QtCore import QObject,pyqtSignal,Qt,QSize,QByteArray,QBuffer,QPointF,QPoint,QRect,QEvent,QModelIndex,QTimer,QRectF,QVariantAnimation,QUrl,QPropertyAnimation,QLocale,QSignalBlocker
|
||||||
isqt5 = True
|
isqt5 = True
|
||||||
class LineHeightTypes:
|
class LineHeightTypes:
|
||||||
|
@ -29,7 +29,7 @@ include(generate_product_version)
|
|||||||
|
|
||||||
set(VERSION_MAJOR 5)
|
set(VERSION_MAJOR 5)
|
||||||
set(VERSION_MINOR 38)
|
set(VERSION_MINOR 38)
|
||||||
set(VERSION_PATCH 11)
|
set(VERSION_PATCH 12)
|
||||||
|
|
||||||
add_library(pch pch.cpp)
|
add_library(pch pch.cpp)
|
||||||
target_precompile_headers(pch PUBLIC pch.h)
|
target_precompile_headers(pch PUBLIC pch.h)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user