All Projects → iamywang → SimPyWeb-X

iamywang / SimPyWeb-X

Licence: MIT License
利用Python实现的基于Qt5的简易网页浏览器。

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to SimPyWeb-X

erk
Ərk is an open source, cross-platform IRC client written in Python 3, Qt 5, and Twisted.
Stars: ✭ 21 (+23.53%)
Mutual labels:  pyqt5
Python-Mp3Mp4-Downloader
Music and video downloader, Made with love by Bryan Herrera
Stars: ✭ 95 (+458.82%)
Mutual labels:  pyqt5
eddy
A graphical editor for the specification and visualization of Graphol ontologies
Stars: ✭ 24 (+41.18%)
Mutual labels:  pyqt5
modern-login
A simple login form built with PyQt 5
Stars: ✭ 35 (+105.88%)
Mutual labels:  pyqt5
PyQt practice
通过可直接运行的代码示例讲解 PyQt 5 常用基础控件。附学习资源、demo分享。
Stars: ✭ 285 (+1576.47%)
Mutual labels:  pyqt5
NetAssist PyQt
一个用PyQt5实现的网络调试助手工具。TCP UDP WebServer三种模式
Stars: ✭ 26 (+52.94%)
Mutual labels:  pyqt5
SciPlot-PyQt
A Matplotlib-wrapped user-interface for creating and editing publication-ready images and plots
Stars: ✭ 32 (+88.24%)
Mutual labels:  pyqt5
PyQt-Sqlite-Project-CURD
Pyqt SQLite Project Have Features like Login, Add, Delete, Search, Update, Show the Students. In this, I show all the CURD operations of the Program. All Project is well represented and with interactive Toolbar & Menu bar. The database is included in the repository.
Stars: ✭ 41 (+141.18%)
Mutual labels:  pyqt5
kodacad
A simple Python 3D CAD application
Stars: ✭ 14 (-17.65%)
Mutual labels:  pyqt5
http-rider
Simple and Powerful desktop client for working with JSON APIs
Stars: ✭ 27 (+58.82%)
Mutual labels:  pyqt5
BabyBrowser
A Small Web Browser Built in Python
Stars: ✭ 21 (+23.53%)
Mutual labels:  pyqt5
voce-browser
Voice Controlled Chromium Web Browser
Stars: ✭ 34 (+100%)
Mutual labels:  pyqt5
vasisualy
Vasisualy it's a simple Russian voice assistant written on Python for GNU/Linux, Windows and Android.
Stars: ✭ 33 (+94.12%)
Mutual labels:  pyqt5
deen
Generic data DEcoding/ENcoding application built with PyQt5.
Stars: ✭ 45 (+164.71%)
Mutual labels:  pyqt5
QtExamples
Translations of the official Qt examples into PyQt5 (also PySide2) and more.
Stars: ✭ 39 (+129.41%)
Mutual labels:  pyqt5
utils-for-python
small utils for python
Stars: ✭ 45 (+164.71%)
Mutual labels:  pyqt5
pyqt-resources
Tips and code snippets for PyQt developers
Stars: ✭ 26 (+52.94%)
Mutual labels:  pyqt5
Jamscreenshot
一个用python实现的类似微信QQ截屏的工具源码,整合提取自本人自制工具集Jamtools
Stars: ✭ 23 (+35.29%)
Mutual labels:  pyqt5
admbrowser
A Web browser for kiosks and digital signage, based on Python, PyQt, and Blink
Stars: ✭ 25 (+47.06%)
Mutual labels:  pyqt5
algobot
Cryptocurrency trading bot with a graphical user interface with support for simulations, backtests, optimizations, and running live bots.
Stars: ✭ 776 (+4464.71%)
Mutual labels:  pyqt5

SimPyWeb X —— 使用PyQt5以及QWebEngineView构建网页浏览器

更新说明

2020.1.26 SimPyWeb X 3.0 诈尸更新,多处修改

运行方式

  • shell 脚本直接运行
python __init__.py
  • 打包运行(可选择PyInstaller打包)

https://blog.csdn.net/creeperone/article/details/80957954

效果图

功能设计

主窗体绘制

  • 程序的init函数为启动函数,通过设定窗体的大小,标题,图标等等可以实现窗体的绘制。
def __init__(self, *args, **kwargs):
    super().__init__(*args, **kwargs)
    # 窗体
    self.setWindowTitle(self.name + self.version)
    self.setWindowIcon(QIcon('Assets/main.png'))
    self.resize(1200, 800)
    # 浏览器窗体
    self.browser = QWebEngineView()
    self.browser.load(QUrl("http://www.hao123.com/"))
    self.setCentralWidget(self.browser)

工具条实现

  • 工具条实现
# 工具条
navigation_bar = QToolBar('Navigation')
navigation_bar.setIconSize(QSize(32, 32))
self.addToolBar(navigation_bar)
  • 工具条按钮以及地址栏
# 后退按钮
back_button = QAction(QIcon('Assets/back.png'), '后退', self)
# 其他组件
self.url_text_bar = QLineEdit()
  • 将组件添加到工具条
navigation_bar.addAction(home_button)
navigation_bar.addSeparator()
navigation_bar.addWidget(self.url_text_bar)
  • 工具条按钮触发事件
# 事件触发
back_button.triggered.connect(self.browser.back)
  • 获取网页标题
def renew_title(self, s):
    self.setWindowTitle(self.name + self.version + " -- " + s)
  • 获取网页图标
def renew_icon(self, ico):
    self.setWindowIcon(ico)
  • 导向地址栏地址
def navigate_to_url(self):
    s = QUrl(self.url_text_bar.text())
    if s.scheme() == '':
        s.setScheme('http')
    self.browser.load(s)
  • 地址栏重新操作
def renew_urlbar(self, s):
    self.url_text_bar.setText(s.toString())
    self.url_text_bar.setCursorPosition(0)
  • 进度条设置
    def renew_progress_bar(self, p):
        self.progress_bar.setValue(p)

多标签页功能的实现

  • 添加标签
    def add_new_tab(self, tab):
        i = self.tabs.addTab(tab, "")
        self.tabs.setCurrentIndex(i)
        tab.back_button.triggered.connect(tab.browser.back)
        tab.next_button.triggered.connect(tab.browser.forward)
        tab.stop_button.triggered.connect(tab.browser.stop)
        tab.refresh_button.triggered.connect(tab.browser.reload)
        tab.home_button.triggered.connect(tab.navigate_to_home)
        tab.enter_button.triggered.connect(tab.navigate_to_url)
        tab.add_button.triggered.connect(self.add_blank_tab)
        tab.set_button.triggered.connect(tab.create_about_window)
        tab.url_text_bar.returnPressed.connect(tab.navigate_to_url)
        tab.browser.urlChanged.connect(tab.renew_urlbar)
        tab.browser.loadProgress.connect(tab.renew_progress_bar)
        tab.browser.titleChanged.connect(lambda title: (self.tabs.setTabText(i, title),
                                                        self.tabs.setTabToolTip(i, title)))
        tab.browser.iconChanged.connect(lambda icon: self.tabs.setTabIcon(i, icon))
  • 删除标签
    def close_current_tab(self, i):
        if self.tabs.count() > 1:
            self.tabs.removeTab(i)
        else:
            self.close()
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].