cgdat.qt_custom package — CGDAT 2.0.3-3-g9aff488 documentation

# cgdat.qt_custom package

## Submodules

## cgdat.qt_custom.qt_dialogs module

This file contains some dialog classes that are created for the CGDAT GUI. These classes inherit from the QtWidgets.Qdialog Class.

class `cgdat.qt_custom.qt_dialogs.` `progressDialog`(parent=None)

  Bases: `PyQt5.QtWidgets.QDialog`, `cgdat.qt_ui.progress_dialog_ui.Ui_ProgressDialog`

  This class overloads the qt python class that was generated by yQt5.uic.pyuic converter for the progressDialog so it can be used as a dialog in our main GUI.

  Args:
    QtWidgets (QtWidgets.QDialog): Main dialog class Ui_ProgressDialog (object): Custom made dialog class
  `updateProgressBar`(percentage)

    Function used to update the progress bar.

    Args:
      int (int): The percentage of the progress bar.
  `updateProgressConsole`(text, color=None)

    A function used to append messages to the progress console.

    Args:
      text (str): The message we want to append.

class `cgdat.qt_custom.qt_dialogs.` `importDialog`(parent=None)

  Bases: `PyQt5.QtWidgets.QDialog`, `cgdat.qt_ui.import_dialog_ui.Ui_ImportDialog`

  This class overloads the qt python class that was generated by yQt5.uic.pyuic converter for the importDialog so it can be used as a dialog in our main GUI.

  Args:
    QtWidgets (QtWidgets.QDialog): Main dialog class Ui_ImportDialog (object): Custom made dialog class

class `cgdat.qt_custom.qt_dialogs.` `outputSettingsDialog`(parent=None)

  Bases: `PyQt5.QtWidgets.QDialog`, `cgdat.qt_ui.output_settings_ui.Ui_OutputSettings`

  This class overloads the qt python class that was generated by yQt5.uic.pyuic converter for the output_settings_ui so it can be used as a dialog in our main GUI.

  Args:
    QtWidgets (QtWidgets.QDialog): Main dialog class Ui_OutputSettings (object): Custom made dialog class

## cgdat.qt_custom.qt_extra module

This module contains classes and functions that add added custom made widgets and functionalities to the qt GUI. It contains the following components:

class `cgdat.qt_custom.qt_extra.` `MultiSelectMenu`(all_text_enabled=True, all_text='Select all')

  Bases: `PyQt5.QtWidgets.QToolButton`

  This class is used to create a multi selection drop down menu.

  `addAllOption`(all_text='Select all')

    This function is used to add a “Select all” action to the toolbar menu.

    Args:
      all_text (str, optional): Defaults to “Select all”. The text used for the select all element.
  `addItem`(item)

    Method used to add additional actions to the toolbar menu.

  `changeAllText`(all_text)

    This function is used to change the “Select all” text.

    Args:
      all_text (str): The text used for the select all element.
  `clear`()

    This function clears all the cations out of the Qmenu.

  `eventFilter`(obj, event)

    This function is used to slightly edit the open and close behaviour of the QToolButton. This was done since we want the toolbar drop down menu to stay open when the user is selecting players.

    Args:
      obj (QObject): The object on which the event filter needs to be applied. event (QEvent): The QEvent we want to overwrite.
    Returns:
      QEvent: Pass the event to the parent class.
  `removeAllOption`()

    This function is used to remove a “Select all” action to the toolbar menu.

  `selectAction`()

    This method is used to unselect the select all option when one of the other values is unselected. Further it also makes sure that the select all button is selected again if all items are selected again.

  `selectAll`()

    This method is used to select all the options when the select all action is selected

  `selectedItems`()

    This method returns a list containing the items that were selected in the toolbox menu.

    Returns:
      list: List containing the items that were selected.

## cgdat.qt_custom.qt_thread module

This module contains the classes and functions that are used qt gui to enable multithreading. It contains the following components:

class `cgdat.qt_custom.qt_thread.` `WorkerSignals`

  Bases: `PyQt5.QtCore.QObject`

  Defines the signals available from a running worker thread.

  Supported signals are:

  finished
    No data
  error
    tuple (exctype, value, traceback.format_exc() )
  ready
    str string specifying which worker was ready
  result
    object data returned from processing, anything
  progress
    int indicating % progress
  `error`
  `finished`
  `progress`
  `ready`
  `result`

class `cgdat.qt_custom.qt_thread.` `Worker`(fn, *args, **kwargs)

  Bases: `PyQt5.QtCore.QThread`

  Worker thread

  Inherits from QRunnable to handler worker thread setup, signals and wrap-up.

  Args:
    fn (callback): The function callback to run on this worker thread. The
      supplied args and kwargs will be passed through to the runner.

    args (*args): Arguments to pass to the callback function.

    kwargs (*kwargs): Keywords to pass to the callback function.

  `run`()

    Retrieve args/kwargs and start up the thread using them.

## Module contents

This package contains all the additional classes and functions that are used in the CGDAT data anaylsis tool. It contains the following components:

Modules:

`cgdat.qt_custom.qt_dialogs` | This file contains some dialog classes that are created for the CGDAT GUI.
`cgdat.qt_custom.qt_extra` | This module contains classes and functions that add added custom made widgets and functionalities to the qt GUI.
`cgdat.qt_custom.qt_thread` | This module contains the classes and functions that are used qt gui to enable multithreading.