mgear.core.pyqt

pyQt/pySide widgets and helper functions for mGear

mgear.core.pyqt.deleteInstances(dialog, checkinstance)

Delete any instance of a given dialog

Delete any instance of a given dialog and if the dialog is instance of checkinstance.

mgear.core.pyqt.dialog

QDialog – The dialog to delete.

mgear.core.pyqt.checkinstance

QDialog – The instance to check the type of dialog.

mgear.core.pyqt.fakeTranslate(*args)

Fake Translation

fake QApplication.translate. This function helps to bypass the incompativility for the Unicode utf8 deprecated in pyside2

mgear.core.pyqt.get_icon(icon, size=24)

get svg icon from icon resources folder as a pixel map

mgear.core.pyqt.get_icon_path(icon_name=None)

Gets the directory path to the icon

mgear.core.pyqt.get_instance(parent, gui_class)

Get instace of a window from a given parent

Function borrowed from Cesar Saez QuickLauncher :param parent: parent :type parent: QtWidget :param gui_class: instance class to check

mgear.core.pyqt.get_main_window(widget=None)

Get the active window

Function borrowed from Cesar Saez QuickLauncher :param widget: window

Returns:parent of the window
Return type:QtWidget
mgear.core.pyqt.maya_main_window()

Get Maya’s main window

Returns:main window.
Return type:QMainWindow
mgear.core.pyqt.position_window(window)

set the position for the windonw

Function borrowed from Cesar Saez QuickLauncher :param window: the window to position

mgear.core.pyqt.qt_import(shi=False, cui=False)

import pyside/pyQt

Returns:QtGui, QtCore, QtWidgets, wrapInstance
Return type:multi
mgear.core.pyqt.showDialog(dialog, dInst=True, dockable=False, *args)

Show the defined dialog window

mgear.core.pyqt.dialog

QDialog – The window to show.

mgear.core.pyqt.ui2py(filePath=None, *args)

Convert qtDesigner .ui files to .py