In PyQt, image won't show after override mousePressEvent of QGraphicsView - python

I want to write a simple program shows a picture and print which pixel was clicked by override mousePressEvent of QGraphicsView.
When I don't override mousePressEvent of QGraphicsView, the image shows fine. But when I do override it, not only the position failed to show itself, the canvas become blank.
before override:
import sys
from PyQt5 import Qt
from PyQt5 import uic
a = Qt.QApplication(sys.argv)
from untitled import Ui_Form
# class override_graphicsView (Qt.QGraphicsView):
#
# def mousePressEvent(self, event):
# print(event.pos())
class Image_Process(Qt.QWidget):
def __init__(self):
super(Image_Process, self).__init__()
self.path = r"d:\test\winxp.jpg" #image path
self.new = Ui_Form()
self.new.setupUi(self)
# self.new.graphicsView = override_graphicsView()
self.pixmap = Qt.QPixmap()
self.pixmap.load(self.path)
self.pixmap = self.pixmap.scaled(self.size(), Qt.Qt.KeepAspectRatio)
self.graphicsPixmapItem = Qt.QGraphicsPixmapItem(self.pixmap)
self.graphicsScene = Qt.QGraphicsScene()
self.graphicsScene.addItem(self.graphicsPixmapItem)
self.new.graphicsView.setScene(self.graphicsScene)
my_Qt_Program = Image_Process()
my_Qt_Program.show()
sys.exit(a.exec_())
After I uncomment those lines, the canvas becomes this, and nothing was printed after click.
The untitled.py was generated from QtDesigner
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'untitled.ui'
#
# Created: Mon Jan 12 02:07:05 2015
# by: PyQt5 UI code generator 5.3.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(451, 286)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(Form.sizePolicy().hasHeightForWidth())
Form.setSizePolicy(sizePolicy)
self.gridLayout = QtWidgets.QGridLayout(Form)
self.gridLayout.setObjectName("gridLayout")
self.graphicsView = QtWidgets.QGraphicsView(Form)
self.graphicsView.setObjectName("graphicsView")
self.gridLayout.addWidget(self.graphicsView, 0, 0, 1, 1)
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
_translate = QtCore.QCoreApplication.translate
Form.setWindowTitle(_translate("Form", "Form"))

Helped by Plouff, I have solved my own problem.
First, I should override QGraphicsScene instead of QGraphicsView, and the following line should be called for QGraphicsScene to handle mousePressEvent
super(override_graphicsScene, self).mousePressEvent(event)
Modified code:
import sys
from PyQt5 import Qt
from PyQt5 import uic
a = Qt.QApplication(sys.argv)
from untitled import Ui_Form
# Override like this:
class override_graphicsScene (Qt.QGraphicsScene):
def __init__(self,parent = None):
super(override_graphicsScene,self).__init__(parent)
def mousePressEvent(self, event):
super(override_graphicsScene, self).mousePressEvent(event)
print(event.pos())
class Image_Process(Qt.QWidget):
def __init__(self):
super(Image_Process, self).__init__()
self.path = r"d:\test\winxp.jpg" #image path
self.new = Ui_Form()
self.new.setupUi(self)
self.pixmap = Qt.QPixmap()
self.pixmap.load(self.path)
self.pixmap = self.pixmap.scaled(self.size(), Qt.Qt.KeepAspectRatio)
self.graphicsPixmapItem = Qt.QGraphicsPixmapItem(self.pixmap)
self.graphicsScene = override_graphicsScene(self)
self.graphicsScene.addItem(self.graphicsPixmapItem)
self.new.graphicsView.setScene(self.graphicsScene)
my_Qt_Program = Image_Process()
my_Qt_Program.show()
sys.exit(a.exec_())
The program works fine.

Related

How to integrate a cursor in a QtWidgets app

