Interface Utilities

Code author: Jeremy Ernst

This module provides utilities for general QT functions and classes to be used as widgets or templates.

Classes

Functions

class ErrorWidget(message, parent=None)[source]

Simple class that displays a QMessageBox widget with an error message, and error icon, and a simple “OK” button. Takes in a string message to display.

_images/errorWidget.png
class InfoWidget(message, details, parent=None)[source]

Simple class that displays a QMessageBox widget with an error message, and error icon, and a simple “OK” button. This class takes in required arguments: A string message, and a string for details. The details string could be empty if not required.

message = ui_utils.InfoWidget("this is an info widget", "these are some details\nas are these")
_images/infoWidget.png
create_style_sheet(data)[source]

Take in a read stylesheet, and replace any urls with actual file paths, then return the altered data.

get_maya_window()[source]

Return Maya’s main window as a QWidget

get_style_sheet(file_path)[source]

Read the style sheet data, and then replace any urls with proper file paths on the user’s drive.

scale_by_resolution(width, height, widget)[source]

Find the screen resolution and adjust the incoming width and height to accomodate. :param width: desired widget width :param height: desired widget height :param widget: widget used to query which monitor to query :return: modified width and height based on screen resolution