首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏编码视界

    PySide6 GUI 编程(36):查看系统支持的字体及QFont的使用

    示例代码 from typing import List from PySide6.QtGui import QFont, QFontDatabase from PySide6.QtWidgets import fonts: tmp_label = QLabel(c.capitalize(), parent = self) tmp_label.setFont(QFont

    68633编辑于 2024-08-26
  • 来自专栏秃头程序员的Python知识库

    用python写一个自动关机程序,并打包成exe可执行程序!

    QtWidgets.QLabel(page) self.label.setGeometry(QtCore.QRect(60, 20, 120, 45)) self.label.setFont(QtGui.QFont ("Roman times",10,QtGui.QFont.Bold)) ` `创建一个文本标签和时间栏框 self.label2 = QtWidgets.QLabel(page) self.label2 self.label2.setFont(QtGui.QFont("Roman times",10,QtGui.QFont.Bold)) 创建一个日期时间文本框,QDateEdit表示添加日期文本框,QTimeEdit ("Roman times",14,QtGui.QFont.Bold)) self.setUI(page) page.show() 设置工具窗口中显示的部件文本信息 def setUI(self,page (QtCore.QRect(100, 55, 40, 51)) self.label2.setFont(QtGui.QFont("Roman times",10,QtGui.QFont.Bold

    1.6K20编辑于 2022-01-08
  • 来自专栏Linux驱动

    53.Qt-QPdfWriter绘制PDF,支持表单输出

    void mainWindow::pdfDrawForm(QPainter* paint,int y,int horzBorder,int row,int column,int unitHeight,QFont 30, 30, 30, 30)); QPainter* pPainter = new QPainter(pWriter); //Init Font QFont font[5]={QFont("宋体",26,60),QFont("宋体",26,61),QFont("宋体",26,QFont::Normal),QFont("宋体",26,QFont::Normal ),QFont("宋体",26,QFont::Normal)}; font[0].setPixelSize(86); font[1].setPixelSize(61);

    3.6K30发布于 2020-04-08
  • 来自专栏叶子陪你玩编程

    Python 单词测试1源代码

    QtWidgets.QLabel(Login) self.label.setGeometry(QtCore.QRect(10, 20, 451, 51)) font = QtGui.QFont (Login) self.pushButton_2.setGeometry(QtCore.QRect(320, 230, 121, 61)) font = QtGui.QFont Register) self.lineEdit_2.setGeometry(QtCore.QRect(180, 140, 281, 41)) font = QtGui.QFont Register) self.lineEdit_3.setGeometry(QtCore.QRect(180, 190, 281, 41)) font = QtGui.QFont Register) self.pushButton.setGeometry(QtCore.QRect(180, 260, 131, 61)) font = QtGui.QFont

    88720发布于 2021-09-15
  • 来自专栏编程创造城市

    Python高级进阶#005 pyqt5显示提示框

    利用模糊查找到我们需要的类所在的pyqt5中的位置 3.到程序中导入找到的类 显示框文字样式设置: 1.需要导入QToolTip类库 2.通过QToolTip 的setFont方法设置文字样式 3.需要导入QFont 类库 4.实例化QFont类进行文字样式设置 5.这个显示样式的设置是在全局样式中呈现效果的 四、总结强调 1.掌握基础pyqt5代码gui编写 2.掌握显示框设置setToolTip函数 3.掌握显示框文字样式设置 from PyQt5.QtWidgets import QApplication,QWidget,QPushButton,QToolTip from PyQt5.QtGui import QIcon,QFont btn.move(50,50) btn.setToolTip("您好,刘金玉") w.resize(400,300) w.show() QToolTip.setFont(QFont

    3.2K30发布于 2019-10-15
  • 来自专栏米扑专栏

    Qt中中文处理的简单方法

    1 #include <qapplication.h>  2 #include <qpushbutton.h>  3 #include <qfont.h>  4 #include <qvbox.h>       QVBox box; 13     box.resize(200,120); 14     QPushButton quit("退出",&box); 15     quit.setFont( QFont ( "Times", 18, QFont::Bold ) ); 16     QObject::connect(&quit,SIGNAL(clicked()),&a,SLOT(quit())); 17     1 #include <qapplication.h>  2 #include <qpushbutton.h>  3 #include <qfont.h>  4 #include <qvbox.h>   ; 13     box.resize(200,120); 14     QPushButton quit(QObject::tr("退出"),&box); 15     quit.setFont( QFont

    1.6K20发布于 2019-02-19
  • 来自专栏叶子陪你玩编程

    python GUI界面设计的那些事(三)

    self.centralwidget) self.label.setGeometry(QtCore.QRect(10, 170, 60, 25)) font = QtGui.QFont self.centralwidget) self.label_2.setGeometry(QtCore.QRect(180, 170, 60, 25)) font = QtGui.QFont self.centralwidget) self.pushButton.setGeometry(QtCore.QRect(270, 50, 100, 25)) font = QtGui.QFont self.centralwidget) self.pushButton_2.setGeometry(QtCore.QRect(270, 90, 100, 25)) font = QtGui.QFont self.centralwidget) self.comboBox.setGeometry(QtCore.QRect(270, 130, 100, 25)) font = QtGui.QFont

    2.2K20发布于 2021-04-13
  • 来自专栏简书专栏

    基于python+PyQt5的Google身份验证器

    digest[index:index+4])[0] & 0x7fffffff) % 1000000 return "%06d" %googleCode from PyQt5.QtGui import QFont QLineEdit(Form) self.lineEdit_secretKey.setGeometry(QRect(180, 40, 190, 40)) font = QFont self.label_2 = QLabel(Form) self.label_2.setGeometry(QRect(20, 100, 170, 40)) font = QFont self.label_3 = QLabel(Form) self.label_3.setGeometry(QRect(30, 160, 140, 40)) font = QFont = QPushButton(Form) self.pushButton_2.setGeometry(QRect(230, 240, 140, 50)) font = QFont

    1.8K20发布于 2019-03-06
  • 来自专栏Python编程 pyqt matplotlib

    PyQt5 单行Rich文本编辑器

    import sys import html from PyQt5.QtCore import QSize, Qt,pyqtSignal from PyQt5.QtGui import QColor, QFont self.setFontUnderline(not self.fontUnderline()) def toggleBold(self): self.setFontWeight(QFont.Normal if self.fontWeight() > QFont.Normal else QFont.Bold) def sizeHint(self): in ( ("&Bold", "Ctrl+B", RichTextLineEdit.Bold, self.fontWeight() > QFont.Normal text = "{0}".format(text) if format.fontWeight() > QFont.Normal

    1.2K30发布于 2019-08-14
  • 来自专栏叶子陪你玩编程

    python-无聊的知识大闯关

    self.centralwidget) self.label.setGeometry(QtCore.QRect(20, 10, 541, 61)) font = QtGui.QFont self.centralwidget) self.label_2.setGeometry(QtCore.QRect(70, 100, 451, 41)) font = QtGui.QFont self.centralwidget) self.lineEdit.setGeometry(QtCore.QRect(70, 160, 461, 61)) font = QtGui.QFont self.centralwidget) self.pushButton.setGeometry(QtCore.QRect(70, 240, 91, 41)) font = QtGui.QFont

    35410发布于 2021-12-01
  • 来自专栏全栈程序员必看

    PyQt5高级界面控件之QTableWidget(四)

    ,添加到表格指定行列中 # newItem = QTableWidgetItem("男") # newItem.setFont(QFont('Times', 12, QFont.Black ('Times', 12, QFont.Black)) # tableWidget.setItem(1, 2, newItem) # # newItem = QTableWidgetItem("王五") # #将字体加粗,黑色字体 # newItem.setFont(QFont('Times',12,QFont.Black ('Times', 12, QFont.Black)) # tableWidget.setItem(2, 1, newItem) # # # 创建新条目, 设置背景颜色,添加到表格指定行列中 # newItem = QTableWidgetItem("175") # newItem.setFont(QFont('Times'

    6.6K10编辑于 2022-08-18
  • 来自专栏嵌入式项目开发

    QT应用编程: Qt数据类型和(ActiveX)COM接口数据类型对应关系

    int double double qlonglong CY qulonglong CY QColor OLE_COLOR QDate DATE QDateTime DATE QTime DATE QFont & [in] DATE QDate& [in, out] DATE* QDateTime, const QDateTime& [in] DATE QDateTime& [in, out] DATE* QFont , const QFont& [in] IFontDisp* QFont& [in, out] IFontDisp** QPixmap, const QPixmap& [in] IPictureDisp

    1.3K30编辑于 2022-01-07
  • 来自专栏编码视界

    PySide6 GUI 编程(44):异步执行 QRunnable 与 QThreadPool

    time from datetime import datetime from PySide6.QtCore import Qt, QTimer from PySide6.QtGui import QFont datetime from PySide6.QtCore import QRunnable, Qt, QThreadPool, QTimer, Slot from PySide6.QtGui import QFont import datetime from PySide6.QtCore import Qt, QThreadPool, QTimer, Slot from PySide6.QtGui import QFont import datetime from PySide6.QtCore import Qt, QThreadPool, QTimer, Slot from PySide6.QtGui import QFont randint from PySide6.QtCore import QRunnable, Qt, QThreadPool, QTimer, Slot from PySide6.QtGui import QFont

    1.2K76编辑于 2024-09-16
  • 来自专栏Yunfeng's Simple Blog

    PyQt5 代码片段集合

    QMainWindow,QWidget, QPushButton, QAction, QSplitter, QFrame) from PyQt5.QtGui import QIcon, QFont if __name__ == '__main__': app = QApplication(sys.argv) #app.setFont(QFont("Consolas", 10)) False) btn.SetText("Open") btn.setStyleSheet('{background-color: #A3C1DA; color: red;}') lbl.setFont(QFont QLabel() lbl.setText('Information') lbl.setText("Information") lbl.setFont(QFont

    87430发布于 2019-12-25
  • 来自专栏嵌入式音视频

    04 qt功能类、对话框类和文件操作

    QFontDialog::getFont(bool *ok, const QFont &initial, QWidget *parent = nullptr, const QString &title = QString(), QFontDialog::FontDialogOptions options = FontDialogOptions()) 功能:得到一个字体对象(QFont) 参数说明 : 参数一:bool *ok ----> 对获得字体结果,成功返回true,否则,返回 false 参数二:const QFont &initial ----> 初始化字体 参数三:QWidget *parent (字体) 通过结合函数setFont来给一个控件设置一个字体 bool ok; QFont font = QFontDialog::getFont(&ok, QFont("Times", 12), 案例:给一个控件设置字体 void FontDialogWin::on_fontSetButton_clicked() { //[1] 打开对话框 bool ok; QFont

    52410编辑于 2023-10-15
  • 来自专栏Michael阿明学习之路

    PyQt5 基本窗口控件(绘图类 / 拖拽 / 剪贴板 / 日历时间 / 菜单、工具、状态栏 / 打印)

    Author : Michael # @File : painter1.py # @desc : import sys from PyQt5.QtGui import QPainter, QColor, QFont self, event, painter): painter.setPen(QColor(168, 150, 3)) # 设置画笔颜色 painter.setFont(QFont File : qbrush_demo.py # @desc : import sys from PyQt5.QtGui import QPainter, QPen, QBrush, QColor, QFont painter.drawRect(130, 15, 90, 60) painter.setPen(QColor(168, 150, 3)) painter.setFont(QFont painter.drawRect(250, 15, 90, 60) painter.setPen(QColor(168, 150, 3)) painter.setFont(QFont

    2.5K22编辑于 2022-05-10
  • 来自专栏用户2442861的专栏

    PyQT 入门(1):程序基础框架

    QLabel 标签组件:显示内容  QTimer定时组件:完成时间调度任务 ---- 扩展知识: ---- QLabel是一种经常使用的的组件,下面的程序提供了更多的关于QLabel用法 主要涉及模块:QFont app = QApplication(sys.argv) font = QFont("Times New Rome", 36, QFont.Bold) fm = QFontMetrics(font

    69510发布于 2018-09-20
  • 来自专栏Qt项目实战

    Qt编写自定义控件30-颜色多态按钮

    setShowSuperText) Q_PROPERTY(QString superText READ getSuperText WRITE setSuperText) Q_PROPERTY(QFont ; //边框颜色 bool showSuperText; //显示角标 QString superText; //角标文字 QFont getSuperTextAlign()const; QColor getSuperTextColor() const; QString getText() const; QFont 设置角标文字 void setSuperText(const QString &superText); //设置角标文字字体 void setSuperTextFont(const QFont superTextColor); //设置文字 void setText(const QString &text); //设置文字字体 void setTextFont(const QFont

    2.8K40发布于 2019-08-27
  • 来自专栏Python编程 pyqt matplotlib

    PyQt5 非模态对话框(live 型)

    import sys from PyQt5.QtCore import Qt, pyqtSignal from PyQt5.QtGui import QFont from PyQt5.QtWidgets self.setWindowTitle("非模态对话框") #self.setFixedSize(self.width(), 100)#固定窗口大小 self.labelFont = QFont self.format["fontsize"] = fontsize self.format["fonteffect"] = fonteffect self.labelFont = QFont

    1.8K20发布于 2019-08-14
  • 来自专栏嵌入式项目开发

    QT应用编程: QGraphicsView绘制图片作为背景

    ."); textItem->setFont(QFont("华文琥珀",12)); textItem->setDefaultTextColor(Qt::red); //设置字体颜色 win10 QT5.12.6 MinGW32 功能: 选择字体 */ void Widget::on_pushButton_setfont_clicked() { bool ok; QFont font=QFontDialog::getFont(&ok, QFont("幼圆", 12),this,tr("字体选择")); if(ok) //用户点击的了确定按钮 {

    3.2K11编辑于 2022-01-07
领券