I am new to QtWidgets and trying to build an app in QtWidgets and Python (3.x). the end goal of the app is to show images and a
superposed cursor (to be exact, a "plus" sign of 2cm) that can be moved along the image reacting to mouse events. I concentrate now first on this cursor. So far, I read examples on how to do it on matplotlib. however, i have trouble to understand how to integrate matplotlib on my code.
Also, is matplotlib the easiest way to do it on this code. or there might be a better way to do it.
any hint would be helpful
thank you in advance.
here is my desired output and the code of my app
import sys
from PySide2 import QtWidgets
from vispy import scene
from PySide2.QtCore import QMetaObject
from PySide2.QtWidgets import *
class SimpleItem(QtWidgets.QGraphicsItem):
def __init__(self):
QtWidgets.QGraphicsItem.__init__(self)
self.setFlag(QtWidgets.QGraphicsItem.ItemIsMovable, True)
def boundingRect(self):
penWidth = 1.0
return QRectF(-10 - penWidth / 2, -10 - penWidth / 2,
20 + penWidth, 20 + penWidth)
def paint(self, painter, option, widget):
rect = self.boundingRect()
painter.drawRect(rect)
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
if not MainWindow.objectName():
MainWindow.setObjectName("MainWindow")
MainWindow.resize(800, 600)
self.centralwidget = QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.gridLayout = QGridLayout(self.centralwidget)
self.gridLayout.setObjectName("gridLayout")
self.groupBox = QGroupBox(self.centralwidget)
self.groupBox.setObjectName("groupBox")
self.gridLayout.addWidget(self.groupBox, 0, 0, 1, 1)
MainWindow.setCentralWidget(self.centralwidget)
QMetaObject.connectSlotsByName(MainWindow)
class MainWindow(QtWidgets.QMainWindow):
def __init__(self):
super(MainWindow, self).__init__()
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
# OpenGL drawing surface
self.canvas = scene.SceneCanvas(keys='interactive')
self.canvas.create_native()
self.canvas.native.setParent(self)
self.view = self.canvas.central_widget.add_view()
self.view.bgcolor = '#ffffff' # set the canva to a white background
scene2 = QGraphicsScene()
item = SimpleItem()
scene2.addItem(item)
self.setWindowTitle('MyApp')
def main():
import ctypes
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID('my_gui')
app = QtWidgets.QApplication([])
main_window = MainWindow()
main_window.show()
sys.exit(app.exec_())
if __name__ == '__main__':
main()
edit: I added a class (here it is a rectangle just as an example) to illustrate my problem. i have trouble integrating that snippet of the code (with SimpleItem) to OpenGL canvas
You can use the QApplication.setOverrideCursor method to assign a .png image file as your cursor when it appears inside of the Qt program.
Here is an example that is mostly based on the code in your question. And below is a gif that demonstrates the example. And the last image is the image I used in the code as cursor.png
Hope this helps
import sys
from PySide2.QtCore import *
from PySide2.QtWidgets import *
from PySide2.QtGui import *
class SimpleItem(QtWidgets.QGraphicsItem):
def __init__(self):
QtWidgets.QGraphicsItem.__init__(self)
self.setFlag(QtWidgets.QGraphicsItem.ItemIsMovable, True)
self._brush = QBrush(Qt.black)
def boundingRect(self):
penWidth = 1.0
return QRectF(-50 - penWidth / 2, -50 - penWidth / 2,
50 + penWidth, 50 + penWidth)
def paint(self, painter, option, widget):
rect = self.boundingRect()
painter.drawRect(rect)
painter.fillRect(rect, self._brush)
class MainWindow(QtWidgets.QMainWindow):
def __init__(self):
super(MainWindow, self).__init__()
self.resize(800, 600)
self.scene = QGraphicsScene()
self.canvas = scene.SceneCanvas(keys='interactive')
self.view = QGraphicsView(self.scene)
item = SimpleItem()
self.scene.addItem(item)
self.setCentralWidget(self.view)
self.setWindowTitle('MyApp')
def main():
import ctypes
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID('my_gui')
app = QtWidgets.QApplication([])
app.setOverrideCursor(QCursor(QPixmap('cursor.png')))
main_window = MainWindow()
main_window.show()
sys.exit(app.exec_())
if __name__ == '__main__':
main()

QTextBrowser text broken (with QThread for python) - Solved [duplicate]

