PartSeg.common_gui

This module contains custom Qt based widgets. You may also use it in your project.

PartSeg.common_gui.main_window module

class PartSeg.common_gui.main_window.BaseMainMenu(settings, main_window)[source]

Bases: QWidget

class PartSeg.common_gui.main_window.BaseMainWindow(config_folder=None, title='PartSeg', settings=None, load_dict=None, signal_fun=None)[source]

Bases: QMainWindow

Base for main windows of subprograms

Variables
  • settings – store state of application. initial value is obtained from settings_class

  • files_num – maximal number of files accepted by drag and rop event

Parameters
  • config_folder (Union[str, Path, None]) – path to directory in which application save state. If settings parameter is note then settings object is created with passing this path to settings_class. If this parameter and settings are None then constructor fail with ValueError.

  • title – Window default title

  • settings (Optional[BaseSettings]) – object to store application state

  • signal_fun – function which need to be called when window shown.

closeEvent(event)[source]
deleteLater()[source]
Return type

None

dragEnterEvent(event)[source]
dropEvent(event)[source]

Support for load files by drag and drop. At beginning it check number of files and if it greater than files_num it refuse loading. Otherwise it call read_drop() method and this method should be overwritten in sub classes

classmethod get_setting_class()[source]

Get constructor for settings

Return type

Type[BaseSettings]

read_drop(paths)[source]

Function to process loading files by drag and drop.

showEvent(a0)[source]
static show_about_dialog()[source]

Show about dialog.

show_signal

Signal emitted when window has shown. Used to hide Launcher.