new
This commit is contained in:
1 parent
12884d328c
commit
8e4c46ea28
2 files changed
+1
-33
No files matched your search
@@ -1,33 +0,0 @@
|
||||
import sys
|
||||
from PyQt6.QtWidgets import QApplication, QMainWindow, QLineEdit, QToolBar
|
||||
from PyQt6.QtWebEngineWidgets import QWebEngineView
|
||||
from PyQt6.QtCore import QUrl
|
||||
|
||||
class Browser(QMainWindow):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
self.browser = QWebEngineView()
|
||||
self.browser.setUrl(QUrl("https://www.google.com"))
|
||||
self.setCentralWidget(self.browser)
|
||||
|
||||
navbar = QToolBar()
|
||||
self.addToolBar(navbar)
|
||||
|
||||
self.url_bar = QLineEdit()
|
||||
self.url_bar.returnPressed.connect(self.navigate)
|
||||
|
||||
navbar.addWidget(self.url_bar)
|
||||
|
||||
def navigate(self):
|
||||
url = self.url_bar.text()
|
||||
if not url.startswith("http"):
|
||||
url = "https://" + url
|
||||
|
||||
self.browser.setUrl(QUrl(url))
|
||||
|
||||
app = QApplication(sys.argv)
|
||||
window = Browser()
|
||||
window.show()
|
||||
|
||||
sys.exit(app.exec())
|
||||
@@ -0,0 +1 @@
|
||||
https://www.etsy.com/de/listing/1633615538/14g-16g-snake-bites-labret-lippenring?gpla=1&gao=1&utm_source=connexity&utm_medium=cpc&utm_campaign=shopping_de_google&utm_content=EAIaIQobChMIuIHhrorolAMVXZGDBx1gCDz4EAQYAyABEgIvA_D_BwE&gad_source=1
|
||||
Reference in new issue
Block a user