19
19
# You should have received a copy of the GNU General Public License
20
20
# along with this program. If not, see <http://www.gnu.org/licenses/>.
21
21
22
- from PyQt5 import QtGui , QtCore
23
- from PyQt5 .QtCore import Qt
24
- from PyQt5 .QtGui import QColor , QFont
25
- from PyQt5 .QtWidgets import QWidget , QLabel , QVBoxLayout
22
+ from PyQt6 import QtGui , QtCore
23
+ from PyQt6 .QtCore import Qt
24
+ from PyQt6 .QtGui import QColor , QFont
25
+ from PyQt6 .QtWidgets import QWidget , QLabel , QVBoxLayout
26
26
from core .utils import get_local_ip , get_free_port , message_to_emacs
27
27
import subprocess
28
28
import os
@@ -52,8 +52,8 @@ def __init__(self, border, width, box_size):
52
52
self .width = width
53
53
self .box_size = box_size
54
54
size = (width + border * 2 ) * box_size
55
- self ._image = QtGui .QImage (size , size , QtGui .QImage .Format_RGB16 )
56
- self ._image .fill (QtCore .Qt .white )
55
+ self ._image = QtGui .QImage (size , size , QtGui .QImage .Format . Format_RGB16 )
56
+ self ._image .fill (QtCore .Qt .GlobalColor . white )
57
57
58
58
def pixmap (self ):
59
59
return QtGui .QPixmap .fromImage (self ._image )
@@ -64,7 +64,7 @@ def drawrect(self, row, col):
64
64
(col + self .border ) * self .box_size ,
65
65
(row + self .border ) * self .box_size ,
66
66
self .box_size , self .box_size ,
67
- QtCore .Qt .black )
67
+ QtCore .Qt .GlobalColor . black )
68
68
69
69
def save (self , stream , kind = None ):
70
70
pass
@@ -78,32 +78,32 @@ def __init__(self, url, background_color, foreground_color):
78
78
self .url = os .path .expanduser (url )
79
79
80
80
self .file_name_font = QFont ()
81
- self .file_name_font .setPointSize (24 )
81
+ self .file_name_font .setPointSize (48 )
82
82
83
83
self .file_name_label = QLabel ()
84
84
self .file_name_label .setText ("Your smartphone file will be shared at\n {0}" .format (url ))
85
85
self .file_name_label .setFont (self .file_name_font )
86
- self .file_name_label .setAlignment (Qt .AlignCenter )
86
+ self .file_name_label .setAlignment (Qt .AlignmentFlag . AlignCenter )
87
87
self .file_name_label .setStyleSheet ("color: {}" .format (foreground_color ))
88
88
89
89
self .qrcode_label = QLabel ()
90
90
91
91
self .notify_font = QFont ()
92
- self .notify_font .setPointSize (12 )
92
+ self .notify_font .setPointSize (24 )
93
93
self .notify_label = QLabel ()
94
94
self .notify_label .setText ("Scan the QR code above to upload a file from your smartphone.\n Make sure the smartphone is connected to the same WiFi network as this computer." )
95
95
self .notify_label .setFont (self .notify_font )
96
- self .notify_label .setAlignment (Qt .AlignCenter )
96
+ self .notify_label .setAlignment (Qt .AlignmentFlag . AlignCenter )
97
97
self .notify_label .setStyleSheet ("color: {}" .format (foreground_color ))
98
98
99
99
layout = QVBoxLayout (self )
100
100
layout .setContentsMargins (0 , 0 , 0 , 0 )
101
101
layout .addStretch ()
102
- layout .addWidget (self .qrcode_label , 0 , Qt .AlignCenter )
102
+ layout .addWidget (self .qrcode_label , 0 , Qt .AlignmentFlag . AlignCenter )
103
103
layout .addSpacing (20 )
104
- layout .addWidget (self .file_name_label , 0 , Qt .AlignCenter )
104
+ layout .addWidget (self .file_name_label , 0 , Qt .AlignmentFlag . AlignCenter )
105
105
layout .addSpacing (40 )
106
- layout .addWidget (self .notify_label , 0 , Qt .AlignCenter )
106
+ layout .addWidget (self .notify_label , 0 , Qt .AlignmentFlag . AlignCenter )
107
107
layout .addStretch ()
108
108
109
109
self .port = get_free_port ()
0 commit comments