Port to pyqt5

This commit is contained in:
Lukas 2021-01-16 17:45:02 +01:00
parent 97d20bf29d
commit 52089a068b
3 changed files with 20 additions and 46 deletions

View File

@ -1,37 +1,26 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'C:\Users\lmahler\Desktop\Dump\02_Python\Grail\fillscreen.ui'
# Form implementation generated from reading ui file 'C:\Users\lukas\Desktop\Dump\018_Git\Grail\fillscreen.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
# Created by: PyQt5 UI code generator 5.15.2
#
# WARNING! All changes made in this file will be lost!
# 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 PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
from PyQt5 import QtCore, QtGui, QtWidgets
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig)
class Ui_View(object):
def setupUi(self, View):
View.setObjectName(_fromUtf8("View"))
View.setObjectName("View")
View.resize(294, 166)
View.setWindowOpacity(0.3)
View.setStyleSheet(_fromUtf8(""))
View.setStyleSheet("")
self.retranslateUi(View)
QtCore.QMetaObject.connectSlotsByName(View)
def retranslateUi(self, View):
View.setWindowTitle(_translate("View", "Grail.exe", None))
_translate = QtCore.QCoreApplication.translate
View.setWindowTitle(_translate("View", "Grail.exe"))

View File

@ -1,18 +1,3 @@
"""
#*********************************#
#* Grail *#
#*********************************#
#* Author: Lukas Mahler *#
#* Copyright: (C)2018-2021 *#
#* Version: 0.5.1 *#
#* Date: 16.01.2021 *#
#*********************************#
# Instant Upload Screenshot-Tool #
# based on the idea of Gyazoo. #
# -> MS Windows only! #
#*********************************#
"""
__author__ = "Lukas Mahler"
__copyright__ = "Copyright 2018-2021"
__version__ = "0.5.1"
@ -35,8 +20,8 @@ try:
from time import gmtime, strftime, sleep
# GUI
from PyQt4 import QtGui, QtCore, Qt
from PyQt4.QtCore import QProcess, QPoint
from PyQt5 import QtGui, QtWidgets, QtCore, Qt
from PyQt5.QtCore import QProcess, QPoint
from fillscreen import Ui_View
# Customs
@ -56,10 +41,10 @@ except ImportError as e:
###################################################################################################
class Fillscreen(QtGui.QWidget, Ui_View):
class Fillscreen(QtWidgets.QWidget, Ui_View):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
QtWidgets.QWidget.__init__(self, parent)
###############################################################################################
###############################################################################################
@ -131,7 +116,7 @@ class Fillscreen(QtGui.QWidget, Ui_View):
@staticmethod
def change_cursor():
# http://doc.qt.io/archives/qt-4.8/qcursor.html
QtGui.QApplication.setOverrideCursor(QtCore.Qt.CrossCursor)
QtWidgets.QApplication.setOverrideCursor(QtCore.Qt.CrossCursor)
# QtGui.QApplication.restoreOverrideCursor()
@ -173,7 +158,7 @@ def read_ini(rootdir):
pth = config.get('ONLINE', 'PTH')
where = config.get('ONLINE', 'WHERE')
myini.update(
mode = mode,
MODE = mode,
URL = url,
PORT = port,
TIMEOUT = timeout,
@ -185,7 +170,7 @@ def read_ini(rootdir):
elif mode == "OFFLINE":
where = config.get('OFFLINE', 'WHERE')
myini.update(
mode = mode,
MODE = mode,
WHERE = where
)
else:
@ -373,12 +358,12 @@ if __name__ == '__main__':
os.remove(root+"qt.conf")
except Exception as e:
print("DEBUG:", e)
app = QtGui.QApplication(sys.argv)
app = QtWidgets.QApplication(sys.argv)
windows = []
# https://stackoverflow.com/questions/51058236/create-qt-windows-based-on-number-of-list-items
for i in range(QtGui.QApplication.desktop().screenCount()):
topLeft = QtGui.QApplication.desktop().screenGeometry(i).topLeft()
for i in range(QtWidgets.QApplication.desktop().screenCount()):
topLeft = QtWidgets.QApplication.desktop().screenGeometry(i).topLeft()
window = Fillscreen()
window.move(topLeft)
window.showFullscreen()

View File

@ -4,7 +4,7 @@ This subfile to Grail handles window settings and calculations.
"""
__author__ = "Lukas Mahler"
__copyright__ = "Copyright 2018-2020"
__copyright__ = "Copyright 2018-2021"
__version__ = "1.0.0"
__date__ = "25.11.2020"
__email__ = "lm@ankerlab.de"