I have a GUI made in Designer (pyqt5). A function in my main class needs to work on a separate thread. I also catch the stdout on a QtextEdit LIVE during operations. Everything so far works.
Right now I'm trying to implement a ProgressBar onto my main GUI form. The bar needs to show live progression just like it does on the textEdit.
The example code below works on Linux without any warnings. But on Windows I get the error:
QObject::setParent: Cannot set parent, new parent is in a different thread
I know that this is due to me having a ui element modification within my threaded function. I did my research but all the answers point to using QThreads (just when I started to understand basic threading!). I would prefer a way to update my GUI without having to change the current threading system below.
Here is the example code:
import sys
import threading
import time
from PyQt5.QtWidgets import QApplication, QMainWindow
from PyQt5.QtCore import QObject, pyqtSignal
from PyQt5.QtGui import QTextCursor
from ui_form import Ui_Form
class EmittingStream(QObject):
textWritten = pyqtSignal(str)
def write(self, text):
self.textWritten.emit(str(text))
class Form(QMainWindow):
finished = pyqtSignal()
def __init__(self, parent=None):
super(Form, self).__init__(parent)
# Install the custom output stream
sys.stdout = EmittingStream(textWritten=self.normalOutputWritten)
self.ui = Ui_Form()
self.ui.setupUi(self)
self.ui.pushButton_run.clicked.connect(self.start_task)
self.finished.connect(self.end_task)
def start_task(self):
self.thread = threading.Thread(target=self.run_test)
self.thread.start()
self.ui.pushButton_run.setEnabled(False)
def end_task(self):
self.ui.pushButton_run.setEnabled(True)
def __del__(self):
# Restore sys.stdout
sys.stdout = sys.__stdout__
def normalOutputWritten(self, text):
"""Append text to the QTextEdit."""
cursor = self.ui.textEdit.textCursor()
cursor.movePosition(QTextCursor.End)
cursor.insertText(text)
self.ui.textEdit.setTextCursor(cursor)
self.ui.textEdit.ensureCursorVisible()
def run_test(self):
for i in range(100):
per = i + 1
self.ui.progressBar.setValue(per)
print("%%%s" % per)
time.sleep(0.15) # simulating expensive task
print("Task Completed!")
time.sleep(1.5)
self.ui.progressBar.reset()
self.finished.emit()
def main():
app = QApplication(sys.argv)
form = Form()
form.show()
sys.exit(app.exec_())
if __name__ == "__main__":
main()
the ui:
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'form.ui'
#
# Created: Mon Apr 30 13:43:19 2018
# by: PyQt5 UI code generator 5.2.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(800, 600)
self.centralwidget = QtWidgets.QWidget(Form)
self.centralwidget.setObjectName("centralwidget")
self.pushButton_run = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_run.setGeometry(QtCore.QRect(40, 20, 311, 191))
self.pushButton_run.setObjectName("pushButton_run")
self.textEdit = QtWidgets.QTextEdit(self.centralwidget)
self.textEdit.setGeometry(QtCore.QRect(40, 230, 721, 241))
self.textEdit.setObjectName("textEdit")
self.progressBar = QtWidgets.QProgressBar(self.centralwidget)
self.progressBar.setGeometry(QtCore.QRect(40, 490, 721, 23))
self.progressBar.setObjectName("progressBar")
Form.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(Form)
self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 25))
self.menubar.setObjectName("menubar")
Form.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(Form)
self.statusbar.setObjectName("statusbar")
Form.setStatusBar(self.statusbar)
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
_translate = QtCore.QCoreApplication.translate
Form.setWindowTitle(_translate("Form", "MainWindow"))
self.pushButton_run.setText(_translate("Form", "RUN"))
Somehow I need to -instantly- inform the gui thread (from my running thread) that the progress bar value is changing (a process that could take up minutes to complete).
Define a custom signal that sends updates to the progress-bar:
class Form(QMainWindow):
finished = pyqtSignal()
updateProgress = pyqtSignal(int)
def __init__(self, parent=None):
super(Form, self).__init__(parent)
...
self.updateProgress.connect(self.ui.progressBar.setValue)
def run_test(self):
for i in range(100):
per = i + 1
self.updateProgress.emit(per)
...

PyQt5 QThread Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

