
pyQT
rosefunR
每次都多付出一点. 欢迎关注公众号《机器学习与算法之道》
-
原创 pyqt5 label等文字字体设置
1、代码passwdLabel.setFont(QFont("Microsoft YaHei"))设置文字的颜色:lineEdit.setStyleSheet("color:red");//文本颜色 lineEdit.setStyleSheet("background-color:red");//背景色 参考: 1.Qt 设置文本颜色字体...2018-03-07 22:23:0823674
0
-
原创 PyQt5 设置背景图片和logo
1、代码 def setIcon(self): palette1 = QPalette() # palette1.setColor(self.backgroundRole(), QColor(192,253,123)) # 设置背景颜色 palette1.setBrush(self.backgroundRole(), QBrush(...2018-03-07 22:16:0115059
0
-
原创 pyqt5 导入.ui .qrc文件格式的方法
1、导入.ui格式首先,代开cmd到.ui文件的位置,然后使用一下命令把.ui 格式转换成 .py 格式pyuic5 -x MyWidget.ui -o MyWidget.py2、导入 .qrc格式同理,类似只是代码是:Pyrcc5 input_file.qrc -o Out_file.py...2018-03-07 15:48:012474
0
-
原创 PyQt5 -标准输入框QInputDialog
1、代码from PyQt5 import QtWidgetsfrom PyQt5.QtWidgets import QLineEdit,QInputDialogclass MyWindow(QtWidgets.QWidget): def __init__(self): super(MyWindow,self).__init__() self....2018-03-07 15:16:502112
0
-
原创 pyqt5 编写编辑fruit简单界面(5)
1、代码#!/usr/bin/env python# Copyright (c) 2007-8 Qtrac Ltd. All rights reserved.# This program or module is free software: you can redistribute it and/or# modify it under the terms of the GNU Ge...2018-03-07 11:28:13497
0
-
原创 pyqt5 编程 复利计算器的编写(4)
1、代码from PyQt5.QtGui import *from PyQt5.QtCore import *from PyQt5.QtWidgets import *import sysclass Form(QDialog): """docstring for """ def __init__(self, parent=None): super(...2018-03-06 13:53:08864
0
-
原创 pyqt5 各模块介绍
1、模块PyQt5的类被分成了多个模块,包括下面的:QtCoreQtGuiQtWidgetsQtMultimediaQtBluetoothQtNetworkQtPositioningEnginioQtWebSocketsQtWebKitQtWebKitWidgetsQtXmlQtSvgQtSqlQtTestQtCore模块包含核心的非GUI功能。该...2018-03-05 10:30:044575
0
-
原创 pyqt交互界面实现 贝叶斯自动检查单词的实现(3)
1、代码checkword.pyimport re,collectionsdef words(text): return re.findall('[a-z]+', text.lower()) def train(features): model = collections.defaultdict(lambda: 1) for f in features: ...2018-03-05 09:57:26306
0
-
原创 pyqt5 计算器编写(2)
1、代码#!/usr/bin/env python# Copyright (c) 2007-8 Qtrac Ltd. All rights reserved.# This program or module is free software: you can redistribute it and/or# modify it under the terms of the GNU Ge...2018-03-04 22:05:021164
0
-
原创 pyqt5 第一个人机交互界面 弹出式闹钟(1)
1.代码#!/usr/bin/env python# Copyright (c) 2007-8 Qtrac Ltd. All rights reserved.# This program or module is free software: you can redistribute it and/or# modify it under the terms of the GNU Ge...2018-03-04 21:46:091472
0
-
原创 Pyqt5运行pyqt4各种错误解决方法汇总
1.NameError: name 'QApplication' is not definedfrom PyQt5.QtWidgets import QApplication2.NameError: name 'QLabel' is not definedfrom PyQt5.QtWidgets import *3.NameError: name 'QDialog' is ...2018-03-04 21:43:278595
0