From 132d20d698c05c6451615aa9c66561e39510d84a Mon Sep 17 00:00:00 2001
From: Dmitri Bogomolov <4glitch@gmail.com>
Date: Mon, 19 Feb 2018 14:38:25 +0200
Subject: [PATCH] Changes for pyside: customwidgets in ui-files and
QtGui.QPen instantiation
---
src/bitmessageqt/__init__.py | 4 +---
src/bitmessageqt/addressvalidator.py | 2 +-
src/bitmessageqt/blacklist.ui | 2 +-
src/bitmessageqt/networkstatus.ui | 2 +-
src/qidenticon.py | 5 +++--
5 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py
index 96eced5b..43d24a19 100644
--- a/src/bitmessageqt/__init__.py
+++ b/src/bitmessageqt/__init__.py
@@ -1732,11 +1732,9 @@ class MyForm(settingsmixin.SMainWindow):
fontMetrics = QtGui.QFontMetrics(font)
rect = fontMetrics.boundingRect(txt)
# draw text
- # painter = QtGui.QPainter(self)
painter = QtGui.QPainter()
painter.begin(pixmap)
- painter.setPen(
- QtGui.QPen(QtGui.QColor(255, 0, 0), QtCore.Qt.SolidPattern))
+ painter.setPen(QtGui.QPen(QtGui.QColor(255, 0, 0)))
painter.setFont(font)
painter.drawText(24-rect.right()-marginX, -rect.top()+marginY, txt)
painter.end()
diff --git a/src/bitmessageqt/addressvalidator.py b/src/bitmessageqt/addressvalidator.py
index 00bf5b13..c2fc9614 100644
--- a/src/bitmessageqt/addressvalidator.py
+++ b/src/bitmessageqt/addressvalidator.py
@@ -10,7 +10,7 @@ from utils import str_chan
from debug import logger
-class AddressPassPhraseValidatorMixin():
+class AddressPassPhraseValidatorMixin(object):
def setParams(
self, passPhraseObject=None, addressObject=None,
feedBackObject=None, buttonBox=None, addressMandatory=True
diff --git a/src/bitmessageqt/blacklist.ui b/src/bitmessageqt/blacklist.ui
index 80993fac..3068a6ae 100644
--- a/src/bitmessageqt/blacklist.ui
+++ b/src/bitmessageqt/blacklist.ui
@@ -98,7 +98,7 @@
STableWidget
QTableWidget
- bitmessageqt/settingsmixin.h
+ bitmessageqt.settingsmixin
diff --git a/src/bitmessageqt/networkstatus.ui b/src/bitmessageqt/networkstatus.ui
index e0c01b57..14aeca6e 100644
--- a/src/bitmessageqt/networkstatus.ui
+++ b/src/bitmessageqt/networkstatus.ui
@@ -296,7 +296,7 @@
STableWidget
QTableWidget
- bitmessageqt/settingsmixin.h
+ bitmessageqt.settingsmixin
diff --git a/src/qidenticon.py b/src/qidenticon.py
index 3083fa84..a4ac0ed4 100644
--- a/src/qidenticon.py
+++ b/src/qidenticon.py
@@ -133,11 +133,12 @@ class IdenticonRendererBase(object):
QtCore.QPointF(size, size), QtCore.QPointF(0., size)]
rotation = [0, 90, 180, 270]
- nopen = QtGui.QPen(foreColor, QtCore.Qt.NoPen)
+ nopen = QtGui.QPen(foreColor)
+ nopen.setStyle(QtCore.Qt.NoPen)
foreBrush = QtGui.QBrush(foreColor, QtCore.Qt.SolidPattern)
if penwidth > 0:
pen_color = QtGui.QColor(255, 255, 255)
- pen = QtGui.QPen(pen_color, QtCore.Qt.SolidPattern)
+ pen = QtGui.QPen(pen_color)
pen.setWidth(penwidth)
painter = QtGui.QPainter()