pycrossword  0.3
Pure-Python implementation of a crossword puzzle generator and editor
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
pycross.browser.TabWidget Class Reference

Tab widget container for individual web pages placed in tabs (like most browsers). More...

Inheritance diagram for pycross.browser.TabWidget:

Public Member Functions

def __init__ (self, QtWebEngineWidgets.QWebEngineProfile profile, parent=None)
 
def currentWebView (self)
 
def webView (self, index)
 Gets a web view by tab position (index). More...
 
def navigate (self, url, newtab=True, background=False)
 Navigates to the specified URL. More...
 
def setupView (self, webView)
 Connects the signals emitted by the given web view to this object. More...
 
def createTab (self)
 Creates a new tab in foreground. More...
 
def createBackgroundTab (self)
 Creates a new tab in background. More...
 
def reloadAllTabs (self)
 Reloads all the tabs (web pages). More...
 
def closeOtherTabs (self, index)
 Closes down all tabs except the one indicated. More...
 
def closeTab (self, index)
 Closes down the indicated tab (web page). More...
 
def cloneTab (self, index)
 Clones (duplicates) the indicated tab. More...
 
def setUrl (self, url)
 Navigates to the given URL in the active tab (overrides parent method) More...
 
def triggerWebPageAction (self, action)
 Triggers a web action on the active tab. More...
 
def nextTab (self)
 Switches to the next tab (one after the active one). More...
 
def previousTab (self)
 Switches to the previous tab (one before the active one). More...
 
def reloadTab (self, index)
 Reloads the specified tab. More...
 
def on_currentChanged (self, index)
 Handler called when the active tab has changed to another one. More...
 
def on_customContextMenuRequested (self, pos)
 Handler called when the context menu is called. More...
 

Public Attributes

 m_profile
 QtWebEngineWidgets.QWebEngineProfile web profile used More...
 
 icon
 QtWidgets.QLabel favicon image on tab More...
 

Static Public Attributes

 linkHovered = QtCore.pyqtSignal(str)
 link hovered signal More...
 
 loadProgress = QtCore.pyqtSignal(int)
 load progress signal More...
 
 titleChanged = QtCore.pyqtSignal(str)
 page title changed signal More...
 
 urlChanged = QtCore.pyqtSignal(QtCore.QUrl)
 URL changed signal. More...
 
 favIconChanged = QtCore.pyqtSignal(QtGui.QIcon)
 favicon changed signal More...
 
 webActionEnabledChanged = QtCore.pyqtSignal(QtWebEngineWidgets.QWebEnginePage.WebAction, bool)
 web action changed signal More...
 
 devToolsRequested = QtCore.pyqtSignal(QtWebEngineWidgets.QWebEnginePage)
 development tools requested signal More...
 
 findTextFinished = QtCore.pyqtSignal(QtWebEngineCore.QWebEngineFindTextResult)
 page search completed signal More...
 

Detailed Description

Tab widget container for individual web pages placed in tabs (like most browsers).

This may be called a boiler plate for a full web browser (only lacking the common web controls and main menu).

Constructor & Destructor Documentation

◆ __init__()

def pycross.browser.TabWidget.__init__ (   self,
QtWebEngineWidgets.QWebEngineProfile  profile,
  parent = None 
)
Parameters
profileQtWebEngineWidgets.QWebEngineProfile web profile used
parentQtWidget.QWidget parent widget (BrowserWindow)

Member Function Documentation

◆ cloneTab()

def pycross.browser.TabWidget.cloneTab (   self,
  index 
)

Clones (duplicates) the indicated tab.

Parameters
indextab index of the tab to clone

◆ closeOtherTabs()

def pycross.browser.TabWidget.closeOtherTabs (   self,
  index 
)

Closes down all tabs except the one indicated.

Parameters
indextab index of the tab that must remain open

◆ closeTab()

def pycross.browser.TabWidget.closeTab (   self,
  index 
)

Closes down the indicated tab (web page).

Parameters
indextab index of the tab to close

◆ createBackgroundTab()

def pycross.browser.TabWidget.createBackgroundTab (   self)

Creates a new tab in background.

