123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- KCGWidget Module
- ================
- .. module:: kcgwidget
- This module is the backbone of the Gui.
- Classes
- -------
- .. _kcgwidgets_helper_methods:
- .. py:class:: KCGWidgets
- This class is the base class to most of the used widget classes in the Gui.
- .. py:method:: __init__(self [, name, parent ])
- :param str name: Name of the widget
- :param object parent: Parent object
- .. py:method:: createButton(self [, text, x, y, dimensions, tooltip, connect, icon ])
- Create a simple PushButton
- :param str text: Text to be displayed on the button
- :param int x, y: Coordinates of the Button (only if used without layout)
- :param PyQt4.QtCore.QSize) dimensions: Size of the button
- :param str tooltip: Tooltip
- :param callable connect: Callable to call when button is pressed
- :param PyQt4.QtGui.QIcon icon: Icon to display on the button
- :return: New Button
- :rtype: PyQt4.QtGui.QPushButton
- .. py:method:: createLabel(self [, text, image, tooltip, [click=False, connect ] ])
- Create a simple Label
- :param str text: Text for the Label
- :param PyQt4.QtGui.QPixmap) image: Pixmap to set as image
- :param str tooltip: Tooltip
- :param bool click: Whether this label is clickable or not
- :param callable connect: If the label is clickable, connect the click signal to this callable
- :return: New Label
- :rtype: PyQt4.QtGui.QLabel
- .. py:method:: createSpinbox(self, min, max [, interval=1, start_value=0, connect ])
- Create a simple Spinbox
- :param int min: Minimum value
- :param int max: Maximum value
- :param int interval: The Stepwidth
- :param int start_value: Initial Value
- :param callable connect: Connect changed signal to this callable
- :return: Integer selection input field
- :rtype: PyQt4.QtGui.QSpinbox
- .. py:method:: createInput(self [, text, read_only=False, width ])
- Create a simple text input field
- :param str text: Initial text in the input field
- :param bool read_only: Whether this field is editable
- :param int width: Width of this field in pixels (None means auto-width)
- :return: Text input field
- :rtype: PyQt4.QtGui.QLineEdit
- .. py:method:: createCheckbox(self [, text, tooltip, checked=False, connect ])
- Create a simple Checkbox
- :param str text: Text to show next to the checkbox
- :param str tooltip: Tooltip
- :param bool checked: Initial state of the checkbox
- :param callable connect: Connect changed signal to this callable
- :return: New Checkbox
- :rtype: PyQt4.QtGui.QCheckBox
- .. py:attribute:: theType
- Type of the widget (int)
- .. py:attribute:: theId
- Unique ID of the widget (int)
- .. py:attribute:: theName
- Name of the widget (str)
- .. py:class:: BigIconButton
- Button with a big Icon
- .. py:method:: __init__(self, path, width, height [, connect, tooltip, parent ])
- Initialize and create a BigIconButton
- :param str path: Path to the icon file
- :param int width: Width
- :param int height: height
- :param callable connect: Connect clicked signal to this callable
- :param str tooltip: Tooltip
- :param object parent: Parent object
- .. py:class:: clickLabel
- Clickable Label
- .. _kcgwidget_register_widget:
- Registering Widgets
- -------------------
- .. py:method:: register_widget(icon, text, target, [shortcut])
- When a widget is registered, all necessary steps to add a toolbar button and a menu entry for opening the widget are
- automatically performed at the correct places.
- :param PyQt4.QtGui.QIcon icon: The icon to use in the toolbar and menu.
- :param str text: Text to use as tooltip for the toolbar button and as text in the menu.
- :param callable target: The function that "opens" the widget see :ref:`add_widget_function`.
- :param str shortcut: Keyboard shortcut to open the widget.
- .. py:method:: register_widget_creation_function(creation_func)
- Use this function to register callables that have to be called after creation of the Gui
- :param callable creation_func: The function that is to be called.
|