Source : about

source code: about

show the About box

Usage (example)

ui = about.InfoBox(self)

ui.setTodoURL(__issues__)
ui.setDocumentationURL(__url__)
ui.setLicenseURL(__license_url__)
ui.setTitle(config_file_parser.MAIN_SECTION_LABEL)
ui.setVersionText("software version: " + __version__)
ui.setSummaryText(__doc__.strip())
ui.setAuthorText(__author__)
ui.setCopyrightText(__copyright__)

ui.show()
InfoBox([parent, settings]) a Qt GUI for the About box
loadUi(ui_file[, baseinstance]) load a .ui file for use in building a GUI
class bcdamenu.about.InfoBox(parent=None, settings=None)[source]

a Qt GUI for the About box

setTodoURL(url) set the URL for the issue tracker
setDocumentationURL(url) set the URL for the documentation
setLicenseURL(url) set the URL for the software license text
setTitle(text) set the title in the About box
setVersionText(text) set the version text in the About box
setSummaryText(text) set the description in the About box
setAuthorText(text) set the author list in the About box
setCopyrightText(text) set the copyright string in the About box
closeEvent(event)[source]

called when user clicks the big [X] to quit

doDocsUrl()[source]

show documentation URL in default browser

doIssuesUrl()[source]

show issues URL in default browser

doLicense()[source]

show the license URL in default browser

doUrl(url)[source]

opening URL in default browser

setAuthorText(text)[source]

set the author list in the About box

setCopyrightText(text)[source]

set the copyright string in the About box

setDocumentationURL(url)[source]

set the URL for the documentation

setLicenseURL(url)[source]

set the URL for the software license text

setSummaryText(text)[source]

set the description in the About box

setTitle(text)[source]

set the title in the About box

setTodoURL(url)[source]

set the URL for the issue tracker

setVersionText(text)[source]

set the version text in the About box

bcdamenu.about.loadUi(ui_file, baseinstance=None, **kw)[source]

load a .ui file for use in building a GUI

Wraps uic.loadUi() with code that finds our program’s resources directory.

See:http://nullege.com/codes/search/PyQt4.uic.loadUi
See:http://bitesofcode.blogspot.ca/2011/10/comparison-of-loading-techniques.html

inspired by: http://stackoverflow.com/questions/14892713/how-do-you-load-ui-files-onto-python-classes-with-pyside?lq=1

Basic Procedure

  1. Use Qt Designer to create a .ui file.
  2. Create a python class of the same type as the widget you created in the .ui file.
  3. When initializing the python class, use uic to dynamically load the .ui file onto the class.

Here is an example:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
from PyQt4 import QtGui
import resources

UI_FILE = 'plainTextEdit.ui'

class TextWindow(QtGui.QDialog, form_class):

    def __init__(self, title, text):
        QtGui.QDialog.__init__(self, parent)
        resources.loadUi(UI_FILE, baseinstance=self)
        self.setWindowTitle(title)
        self.plainTextEdit.setPlainText(text)

import sys
app = QtGui.QApplication(sys.argv)
win = TextWindow('the title', __doc__)
win.show()
sys.exit(app.exec_())