-
Notifications
You must be signed in to change notification settings - Fork 0
/
visor_ayuda.py
63 lines (49 loc) · 1.96 KB
/
visor_ayuda.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# import webbrowser
# webbrowser.open_new(r'file:///media/kaiser/Data/uclm/PrimeroMASTER/LAB/lab_book/ROS_Py.pdf')
import os
# os.system('ROS_Py.pdf')
#code generated by QtCreator:
from PySide import QtCore, QtGui
from PySide import QtWebKit
from PySide.QtWebKit import *
from PySide.QtCore import *
import sys
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(1000, 700)
self.centralWidget = QtGui.QWidget(MainWindow)
self.centralWidget.setObjectName("centralWidget")
self.webView = QtWebKit.QWebView(self.centralWidget)
self.webView.settings().setAttribute(QtWebKit.QWebSettings.PluginsEnabled, True)
self.webView = QtWebKit.QWebView(self.centralWidget)
self.webView.setGeometry(QtCore.QRect(10, 20, 1000, 700))
fn = os.path.join(os.path.dirname(__file__), 'guia')
url = fn+"/guia_usuario.html"
print(url)
self.webView.load(QUrl(url))
# QtGui.QDesktopServices.openUrl(url)
self.webView.setObjectName("webView")
MainWindow.setCentralWidget(self.centralWidget)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "DIRe", None, QtGui.QApplication.UnicodeUTF8))
from PySide import QtWebKit
# My code:
class Visor_documentacion(QtGui.QMainWindow):
def __init__(self, parent=None):
super(Visor_documentacion, self).__init__(parent)
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.center()
def center(self):
qr = self.frameGeometry()
cp = QtGui.QDesktopWidget().availableGeometry().center()
qr.moveCenter(cp)
self.move(qr.topLeft())
if __name__ == "__main__":
APP = QtGui.QApplication(sys.argv)
MW = Visor_documentacion()
MW.show()
sys.exit(APP.exec_())