i have a GUI with PyQt5. The GUI has a Form, 2 Buttons and a ProgressBar.
I want to implement a start/wait thread with QThread.
Unfortunately i get Process finished with exit code 139 (interrupted by signal 11: SIGSEGV) when i click Start button to run thread.
MainWindow.py
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'MainWindow.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(400, 138)
self.btnRun = QtWidgets.QPushButton(Form)
self.btnRun.setGeometry(QtCore.QRect(20, 20, 89, 25))
self.btnRun.setObjectName("btnRun")
self.btnStop = QtWidgets.QPushButton(Form)
self.btnStop.setGeometry(QtCore.QRect(20, 60, 89, 25))
self.btnStop.setObjectName("btnStop")
self.progressBar = QtWidgets.QProgressBar(Form)
self.progressBar.setGeometry(QtCore.QRect(20, 100, 371, 23))
self.progressBar.setProperty("value", 24)
self.progressBar.setObjectName("progressBar")
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
_translate = QtCore.QCoreApplication.translate
Form.setWindowTitle(_translate("Form", "Test Thread"))
self.btnRun.setText(_translate("Form", "Run"))
self.btnStop.setText(_translate("Form", "Stop"))
When i click the Start button the application crashes with segmentation fault.
Thread.py
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from MainWindow import *
import sys
import time
class MainWindow(QWidget, QThread):
def __init__(self, parent=None):
super(MainWindow, self).__init__(parent)
self.ui = Ui_Form()
self.ui.setupUi(self)
self.center()
#Init progressBar
self.ui.progressBar.setValue(0)
#Buttons
self.ui.btnRun.clicked.connect(self.start)
self.ui.btnStop.clicked.connect(self.wait)
def run(self):
count = 0
while count <= 100:
count += 1
self.ui.progressBar.setValue(count)
time.sleep(1)
def center(self):
# geometry of the main window
qr = self.frameGeometry()
# center point of screen
cp = QDesktopWidget().availableGeometry().center()
# move rectangle's center point to screen's center point
qr.moveCenter(cp)
# top left of rectangle becomes top left of window centering it
self.move(qr.topLeft())
if __name__ == '__main__':
app = QApplication(sys.argv)
app.setAttribute(Qt.AA_DontShowIconsInMenus, False)
w = MainWindow()
# Disable maximize window button
w.setWindowFlags(Qt.WindowCloseButtonHint | Qt.WindowMinimizeButtonHint)
w.show()
sys.exit(app.exec_())
The problem is that you cannot inherit from QWidget and QThread at the same time because:
Cannot inherit from 2 QObject, there is a conflict in behaviors.
PyQt limits multiple inheritance.
The solution is to use composition instead of multiple inheritance.
class Thread(QThread):
progressChanged = pyqtSignal(int)
def run(self):
count = 0
while count <= 100:
count += 1
self.progressChanged.emit(count)
time.sleep(1)
class MainWindow(QWidget):
def __init__(self, parent=None):
super(MainWindow, self).__init__(parent)
self.ui = Ui_Form()
self.ui.setupUi(self)
self.center()
self._custom_thread = Thread()
#Init progressBar
self.ui.progressBar.setValue(0)
#Buttons
self.ui.btnRun.clicked.connect(self._custom_thread.start)
self.ui.btnStop.clicked.connect(self._custom_thread.wait)
self._custom_thread.progressChanged.connect(self.ui.progressBar.setValue)

When I click the QpushButton, No change?

I use QT designer to design a page that contains two buttons, a start and an end, but when I click them, there is no response. I put them all in widgets, is that why?
I'm confused. When I click the start or end button,no Change!
PyQt5 When I click the QpushButton ,No change?
Is it because it's inside the widget?
My code is like this.
# -*- coding: utf-8 -*-
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(640, 480)
self.widget_6 = QtWidgets.QWidget(Form)
self.widget_6.setEnabled(True)
self.widget_6.setGeometry(QtCore.QRect(240, 250, 151, 68))
self.widget_6.setStyleSheet("background-color: rgb(230, 230, 230);")
self.widget_6.setObjectName("widget_6")
self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.widget_6)
self.verticalLayout_4.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_4.setObjectName("verticalLayout_4")
self.start_btn = QtWidgets.QPushButton(self.widget_6)
self.start_btn.setStyleSheet("")
self.start_btn.setObjectName("start_btn")
self.verticalLayout_4.addWidget(self.start_btn)
self.end_btn = QtWidgets.QPushButton(self.widget_6)
self.end_btn.setStyleSheet("")
self.end_btn.setObjectName("end_btn")
self.verticalLayout_4.addWidget(self.end_btn)
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
_translate = QtCore.QCoreApplication.translate
Form.setWindowTitle(_translate("Form", "Form"))
self.start_btn.setText(_translate("Form", "start"))
self.end_btn.setText(_translate("Form", "end"))
import sys
from PyQt5.Qt import QApplication, QWidget
class Sorter(QWidget, Ui_Form):
"""
demo
"""
def __init__(self, parent=None, *args, **kwargs):
"""
init
"""
super(Sorter, self).__init__(parent, *args, **kwargs)
self.setupUi(self)
if __name__ == "__main__":
app = QApplication(sys.argv)
myWin = Sorter()
myWin.show()
sys.exit(app.exec_())