Returns
WebView pointer to the active web view

◆ createTab()

def pycross.browser.TabWidget.createTab (   self)

Creates a new tab in foreground.

Returns
WebView pointer to the active web view

◆ currentWebView()

def pycross.browser.TabWidget.currentWebView (   self)
Returns
WebView pointer to the active web view

◆ navigate()

def pycross.browser.TabWidget.navigate (   self,
  url,
  newtab = True,
  background = False 
)

Navigates to the specified URL.

Parameters
urlQtCore.QUrl|str URL of the address to navigate to
newtabbool whether to open the URL in a new tab (True) or in the active tab (False)
backgroundbool whether to navigate in background mode

◆ nextTab()

def pycross.browser.TabWidget.nextTab (   self)

Switches to the next tab (one after the active one).

◆ on_currentChanged()

def pycross.browser.TabWidget.on_currentChanged (   self,
  index 
)

Handler called when the active tab has changed to another one.

Parameters
indextab index of the activated tab

◆ on_customContextMenuRequested()

def pycross.browser.TabWidget.on_customContextMenuRequested (   self,
  pos 
)

Handler called when the context menu is called.

Parameters
posQtCore.QPoint global position of the cursor

◆ previousTab()

def pycross.browser.TabWidget.previousTab (   self)

Switches to the previous tab (one before the active one).

◆ reloadAllTabs()

def pycross.browser.TabWidget.reloadAllTabs (   self)

Reloads all the tabs (web pages).

◆ reloadTab()

def pycross.browser.TabWidget.reloadTab (   self,
  index 
)

Reloads the specified tab.

Parameters
indextab index of the tab to reload

◆ setupView()

def pycross.browser.TabWidget.setupView (   self,
  webView 
)

Connects the signals emitted by the given web view to this object.

Parameters
webViewWebView pointer to a web view (tab contents)

◆ setUrl()

def pycross.browser.TabWidget.setUrl (   self,
  url 
)

Navigates to the given URL in the active tab (overrides parent method)

Parameters
urlQtCore.QUrl new URL to navigate to

◆ triggerWebPageAction()

def pycross.browser.TabWidget.triggerWebPageAction (   self,
  action 
)

Triggers a web action on the active tab.

Parameters
actionQtWebEngineWidgets.QWebEnginePage.WebAction web action to trigger

◆ webView()

def pycross.browser.TabWidget.webView (   self,
  index 
)

Gets a web view by tab position (index).

Parameters
indexint tab index (0...)
Returns
WebView pointer to the web view located in tab index

Member Data Documentation

◆ devToolsRequested

pycross.browser.TabWidget.devToolsRequested = QtCore.pyqtSignal(QtWebEngineWidgets.QWebEnginePage)
static

development tools requested signal

◆ favIconChanged

pycross.browser.TabWidget.favIconChanged = QtCore.pyqtSignal(QtGui.QIcon)
static

favicon changed signal

◆ findTextFinished

pycross.browser.TabWidget.findTextFinished = QtCore.pyqtSignal(QtWebEngineCore.QWebEngineFindTextResult)
static

page search completed signal

◆ icon

pycross.browser.TabWidget.icon

QtWidgets.QLabel favicon image on tab

◆ linkHovered

pycross.browser.TabWidget.linkHovered = QtCore.pyqtSignal(str)
static

link hovered signal

◆ loadProgress

pycross.browser.TabWidget.loadProgress = QtCore.pyqtSignal(int)
static

load progress signal

◆ m_profile

pycross.browser.TabWidget.m_profile

QtWebEngineWidgets.QWebEngineProfile web profile used

◆ titleChanged

pycross.browser.TabWidget.titleChanged = QtCore.pyqtSignal(str)
static

page title changed signal

◆ urlChanged

pycross.browser.TabWidget.urlChanged = QtCore.pyqtSignal(QtCore.QUrl)
static

URL changed signal.

◆ webActionEnabledChanged

pycross.browser.TabWidget.webActionEnabledChanged = QtCore.pyqtSignal(QtWebEngineWidgets.QWebEnginePage.WebAction, bool)
static

web action changed signal


The documentation for this class was generated from the following file: