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

Single web browser window, complete with tabbed pages, main menu and action buttons. More...

Inheritance diagram for pycross.browser.BrowserWindow:

Public Member Functions

def __init__ (self, browser, profile, forDevTools=False)
 
def sizeHint (self)
 Implemented method to make the browser window 80% of the screen by default. More...
 
def closeEvent (self, event)
 Event happening when the browser window is about to shut down. More...
 
def navigate (self, url, newtab=True, background=False)
 Navigates to a URL in the active or new tab. More...
 
def tabWidget (self)
 
def currentTab (self)
 
def createFileMenu (self, tabWidget)
 Creates and fills the File menu. More...
 
def createEditMenu (self)
 Creates and fills the Edit menu. More...
 
def createViewMenu (self, toolbar)
 Creates and fills the View menu. More...
 
def createWindowMenu (self, tabWidget)
 Creates and fills the Window menu. More...
 
def createHelpMenu (self)
 Creates and fills the Help menu. More...
 
def createToolBar (self)
 Creates and fills the main toolbar. More...
 
def on_fullscreenAction (self, checked)
 Toggles the fullscreen mode on/off. More...
 
def on_webActionEnabledChanged (self, action, enabled)
 Called when a given web action (e.g. More...
 
def on_titleChanged (self, title)
 Called when the active page title changes. More...
 
def on_act_new_window (self)
 Creates a new browser window and activates it. More...
 
def on_act_new_incognito_window (self)
 Creates a new Incognito browser window and activates it. More...
 
def on_fileopen (self)
 Opens a local file in the browser. More...
 
def on_act_find (self)
 Searches for a string in the active page. More...
 
def on_loadProgress (self, progress)
 Called while the active page is loading to indicate progress. More...
 
def on_act_show_window (self)
 Activates the selected browser window. More...
 
def on_devToolsRequested (self, source)
 Called when the user requests to show the Developer Tools. More...
 
def on_findTextFinished (self, result)
 Called when the text search has completed. More...
 

Public Attributes

 m_browser
 Browser pointer to parent browser More...
 
 m_profile
 QtWebEngineWidgets.QWebEngineProfile web profile used More...
 
 m_tabWidget
 TabWidget tab widget containing browser page tabs More...
 
 m_progressBar
 QtWidgets.QProgressBar progress bar indicating page loading More...
 
 m_historyBackAction
 QtWidgets.QAction Go Back action More...
 
 m_historyForwardAction
 QtWidgets.QAction Go Forward action More...
 
 m_stopAction
 QtWidgets.QAction Stop action (stop page loading) More...
 
 m_reloadAction
 QtWidgets.QAction Reload Page action More...
 
 m_stopReloadAction
 QtWidgets.QAction Stop Reload action More...
 
 m_favAction
 QtWidgets.QAction Favicon for current page More...
 
 m_urlLineEdit
 QtWidgets.QLineEdit URL address field More...
 
 m_lastSearch
 str last search string More...
 
 centralWidget
 QtWidgets.QMenuBar browser menu bar More...
 
 layout_main
 main window layout More...
 
 focusUrlLineEditAction
 
 fileMenu
 QtWidgets.QMenu the File menu More...
 
 newTabAction
 QtWidgets.QAction create new browser tab More...
 
 closeTabAction
 QtWidgets.QAction close current tab More...
 
 closeAction
 QtWidgets.QAction quit browser More...
 
 editMenu
 QtWidgets.QMenu the Edit menu More...
 
 findAction
 QtWidgets.QAction find text in active page More...
 
 findNextAction
 QtWidgets.QAction go to next found fragment More...
 
 findPreviousAction
 QtWidgets.QAction go to previous found fragment More...
 
 viewMenu
 QtWidgets.QMenu the View menu More...
 
 stopAction
 QtWidgets.QAction stop loading current page More...
 
 reloadAction
 QtWidgets.QAction reload current page More...
 
 zoomInAction
 QtWidgets.QAction zoom in current page More...
 
 zoomOutAction
 QtWidgets.QAction zoom out current page More...
 
 fullscreenAction
 QtWidgets.QAction toggle fullscreen mode on/off More...
 
 viewToolbarAction
 QtWidgets.QAction toggle toolbar visibility More...
 
 viewStatusbarAction
 QtWidgets.QAction toggle status bar visibility More...
 
 windowMenu
 QtWidgets.QMenu the Window menu More...
 
 nextTabAction
 QtWidgets.QAction switch to next tab More...
 
 previousTabAction
 QtWidgets.QAction switch to previous tab More...
 
 helpMenu
 QtWidgets.QMenu the Help menu More...
 
 tb_main
 QtWidgets.QToolBar main toolbar with browser action buttons More...
 
 historyBackAction
 QtWidgets.QAction Go Back action More...
 
 historyForwardAction
 QtWidgets.QAction Go Forward action More...
 
 stopReloadAction
 QtWidgets.QAction Stop Reload action More...
 
 downloadsAction
 QtWidgets.QAction Show Downloads action: shows the download manager More...
 

Detailed Description

Single web browser window, complete with tabbed pages, main menu and action buttons.

Constructor & Destructor Documentation

◆ __init__()

def pycross.browser.BrowserWindow.__init__ (   self,
  browser,
  profile,
  forDevTools = False 
)
Parameters
browserBrowser pointer to parent browser (managing all open windows)
profileQtWebEngineWidgets.QWebEngineProfile web profile used
forDevToolsbool whether the browser window is opened for developer

Member Function Documentation

◆ closeEvent()

def pycross.browser.BrowserWindow.closeEvent (   self,
  event 
)

Event happening when the browser window is about to shut down.

Here it's implemented to ask for user confirmation if more than one tab is active.

Parameters
eventthe close event

◆ createEditMenu()

def pycross.browser.BrowserWindow.createEditMenu (   self)

Creates and fills the Edit menu.

Returns
QtWidgets.QMenu created Edit menu

◆ createFileMenu()

def pycross.browser.BrowserWindow.createFileMenu (   self,
  tabWidget 
)

Creates and fills the File menu.

Parameters
tabWidgetTabWidget pointer to the underlying tab widget
Returns
QtWidgets.QMenu created File menu

◆ createHelpMenu()

def pycross.browser.BrowserWindow.createHelpMenu (   self)

Creates and fills the Help menu.

Returns
QtWidgets.QMenu created Help menu

◆ createToolBar()

def pycross.browser.BrowserWindow.createToolBar (   self)

Creates and fills the main toolbar.

Returns
QtWidgets.QToolBar created toolbar

◆ createViewMenu()

def pycross.browser.BrowserWindow.createViewMenu (   self,
  toolbar 
)

Creates and fills the View menu.

Parameters
toolbarQtWidgets.QToolBar pointer to the main toolbar
Returns
QtWidgets.QMenu created View menu

◆ createWindowMenu()

def pycross.browser.BrowserWindow.createWindowMenu (   self,
  tabWidget 
)

Creates and fills the Window menu.

Parameters
tabWidgetTabWidget pointer to the underlying tab widget
Returns
QtWidgets.QMenu created Window menu

◆ currentTab()

def pycross.browser.BrowserWindow.currentTab (   self)
Returns
WebView pointer to the active web view

◆ navigate()

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

Navigates to a URL in the active or new tab.

Parameters
urlstr the target URL to browse
newtabbool True to open the page in a new tab; False to open in the current (active) tab
backgroundbool whether to load the page in background (without switching to it)

◆ on_act_find()

def pycross.browser.BrowserWindow.on_act_find (   self)

Searches for a string in the active page.

◆ on_act_new_incognito_window()

def pycross.browser.BrowserWindow.on_act_new_incognito_window (   self)

Creates a new Incognito browser window and activates it.

◆ on_act_new_window()

def pycross.browser.BrowserWindow.on_act_new_window (   self)

Creates a new browser window and activates it.

◆ on_act_show_window()

def pycross.browser.BrowserWindow.on_act_show_window (   self)

Activates the selected browser window.

◆ on_devToolsRequested()

def pycross.browser.BrowserWindow.on_devToolsRequested (   self,
  source 
)

Called when the user requests to show the Developer Tools.

Parameters
sourceQtWebEngineWidgets.QWebEnginePage the page for which the Developer Tools must be displayed

◆ on_fileopen()

def pycross.browser.BrowserWindow.on_fileopen (   self)

Opens a local file in the browser.

◆ on_findTextFinished()

def pycross.browser.BrowserWindow.on_findTextFinished (   self,
  result 
)

Called when the text search has completed.

Parameters
resultQtWebEngineCore.QWebEngineFindTextResult the search result providing info on the number of found matches, their position in the page text etc.

◆ on_fullscreenAction()

def pycross.browser.BrowserWindow.on_fullscreenAction (   self,
  checked 
)

Toggles the fullscreen mode on/off.

Parameters
checkedbool the action's Checked status

◆ on_loadProgress()

def pycross.browser.BrowserWindow.on_loadProgress (   self,
  progress 
)

Called while the active page is loading to indicate progress.

Parameters
progressint the current progress in percent values (0...100)

◆ on_titleChanged()

def pycross.browser.BrowserWindow.on_titleChanged (   self,
  title 
)

Called when the active page title changes.

Parameters
titlestr the changed page title

◆ on_webActionEnabledChanged()

def pycross.browser.BrowserWindow.on_webActionEnabledChanged (   self,
  action,
  enabled 
)

Called when a given web action (e.g.

Back) is enabled or disabled.

Parameters
actionQtWebEngineWidgets.QWebEnginePage.WebAction the web action
enabledbool the action's Enabled status

◆ sizeHint()

def pycross.browser.BrowserWindow.sizeHint (   self)

Implemented method to make the browser window 80% of the screen by default.

◆ tabWidget()

def pycross.browser.BrowserWindow.tabWidget (   self)
Returns
TabWidget pointer to the underlying tab widget

Member Data Documentation

◆ centralWidget

pycross.browser.BrowserWindow.centralWidget

QtWidgets.QMenuBar browser menu bar

central widget containing the tab widget

◆ closeAction

pycross.browser.BrowserWindow.closeAction

QtWidgets.QAction quit browser

◆ closeTabAction

pycross.browser.BrowserWindow.closeTabAction

QtWidgets.QAction close current tab

◆ downloadsAction

pycross.browser.BrowserWindow.downloadsAction

QtWidgets.QAction Show Downloads action: shows the download manager

◆ editMenu

pycross.browser.BrowserWindow.editMenu

QtWidgets.QMenu the Edit menu

◆ fileMenu

pycross.browser.BrowserWindow.fileMenu

QtWidgets.QMenu the File menu

◆ findAction

pycross.browser.BrowserWindow.findAction

QtWidgets.QAction find text in active page

◆ findNextAction

pycross.browser.BrowserWindow.findNextAction

QtWidgets.QAction go to next found fragment

◆ findPreviousAction

pycross.browser.BrowserWindow.findPreviousAction

QtWidgets.QAction go to previous found fragment

◆ focusUrlLineEditAction

pycross.browser.BrowserWindow.focusUrlLineEditAction

◆ fullscreenAction

pycross.browser.BrowserWindow.fullscreenAction

QtWidgets.QAction toggle fullscreen mode on/off

◆ helpMenu

pycross.browser.BrowserWindow.helpMenu

QtWidgets.QMenu the Help menu

◆ historyBackAction

pycross.browser.BrowserWindow.historyBackAction

QtWidgets.QAction Go Back action

◆ historyForwardAction

pycross.browser.BrowserWindow.historyForwardAction

QtWidgets.QAction Go Forward action

◆ layout_main

pycross.browser.BrowserWindow.layout_main

main window layout

◆ m_browser

pycross.browser.BrowserWindow.m_browser

Browser pointer to parent browser

◆ m_favAction

pycross.browser.BrowserWindow.m_favAction

QtWidgets.QAction Favicon for current page

◆ m_historyBackAction

pycross.browser.BrowserWindow.m_historyBackAction

QtWidgets.QAction Go Back action

◆ m_historyForwardAction

pycross.browser.BrowserWindow.m_historyForwardAction

QtWidgets.QAction Go Forward action

◆ m_lastSearch

pycross.browser.BrowserWindow.m_lastSearch

str last search string

◆ m_profile

pycross.browser.BrowserWindow.m_profile

QtWebEngineWidgets.QWebEngineProfile web profile used

◆ m_progressBar

pycross.browser.BrowserWindow.m_progressBar

QtWidgets.QProgressBar progress bar indicating page loading

◆ m_reloadAction

pycross.browser.BrowserWindow.m_reloadAction

QtWidgets.QAction Reload Page action

◆ m_stopAction

pycross.browser.BrowserWindow.m_stopAction

QtWidgets.QAction Stop action (stop page loading)

◆ m_stopReloadAction

pycross.browser.BrowserWindow.m_stopReloadAction

QtWidgets.QAction Stop Reload action

◆ m_tabWidget

pycross.browser.BrowserWindow.m_tabWidget

TabWidget tab widget containing browser page tabs

◆ m_urlLineEdit

pycross.browser.BrowserWindow.m_urlLineEdit

QtWidgets.QLineEdit URL address field

◆ newTabAction

pycross.browser.BrowserWindow.newTabAction

QtWidgets.QAction create new browser tab

◆ nextTabAction

pycross.browser.BrowserWindow.nextTabAction

QtWidgets.QAction switch to next tab

◆ previousTabAction

pycross.browser.BrowserWindow.previousTabAction

QtWidgets.QAction switch to previous tab

◆ reloadAction

pycross.browser.BrowserWindow.reloadAction

QtWidgets.QAction reload current page

◆ stopAction

pycross.browser.BrowserWindow.stopAction

QtWidgets.QAction stop loading current page

◆ stopReloadAction

pycross.browser.BrowserWindow.stopReloadAction

QtWidgets.QAction Stop Reload action

◆ tb_main

pycross.browser.BrowserWindow.tb_main

QtWidgets.QToolBar main toolbar with browser action buttons

◆ viewMenu

pycross.browser.BrowserWindow.viewMenu

QtWidgets.QMenu the View menu

◆ viewStatusbarAction

pycross.browser.BrowserWindow.viewStatusbarAction

QtWidgets.QAction toggle status bar visibility

◆ viewToolbarAction

pycross.browser.BrowserWindow.viewToolbarAction

QtWidgets.QAction toggle toolbar visibility

◆ windowMenu

pycross.browser.BrowserWindow.windowMenu

QtWidgets.QMenu the Window menu

◆ zoomInAction

pycross.browser.BrowserWindow.zoomInAction

QtWidgets.QAction zoom in current page

◆ zoomOutAction

pycross.browser.BrowserWindow.zoomOutAction

QtWidgets.QAction zoom out current page


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