mytextbrowser.py
Aller à la documentation de ce fichier.
#!/usr/bin/python
# $Id: mytextbrowser.py 8 2010-10-11 10:03:05Z georgesk $
licence={}
licence['en']="""
file mytextbrowser.py
this file is part of the project scolasync
Copyright (C) 2010 Georges Khaznadar <georgesk@ofset.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
import subprocess
class myTextBrowser(QTextBrowser):
def setSource(self,url):
subprocess.call("(firefox %s &)"%url,shell=True)
def setHtml(self,url):
QTextBrowser.setSource(self,QUrl(url))
src.mytextbrowser.myTextBrowser
Une classe qui ouvre Firefox quand on clique sur un lien externe.
Definition: mytextbrowser.py:32
src.mytextbrowser.myTextBrowser.setSource
def setSource(self, url)
lance Firefox en tâche de fond.
Definition: mytextbrowser.py:37
src.mytextbrowser.myTextBrowser.setHtml
def setHtml(self, url)
lien vers la méthode setSource originale
Definition: mytextbrowser.py:44
QTextBrowser
QtCore
QtWidgets