ScolaSync  5.1
mytextbrowser.py
Aller à la documentation de ce fichier.
1 #!/usr/bin/python
2 # $Id: mytextbrowser.py 8 2010-10-11 10:03:05Z georgesk $
3 
4 licence={}
5 licence['en']="""
6  file mytextbrowser.py
7  this file is part of the project scolasync
8 
9  Copyright (C) 2010 Georges Khaznadar <georgesk@ofset.org>
10 
11  This program is free software: you can redistribute it and/or modify
12  it under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version3 of the License, or
14  (at your option) any later version.
15 
16  This program is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  GNU General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with this program. If not, see <http://www.gnu.org/licenses/>.
23 """
24 
25 from PyQt5.QtCore import *
26 from PyQt5.QtWidgets import *
27 import subprocess
28 
29 
31 
33 
36 
37  def setSource(self,url):
38  subprocess.call("(firefox %s &)"%url,shell=True)
39 
40 
43 
44  def setHtml(self,url):
45  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