changed differentiater of text alignment from string to int
This commit is contained in:
parent
018f5900f0
commit
4aef5bfdb7
6
core.py
6
core.py
|
@ -52,11 +52,11 @@ class Core():
|
|||
yPosition = yOffset
|
||||
|
||||
fm = QtGui.QFontMetrics(font)
|
||||
if alignment == "Left":
|
||||
if alignment == 0: #Left
|
||||
xPosition = xOffset
|
||||
if alignment == "Middle":
|
||||
if alignment == 1: #Middle
|
||||
xPosition = xOffset - fm.width(titleText)/2
|
||||
if alignment == "Right":
|
||||
if alignment == 2: #Right
|
||||
xPosition = xOffset - fm.width(titleText)
|
||||
painter.drawText(xPosition, yPosition, titleText)
|
||||
painter.end()
|
||||
|
|
8
main.py
8
main.py
|
@ -14,9 +14,9 @@ import preview_thread, core, video_thread
|
|||
|
||||
class Main(QtCore.QObject):
|
||||
|
||||
newTask = QtCore.pyqtSignal(str, str, QFont, int, str, int, int)
|
||||
newTask = QtCore.pyqtSignal(str, str, QFont, int, int, int, int)
|
||||
processTask = QtCore.pyqtSignal()
|
||||
videoTask = QtCore.pyqtSignal(str, str, QFont, int, str, int, int, str, str)
|
||||
videoTask = QtCore.pyqtSignal(str, str, QFont, int, int, int, int, str, str)
|
||||
|
||||
def __init__(self, window):
|
||||
|
||||
|
@ -153,7 +153,7 @@ class Main(QtCore.QObject):
|
|||
self.window.lineEdit_title.text(),
|
||||
self.window.fontComboBox.currentFont(),
|
||||
self.window.fontsizeSpinBox.value(),
|
||||
self.window.alignmentComboBox.currentText(),
|
||||
self.window.alignmentComboBox.currentIndex(),
|
||||
self.window.textXSpinBox.value(),
|
||||
self.window.textYSpinBox.value(),
|
||||
self.window.label_input.text(),
|
||||
|
@ -172,7 +172,7 @@ class Main(QtCore.QObject):
|
|||
self.window.lineEdit_title.text(),
|
||||
self.window.fontComboBox.currentFont(),
|
||||
self.window.fontsizeSpinBox.value(),
|
||||
self.window.alignmentComboBox.currentText(),
|
||||
self.window.alignmentComboBox.currentIndex(),
|
||||
self.window.textXSpinBox.value(),
|
||||
self.window.textYSpinBox.value())
|
||||
# self.processTask.emit()
|
||||
|
|
|
@ -19,7 +19,7 @@ class Worker(QtCore.QObject):
|
|||
self.queue = queue
|
||||
|
||||
|
||||
@pyqtSlot(str, str, QtGui.QFont, int, str, int, int)
|
||||
@pyqtSlot(str, str, QtGui.QFont, int, int, int, int)
|
||||
def createPreviewImage(self, backgroundImage, titleText, titleFont, fontSize, alignment, xOffset, yOffset):
|
||||
# print('worker thread id: {}'.format(QtCore.QThread.currentThreadId()))
|
||||
dic = {
|
||||
|
|
|
@ -18,7 +18,7 @@ class Worker(QtCore.QObject):
|
|||
self.core = core.Core()
|
||||
|
||||
|
||||
@pyqtSlot(str, str, QtGui.QFont, int, str, int, int, str, str)
|
||||
@pyqtSlot(str, str, QtGui.QFont, int, int, int, int, str, str)
|
||||
def createVideo(self, backgroundImage, titleText, titleFont, fontSize, alignment, xOffset, yOffset, inputFile, outputFile):
|
||||
# print('worker thread id: {}'.format(QtCore.QThread.currentThreadId()))
|
||||
|
||||
|
|
Reference in New Issue