• 大小: 3.53M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2024-06-21
  • 语言: Python
  • 标签: PyQt5  Qt5  py  Qt  项目  

资源简介

15个pyqt5项目实例源码

资源截图

代码片段和文件信息

from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtWebEngineWidgets import *
from PyQt5.QtPrintSupport import *

import os
import sys


class AboutDialog(QDialog):
    def __init__(self *args **kwargs):
        super(AboutDialog self).__init__(*args **kwargs)

        QBtn = QDialogButtonBox.Ok  # No cancel
        self.buttonBox = QDialogButtonBox(QBtn)
        self.buttonBox.accepted.connect(self.accept)
        self.buttonBox.rejected.connect(self.reject)

        layout = QVBoxLayout()

        title = QLabel(“MooseAche“)
        font = title.font()
        font.setPointSize(20)
        title.setFont(font)

        layout.addWidget(title)

        logo = QLabel()
        logo.setPixmap(QPixmap(os.path.join(‘images‘ ‘ma-icon-128.png‘)))
        layout.addWidget(logo)

        layout.addWidget(QLabel(“Version 23.35.211.233232“))
        layout.addWidget(QLabel(“Copyright 2015 MooseAche Inc.“))

        for i in range(0 layout.count()):
            layout.itemAt(i).setAlignment(Qt.AlignHCenter)

        layout.addWidget(self.buttonBox)

        self.setLayout(layout)


class MainWindow(QMainWindow):
    def __init__(self *args **kwargs):
        super(MainWindow self).__init__(*args **kwargs)

        self.browser = QWebEngineView()
        self.browser.setUrl(QUrl(“http://google.com“))

        self.browser.urlChanged.connect(self.update_urlbar)
        self.browser.loadFinished.connect(self.update_title)
        self.setCentralWidget(self.browser)

        self.status = QStatusBar()
        self.setStatusBar(self.status)

        navtb = QToolBar(“Navigation“)
        navtb.setIconSize(QSize(16 16))
        self.addToolBar(navtb)

        back_btn = QAction(QIcon(os.path.join(‘images‘ ‘arrow-180.png‘)) “Back“ self)
        back_btn.setStatusTip(“Back to previous page“)
        back_btn.triggered.connect(self.browser.back)
        navtb.addAction(back_btn)

        next_btn = QAction(QIcon(os.path.join(‘images‘ ‘arrow-000.png‘)) “Forward“ self)
        next_btn.setStatusTip(“Forward to next page“)
        next_btn.triggered.connect(self.browser.forward)
        navtb.addAction(next_btn)

        reload_btn = QAction(QIcon(os.path.join(‘images‘ ‘arrow-circle-315.png‘)) “Reload“ self)
        reload_btn.setStatusTip(“Reload page“)
        reload_btn.triggered.connect(self.browser.reload)
        navtb.addAction(reload_btn)

        home_btn = QAction(QIcon(os.path.join(‘images‘ ‘home.png‘)) “Home“ self)
        home_btn.setStatusTip(“Go home“)
        home_btn.triggered.connect(self.navigate_home)
        navtb.addAction(home_btn)

        navtb.addSeparator()

        self.httpsicon = QLabel()  # Yes really!
        self.httpsicon.setPixmap(QPixmap(os.path.join(‘images‘ ‘lock-nossl.png‘)))
        navtb.addWidget(self.httpsicon)

        self.urlbar = QLineEdit()
        self.urlbar.returnPressed.connect(self.navigate_to_url)
        navtb.addWidget(self.urlbar)

        stop_

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2021-11-12 12:17  15-minute-apps-master\
     文件         814  2021-11-12 12:17  15-minute-apps-master\.gitignore
     文件        1058  2021-11-12 12:17  15-minute-apps-master\LICENSE
     文件        2653  2021-11-12 12:17  15-minute-apps-master\README.md
     目录           0  2021-11-12 12:17  15-minute-apps-master\browser\
     文件         681  2021-11-12 12:17  15-minute-apps-master\browser\README.md
     文件        7098  2021-11-12 12:17  15-minute-apps-master\browser\browser.py
     目录           0  2021-11-12 12:17  15-minute-apps-master\browser\images\
     文件         615  2021-11-12 12:17  15-minute-apps-master\browser\images\arrow-000.png
     文件         589  2021-11-12 12:17  15-minute-apps-master\browser\images\arrow-180.png
     文件         829  2021-11-12 12:17  15-minute-apps-master\browser\images\arrow-circle-315.png
     文件         729  2021-11-12 12:17  15-minute-apps-master\browser\images\cross-circle.png
     文件        2237  2021-11-12 12:17  15-minute-apps-master\browser\images\cross.png
     文件         621  2021-11-12 12:17  15-minute-apps-master\browser\images\disk--arrow.png
     文件         677  2021-11-12 12:17  15-minute-apps-master\browser\images\disk--pencil.png
     文件         752  2021-11-12 12:17  15-minute-apps-master\browser\images\home.png
     文件         902  2021-11-12 12:17  15-minute-apps-master\browser\images\lifebuoy.png
     文件         694  2021-11-12 12:17  15-minute-apps-master\browser\images\lock-nossl.png
     文件        1622  2021-11-12 12:17  15-minute-apps-master\browser\images\lock-ssl.png
     文件       17778  2021-11-12 12:17  15-minute-apps-master\browser\images\ma-icon-128.png
     文件       48868  2021-11-12 12:17  15-minute-apps-master\browser\images\ma-icon-256.png
     文件        6281  2021-11-12 12:17  15-minute-apps-master\browser\images\ma-icon-64.png
     文件         715  2021-11-12 12:17  15-minute-apps-master\browser\images\printer.png
     文件         766  2021-11-12 12:17  15-minute-apps-master\browser\images\question.png
     文件         489  2021-11-12 12:17  15-minute-apps-master\browser\images\ui-tab--plus.png
     文件          15  2021-11-12 12:17  15-minute-apps-master\browser\requirements.txt
     文件       42174  2021-11-12 12:17  15-minute-apps-master\browser\screenshot-browser.jpg
     目录           0  2021-11-12 12:17  15-minute-apps-master\browser_tabbed\
     文件        1126  2021-11-12 12:17  15-minute-apps-master\browser_tabbed\README.md
     文件        9265  2021-11-12 12:17  15-minute-apps-master\browser_tabbed\browser_tabbed.py
     目录           0  2021-11-12 12:17  15-minute-apps-master\browser_tabbed\images\
............此处省略312个文件信息

评论

共有 条评论