I would like to open website in standard browser of operating system when user clicks a button in my pyqt4 application. How can I do this?
You can also use QDesktopServices::openUrl
.
Here's the minimal working example,
from PyQt5.Qt import QApplication, QUrl, QDesktopServices
import sys
app = QApplication(sys.argv)
url = QUrl("https://stackoverflow.com/questions/3684857/pyqt4-open-website-in-standard-browser-on-button-click")
QDesktopServices.openUrl(url)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With