How do I access outer class variables in inner class(PyQt)?

It is not a duplicate! I didn't want to make title really long, so it's short version may seem as a duplicate. The problem is a little bit bigger than in the title.
Environment: I'm trying to build painting app using PyQt5 and Qt-Designer. I've got three files in my project: main.py, slider.py, ui.py(UI from Qt-Designer generated by pyuic).
What do I need: I need to change App's brush size(self.variable) every time Slider value changes.
The problem itself: App Class inherits Ui_MainWindow Class from the file that I can't edit(it is generated every time). Ui_MainWindow sets Slider Class as its attribute. So basically Slider is App's attribute, and I need to change App's variable "canvas" while being in Slider Class.
I don't know how to access outer class variable in inner class method. Especially when I can't edit ui.py, so I could call Slider(self) instead of Slider(self.sidebar).
main.py
import sys
from PyQt5 import uic
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from ui import Ui_MainWindow
class App(QMainWindow, Ui_MainWindow):
def __init__(self):
super().__init__()
self.setupUi(self)
if __name__ == '__main__':
application = QApplication(sys.argv)
example = App()
example.show()
sys.exit(application.exec_())
slider.py
from PyQt5 import uic
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from functools import partial
import inspect
class Slider(QSlider):
def __init__(self, parent=None):
super().__init__(parent)
self.valueChanged.connect(self.valueChange)
self.setMinimum(8)
self.setMaximum(64)
self.setTickInterval(8)
def valueChange(self):
pass
# Here I need to change App.canvas, have no idea how to do it
ui.py
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'main.ui'
#
# Created by: PyQt5 UI code generator 5.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(912, 715)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.horizontalLayout = QtWidgets.QHBoxLayout(self.centralwidget)
self.horizontalLayout.setObjectName("horizontalLayout")
self.sidebar = QtWidgets.QWidget(self.centralwidget)
self.sidebar.setMinimumSize(QtCore.QSize(388, 0))
self.sidebar.setAutoFillBackground(True)
self.sidebar.setObjectName("sidebar")
self.clearButton = QtWidgets.QPushButton(self.sidebar)
self.clearButton.setGeometry(QtCore.QRect(20, 30, 91, 41))
self.clearButton.setObjectName("clearButton")
# This is where Slider is called
# The file is generated so I can't edit it
self.brushSizeSlider = Slider(self.sidebar)
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
self.brushSizeSlider.setGeometry(QtCore.QRect(20, 120, 160, 22))
self.brushSizeSlider.setOrientation(QtCore.Qt.Horizontal)
self.brushSizeSlider.setObjectName("brushSizeSlider")
self.brushSizeLabel = QtWidgets.QLabel(self.sidebar)
self.brushSizeLabel.setGeometry(QtCore.QRect(20, 90, 101, 16))
self.brushSizeLabel.setObjectName("brushSizeLabel")
self.brushColorDial = QtWidgets.QDial(self.sidebar)
self.brushColorDial.setGeometry(QtCore.QRect(20, 180, 50, 64))
self.brushColorDial.setObjectName("brushColorDial")
self.brushColorLabel = QtWidgets.QLabel(self.sidebar)
self.brushColorLabel.setGeometry(QtCore.QRect(20, 160, 101, 16))
self.brushColorLabel.setObjectName("brushColorLabel")
self.horizontalLayout.addWidget(self.sidebar)
self.canvas = Canvas(self.centralwidget)
self.canvas.setMinimumSize(QtCore.QSize(500, 500))
self.canvas.setMaximumSize(QtCore.QSize(5000, 5000))
self.canvas.setBaseSize(QtCore.QSize(500, 500))
self.canvas.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
self.canvas.setAutoFillBackground(True)
self.canvas.setStyleSheet("canvas{background-color: rgb(70, 70, 50);}")
self.canvas.setObjectName("canvas")
self.horizontalLayout.addWidget(self.canvas)
MainWindow.setCentralWidget(self.centralwidget)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
self.clearButton.setText(_translate("MainWindow", "Clear canvas"))
self.brushSizeLabel.setText(_translate("MainWindow", "Current brush size:"))
self.brushColorLabel.setText(_translate("MainWindow", "Current brush color:"))
from canvas import Canvas
from slider import Slider

Categories

Resources