-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I am failing my most important exams
- Loading branch information
1 parent
3b3eb46
commit 39df9c0
Showing
4 changed files
with
18 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,21 @@ | ||
import sys | ||
from PyQt5.QtWidgets import QApplication, QMainWindow, QWidget, QVBoxLayout | ||
from PyQt5.QtWidgets import QApplication, QMainWindow | ||
from PyQt5.QtCore import QUrl | ||
from PyQt5.QtWebEngineWidgets import QWebEngineView | ||
|
||
class WebWindow(QMainWindow): | ||
def __init__(self, url): | ||
class MainWindow(QMainWindow): | ||
def __init__(self): | ||
super().__init__() | ||
|
||
self.setWindowTitle("Embedded Web Page") | ||
self.setGeometry(100, 100, 800, 600) | ||
|
||
self.central_widget = QWidget() | ||
self.setCentralWidget(self.central_widget) | ||
self.layout = QVBoxLayout(self.central_widget) | ||
self.setWindowTitle("Embedded Web Browser") | ||
self.setGeometry(100, 100, 800, 600) | ||
|
||
self.browser = QWebEngineView() | ||
self.layout.addWidget(self.browser) | ||
self.browser.load(QUrl(url)) | ||
web_view = QWebEngineView() | ||
web_view.setUrl(QUrl('https://example.com')) # Create QUrl object from URL string | ||
self.setCentralWidget(web_view) | ||
|
||
if __name__ == "__main__": | ||
if __name__ == '__main__': | ||
app = QApplication(sys.argv) | ||
url = "https://www.example.com" | ||
window = WebWindow(url) | ||
window = MainWindow() | ||
window.show() | ||
sys.exit(app.exec_()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,6 @@ PyQtWebEngine | |
PyQt5 | ||
tkhtmlview | ||
tkinterweb | ||
PyGObject | ||
|
||
|