Skip to content
Alexander Richter edited this page Nov 21, 2024 · 16 revisions

PATH: lib/apps/arUtil.py

Basic UI with standard functions to setup current and future apps. It allows to template parts, centralize them and avoids extra code.

arutil

arutil_origin

How to use arUtil as UI template

Default UI and functions for new scripts with and without UI.

import os

from Qt import QtWidgets, QtGui, QtCore

from tank import Tank
from arUtil import ArUtil


#*********************************************************************
# VARIABLE
LOG = Tank().log.init(script=__name__)


#*********************************************************************
# CLASS
class NewScript(ArUtil):

    def __init__(self):
        super(NewScript, self).__init__()

        path_ui = "/".join([os.path.dirname(__file__), "ui", __name__ + ".ui"])
        self.wgNewScript = QtUiTools.QUiLoader().load(path_ui)

        self.wgHeader.setWindowTitle(__name__)
        self.resize_widget(self.wgNewScript)
        self.wgHeader.layMain.addWidget(self.wgNewScript, 0, 0)

        self.wgNewScript.show()
Clone this wiki locally