'''
Accessible Access Control 1.0
2012-2104 Michigan Technological University
Supported in part by NSF grants: DUE-1140512, DUE-1245310 and IIS-1319363
Developer: Yifei Li
Advisors:Dr. Steve Carr, Dr. Jean Mayo, Dr. Ching-Kuang Shene and Dr. Chaoli Wang
'''
'''
Created on Apr 27, 2012

@author: yifli
'''

from PyQt4.QtGui import QTextBrowser
from PyQt4.QtCore import QVariant, QUrl

'''
class HelpBrowser(QSplitter):
    def __init__(self, parent=None):
        QSplitter.__init__(self, Qt.Horizontal, parent)
        self.help_engine = QHelpEngine('DTEVis.qhc', self)
        self.help_engine.setupData()
        self.browser = QTextBrowser(self)
        
        self.insertWidget(0, self.help_engine.contentWidget())
        self.insertWidget(1, self.browser)
'''
class HelpBrowser(QTextBrowser):
    def __init__(self, helpEngine, parent=None):
        QTextBrowser.__init__(self, parent)
        self.help_engine = helpEngine
        self.setSource(QUrl('qthelp://edu.mtu.cs.dtevis/doc/index.html'))
    
    def loadResource(self, type, url):
        if url.scheme() == 'qthelp':
            return QVariant(self.help_engine.fileData(url))
        else:
            return QTextBrowser.loadResource(type, url)
        
        
        

