Python PySide2.QtGui.QFont() Examples
The following are 23
code examples of PySide2.QtGui.QFont().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
PySide2.QtGui
, or try the search function
.
Example #1
Source File: gui.py From batch_textures_convert with MIT License | 6 votes |
def confirmDialog(tex_count): """ displays a confirmation dialog (with info about amount of found textures) for starting texture conversion process """ font = QtGui.QFont() font.setBold( True ) dialog = QtWidgets.QMessageBox() if in_hou: dialog.setParent(hou.ui.mainQtWindow(), QtCore.Qt.Window) dialog.setProperty("houdiniStyle", True) dialog.setFont(font) dialog.setIcon(QtWidgets.QMessageBox.Information) dialog.setWindowTitle("Proceed?") dialog.setText("{} textures found, proceed?".format(tex_count)) dialog.setStandardButtons(QtWidgets.QMessageBox.Cancel | QtWidgets.QMessageBox.Ok) dialog.setDefaultButton(QtWidgets.QMessageBox.Yes) ret = dialog.exec_() if ret == dialog.Ok: return True else: return False
Example #2
Source File: display.py From pylash_engine with MIT License | 6 votes |
def __getFont(self): weight = self.weight if self.weight == TextFormatWeight.NORMAL: weight = QtGui.QFont.Normal elif self.weight == TextFormatWeight.BOLD: weight = QtGui.QFont.Bold elif self.weight == TextFormatWeight.BOLDER: weight = QtGui.QFont.Black elif self.weight == TextFormatWeight.LIGHTER: weight = QtGui.QFont.Light font = QtGui.QFont() font.setFamily(self.font) font.setPixelSize(self.size) font.setWeight(weight) font.setItalic(self.italic) return font
Example #3
Source File: __main__.py From pyside2-boilerplate with MIT License | 6 votes |
def main(): app = QApplication(sys.argv) app.setWindowIcon(QIcon(':/icons/app.svg')) fontDB = QFontDatabase() fontDB.addApplicationFont(':/fonts/Roboto-Regular.ttf') app.setFont(QFont('Roboto')) f = QFile(':/style.qss') f.open(QFile.ReadOnly | QFile.Text) app.setStyleSheet(QTextStream(f).readAll()) f.close() translator = QTranslator() translator.load(':/translations/' + QLocale.system().name() + '.qm') app.installTranslator(translator) mw = MainWindow() mw.show() sys.exit(app.exec_())
Example #4
Source File: qtrace_viewer.py From angr-management with BSD 2-Clause "Simplified" License | 6 votes |
def _show_trace_func(self, show_func_tag): x = self.TRACE_FUNC_X y = self.TRACE_FUNC_Y prev_name = None for position in self.trace.trace_func: bbl_addr = position.bbl_addr func_name = position.func_name l.debug('Draw function %x, %s', bbl_addr, func_name) color = self.trace.get_func_color(func_name) self.trace_func.addToGroup(self.scene.addRect(x, y, self.TRACE_FUNC_WIDTH, self.trace_func_unit_height, QPen(color), QBrush(color))) if show_func_tag is True and func_name != prev_name: tag = self.scene.addText(func_name, QFont("Source Code Pro", 7)) tag.setPos(x + self.TRACE_FUNC_WIDTH + self.TAG_SPACING, y - tag.boundingRect().height() // 2) self.trace_func.addToGroup(tag) anchor = self.scene.addLine( self.TRACE_FUNC_X + self.TRACE_FUNC_WIDTH, y, x + self.TRACE_FUNC_WIDTH + self.TAG_SPACING, y) self.trace_func.addToGroup(anchor) prev_name = func_name y += self.trace_func_unit_height
Example #5
Source File: config_manager.py From angr-management with BSD 2-Clause "Simplified" License | 6 votes |
def init_font_config(self): self.ui_default_font = QApplication.font("QMenu") self.tabular_view_font = QApplication.font("QMenu") self.disasm_font = QFont("DejaVu Sans Mono", 10) self.disasm_font_metrics = QFontMetricsF(self.disasm_font) self.disasm_font_height = self.disasm_font_metrics.height() self.disasm_font_width = self.disasm_font_metrics.width('A') self.disasm_font_ascent = self.disasm_font_metrics.ascent() self.symexec_font = QFont("DejaVu Sans Mono", 10) self.symexec_font_metrics = QFontMetricsF(self.symexec_font) self.symexec_font_height = self.symexec_font_metrics.height() self.symexec_font_width = self.symexec_font_metrics.width('A') self.symexec_font_ascent = self.symexec_font_metrics.ascent() self.code_font = QFont("Source Code Pro", 10) self.code_font_metrics = QFontMetricsF(self.code_font) self.code_font_height = self.code_font_metrics.height() self.code_font_width = self.code_font_metrics.width('A') self.code_font_ascent = self.code_font_metrics.ascent()
Example #6
Source File: registers.py From f-ing-around-with-binaryninja with MIT License | 6 votes |
def data(self, index, role=Qt.DisplayRole): if role == Qt.CheckStateRole: return None if role == Qt.FontRole: return QFont(self.font_name, self.font_size) regs = self.view.session_data['emulator.registers'] if len(regs) == 0 and index.row() == 0: return None if regs[index.row()][index.column()] is None: return None elif index.column() == 0: return regs[index.row()][0] else: return hex(regs[index.row()][1])
Example #7
Source File: GraphicsItemsCollection.py From PyAero with MIT License | 6 votes |
def __init__(self, name=None): pen = QtGui.QPen(QtCore.Qt.SolidLine) pen.setColor(QtGui.QColor(0, 0, 0, 255)) pen.setWidthF(0.2) pen.setJoinStyle(QtCore.Qt.MiterJoin) self.pen = pen self.brush = QtGui.QBrush(QtGui.QColor(255, 255, 0, 255)) self.font = QtGui.QFont('Decorative', 12) self.rect = QtCore.QRectF() self.shape = QtGui.QPainterPath() self.path = QtGui.QPainterPath() self.scale = (1, 1) self.tooltip = '' self.method = '' self.args = []
Example #8
Source File: ui.py From pylash_engine with MIT License | 5 votes |
def __getFontWeight(self, v): weight = v if v == TextFormatWeight.NORMAL: weight = QtGui.QFont.Normal elif v == TextFormatWeight.BOLD: weight = QtGui.QFont.Bold elif v == TextFormatWeight.BOLDER: weight = QtGui.QFont.Black elif v == TextFormatWeight.LIGHTER: weight = QtGui.QFont.Light return weight
Example #9
Source File: ui.py From pylash_engine with MIT License | 5 votes |
def __init__(self, backgroundLayer = None): super(LineEdit, self).__init__() self.__font = "Arial" self.__size = 15 self.__italic = False self.__weight = TextFormatWeight.NORMAL self.__preWidth = self.width self.__preHeight = self.height self.__preX = self.x self.__preY = self.y self.__preVisible = not self.visible self.__textColor = "black" self.__widgetFont = QtGui.QFont() self.__widgetPalette = QtGui.QPalette() self.lineEditWidget = QtWidgets.QLineEdit(stage.canvasWidget) self.backgroundLayer = backgroundLayer if not isinstance(self.backgroundLayer, DisplayObject): self.backgroundLayer = Sprite() self.backgroundLayer.graphics.beginFill("white") self.backgroundLayer.graphics.lineStyle(2, "gray") self.backgroundLayer.graphics.drawRect(0, 0, 200, 40) self.backgroundLayer.graphics.endFill() self.addChild(self.backgroundLayer) self.__initWidget() self.addEventListener(LoopEvent.ENTER_FRAME, self.__loop)
Example #10
Source File: stack.py From f-ing-around-with-binaryninja with MIT License | 5 votes |
def data(self, index, role=Qt.DisplayRole): if role == Qt.CheckStateRole: return None if role == Qt.FontRole: return QFont(self.font_name, self.font_size) size = len(self.stack) if 0 == size or size < index.row(): return return hex(self.stack[index.row()][index.column()])
Example #11
Source File: buttons.py From f-ing-around-with-binaryninja with MIT License | 5 votes |
def __init__(self, view, label, callback): super().__init__(label) self.callback = callback self.view = view font_name = Settings().get_string('ui.font.name') font_size = Settings().get_integer('ui.font.size') button_font = QFont(font_name, font_size) fm = QFontMetrics(button_font) self.setFont(button_font) self.setFixedWidth(fm.horizontalAdvance(label) + 10) QObject.connect(self, SIGNAL('clicked()'), self.callback)
Example #12
Source File: memory.py From f-ing-around-with-binaryninja with MIT License | 5 votes |
def data(self, index, role=Qt.DisplayRole): if role == Qt.CheckStateRole: return None if role == Qt.FontRole: return QFont(self.font_name, self.font_size) memory = self.view.session_data.get('emulator.memory') if memory is None: return row = memory[index.row()] if index.column() == 0: return hex(row.start) elif index.column() == 1: return hex(row.end) elif index.column() == 2: return hex(row.data_offset) elif index.column() == 3: return hex(row.data_length) elif index.column() == 4: return ( f'{"r" if row.readable else "-"}' f'{"w" if row.writable else "-"}' f'{"x" if row.executable else "-"}' )
Example #13
Source File: painting.py From hotbox_designer with BSD 3-Clause Clear License | 4 votes |
def draw_shape(painter, shape): options = shape.options content_rect = shape.content_rect() if shape.clicked: bordercolor = QtGui.QColor(options['bordercolor.clicked']) backgroundcolor = QtGui.QColor(options['bgcolor.clicked']) bordersize = options['borderwidth.clicked'] elif shape.hovered: bordercolor = QtGui.QColor(options['bordercolor.hovered']) backgroundcolor = QtGui.QColor(options['bgcolor.hovered']) bordersize = options['borderwidth.hovered'] else: bordercolor = QtGui.QColor(options['bordercolor.normal']) backgroundcolor = QtGui.QColor(options['bgcolor.normal']) bordersize = options['borderwidth.normal'] textcolor = QtGui.QColor(options['text.color']) alpha = options['bordercolor.transparency'] if options['border'] else 255 bordercolor.setAlpha(255 - alpha) backgroundcolor.setAlpha(255 - options['bgcolor.transparency']) pen = QtGui.QPen(bordercolor) pen.setStyle(QtCore.Qt.SolidLine) pen.setWidthF(bordersize) painter.setPen(pen) painter.setBrush(QtGui.QBrush(backgroundcolor)) if options['shape'] == 'square': painter.drawRect(shape.rect) else: painter.drawEllipse(shape.rect) if shape.pixmap is not None: rect = shape.image_rect or content_rect painter.drawPixmap(rect, shape.pixmap) painter.setPen(QtGui.QPen(textcolor)) painter.setBrush(QtGui.QBrush(textcolor)) option = QtGui.QTextOption() flags = VALIGNS[options['text.valign']] | HALIGNS[options['text.halign']] option.setAlignment(flags) font = QtGui.QFont() font.setBold(options['text.bold']) font.setItalic(options['text.italic']) font.setPixelSize(options['text.size']) painter.setFont(font) text = options['text.content'] painter.drawText(QtCore.QRectF(content_rect), flags, text)
Example #14
Source File: GearBox_template_1010.py From universal_tool_template.py with MIT License | 4 votes |
def __init__(self, parent=None, mode=0): super_class.__init__(self, parent) #------------------------------ # class variables #------------------------------ self.version = "0.1" self.date = '2017.01.01' self.log = 'no version log in user class' self.help = 'no help guide in user class' self.uiList={} # for ui obj storage self.memoData = {} # key based variable data storage self.memoData['font_size_default'] = QtGui.QFont().pointSize() self.memoData['font_size'] = self.memoData['font_size_default'] self.memoData['last_export'] = '' self.memoData['last_import'] = '' self.location = "" if getattr(sys, 'frozen', False): # frozen - cx_freeze self.location = sys.executable else: # unfrozen self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__) self.name = self.__class__.__name__ self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png') self.iconPix = QtGui.QPixmap(self.iconPath) self.icon = QtGui.QIcon(self.iconPath) self.fileType='.{0}_EXT'.format(self.name) #------------------------------ # core function variable #------------------------------ self.qui_core_dict = { 'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout', 'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget', 'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox', 'txt': 'QTextEdit', 'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget', 'space': 'QSpacerItem', 'menu' : 'QMenu', 'menubar' : 'QMenuBar', } self.qui_user_dict = {} #------------------------------
Example #15
Source File: universal_tool_template_1116.py From universal_tool_template.py with MIT License | 4 votes |
def __init__(self, parent=None, mode=0): QtWidgets.QMainWindow.__init__(self, parent) #------------------------------ # class variables #------------------------------ self.version = '0.1' self.date = '2017.01.01' self.log = 'no version log in user class' self.help = 'no help guide in user class' self.hotkey = {} self.uiList={} # for ui obj storage self.memoData = {} # key based variable data storage self.memoData['font_size_default'] = QtGui.QFont().pointSize() self.memoData['font_size'] = self.memoData['font_size_default'] self.memoData['last_export'] = '' self.memoData['last_import'] = '' self.name = self.__class__.__name__ self.location = '' if getattr(sys, 'frozen', False): # frozen - cx_freeze self.location = sys.executable else: # unfrozen self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__) self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png') self.iconPix = QtGui.QPixmap(self.iconPath) self.icon = QtGui.QIcon(self.iconPath) self.fileType='.{0}_EXT'.format(self.name) #------------------------------ # core function variable #------------------------------ self.qui_core_dict = { 'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout', 'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget', 'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox', 'txt': 'QTextEdit', 'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget', 'space': 'QSpacerItem', 'menu' : 'QMenu', 'menubar' : 'QMenuBar', } self.qui_user_dict = {}
Example #16
Source File: universal_tool_template_1020.py From universal_tool_template.py with MIT License | 4 votes |
def __init__(self, parent=None, mode=0): QtWidgets.QMainWindow.__init__(self, parent) #------------------------------ # class variables #------------------------------ self.version = '0.1' self.date = '2017.01.01' self.log = 'no version log in user class' self.help = 'no help guide in user class' self.uiList={} # for ui obj storage self.memoData = {} # key based variable data storage self.memoData['font_size_default'] = QtGui.QFont().pointSize() self.memoData['font_size'] = self.memoData['font_size_default'] self.memoData['last_export'] = '' self.memoData['last_import'] = '' self.name = self.__class__.__name__ self.location = '' if getattr(sys, 'frozen', False): # frozen - cx_freeze self.location = sys.executable else: # unfrozen self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__) self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png') self.iconPix = QtGui.QPixmap(self.iconPath) self.icon = QtGui.QIcon(self.iconPath) self.fileType='.{0}_EXT'.format(self.name) #------------------------------ # core function variable #------------------------------ self.qui_core_dict = { 'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout', 'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget', 'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox', 'txt': 'QTextEdit', 'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget', 'space': 'QSpacerItem', 'menu' : 'QMenu', 'menubar' : 'QMenuBar', } self.qui_user_dict = {}
Example #17
Source File: MainWindow.py From HS_Downloader with MIT License | 4 votes |
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(476, 263) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.searchButton = QtWidgets.QPushButton(self.centralwidget) self.searchButton.setGeometry(QtCore.QRect(340, 10, 131, 31)) self.searchButton.setObjectName("searchButton") self.selectAll = QtWidgets.QPushButton(self.centralwidget) self.selectAll.setGeometry(QtCore.QRect(340, 55, 131, 31)) self.selectAll.setObjectName("selectAll") self.deselectAll = QtWidgets.QPushButton(self.centralwidget) self.deselectAll.setGeometry(QtCore.QRect(340, 90, 131, 31)) self.deselectAll.setObjectName("deselectAll") self.line = QtWidgets.QFrame(self.centralwidget) self.line.setGeometry(QtCore.QRect(340, 35, 131, 31)) self.line.setFrameShape(QtWidgets.QFrame.HLine) self.line.setFrameShadow(QtWidgets.QFrame.Sunken) self.line.setObjectName("line") self.downloadButton = QtWidgets.QPushButton(self.centralwidget) self.downloadButton.setGeometry(QtCore.QRect(340, 220, 131, 31)) self.downloadButton.setObjectName("downloadButton") self.animeView = QtWidgets.QListWidget(self.centralwidget) self.animeView.setGeometry(QtCore.QRect(10, 50, 321, 201)) self.animeView.setObjectName("animeView") self.searchField = QtWidgets.QLineEdit(self.centralwidget) self.searchField.setGeometry(QtCore.QRect(10, 10, 321, 31)) self.searchField.setObjectName("searchField") self.loadingStatus = QtWidgets.QLabel(self.centralwidget) self.loadingStatus.setEnabled(True) self.loadingStatus.setGeometry(QtCore.QRect(340, 160, 131, 20)) font = QtGui.QFont() font.setFamily("Segoe UI") font.setPointSize(11) font.setWeight(75) font.setBold(True) self.loadingStatus.setFont(font) self.loadingStatus.setAlignment(QtCore.Qt.AlignCenter) self.loadingStatus.setObjectName("loadingStatus") self.selectQuality = QtWidgets.QComboBox(self.centralwidget) self.selectQuality.setGeometry(QtCore.QRect(340, 190, 131, 22)) self.selectQuality.setObjectName("selectQuality") self.intellTurn = QtWidgets.QCheckBox(self.centralwidget) self.intellTurn.setGeometry(QtCore.QRect(340, 130, 131, 17)) self.intellTurn.setObjectName("intellTurn") MainWindow.setCentralWidget(self.centralwidget) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow)
Example #18
Source File: universal_tool_template_2010.py From universal_tool_template.py with MIT License | 4 votes |
def __init__(self, parent=None): QtWidgets.QMainWindow.__init__(self, parent) # class property self.tpl_ver = tpl_ver self.tpl_date = tpl_date self.version = '0.1' self.date = '2017.01.01' self.log = 'no version log in user class' self.help = 'no help guide in user class' # class info self.name = self.__class__.__name__ self.fileType='.{0}_EXT'.format(self.name) # class path and icon self.location = '' if getattr(sys, 'frozen', False): self.location = sys.executable # frozen case - cx_freeze else: self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__) self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png') self.iconPix = QtGui.QPixmap(self.iconPath) self.icon = QtGui.QIcon(self.iconPath) # class data self.hotkey = {} self.uiList={} # for ui obj storage self.memoData = {} # key based variable data storage self.memoData['font_size_default'] = QtGui.QFont().pointSize() self.memoData['font_size'] = self.memoData['font_size_default'] self.memoData['last_export'] = '' self.memoData['last_import'] = '' self.memoData['last_browse'] = '' # core function variable self.qui_core_dict = { 'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout', 'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget', 'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox', 'spin':'QSpinBox', 'txt': 'QTextEdit', 'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget', 'space': 'QSpacerItem', 'menu' : 'QMenu', 'menubar' : 'QMenuBar', } self.qui_user_dict = {}
Example #19
Source File: universal_tool_template_1010.py From universal_tool_template.py with MIT License | 4 votes |
def __init__(self, parent=None, mode=0): super_class.__init__(self, parent) #------------------------------ # class variables #------------------------------ self.version = "0.1" self.date = '2017.01.01' self.log = 'no version log in user class' self.help = 'no help guide in user class' self.uiList={} # for ui obj storage self.memoData = {} # key based variable data storage self.memoData['font_size_default'] = QtGui.QFont().pointSize() self.memoData['font_size'] = self.memoData['font_size_default'] self.memoData['last_export'] = '' self.memoData['last_import'] = '' self.location = "" if getattr(sys, 'frozen', False): # frozen - cx_freeze self.location = sys.executable else: # unfrozen self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__) self.name = self.__class__.__name__ self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png') self.iconPix = QtGui.QPixmap(self.iconPath) self.icon = QtGui.QIcon(self.iconPath) self.fileType='.{0}_EXT'.format(self.name) #------------------------------ # core function variable #------------------------------ self.qui_core_dict = { 'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout', 'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget', 'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox', 'txt': 'QTextEdit', 'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget', 'space': 'QSpacerItem', 'menu' : 'QMenu', 'menubar' : 'QMenuBar', } self.qui_user_dict = {} #------------------------------
Example #20
Source File: universal_tool_template_1000.py From universal_tool_template.py with MIT License | 4 votes |
def __init__(self, parent=None, mode=0): super_class.__init__(self, parent) #------------------------------ # class variables #------------------------------ self.version = "0.1" self.date = '2017.01.01' self.log = 'no version log in user class' self.help = 'no help guide in user class' self.uiList={} # for ui obj storage self.memoData = {} # key based variable data storage self.memoData['font_size_default'] = QtGui.QFont().pointSize() self.memoData['font_size'] = self.memoData['font_size_default'] self.location = "" if getattr(sys, 'frozen', False): # frozen - cx_freeze self.location = sys.executable else: # unfrozen self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__) self.name = self.__class__.__name__ self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png') self.iconPix = QtGui.QPixmap(self.iconPath) self.icon = QtGui.QIcon(self.iconPath) self.fileType='.{0}_EXT'.format(self.name) #------------------------------ # core function variable #------------------------------ self.qui_core_dict = { 'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout', 'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget', 'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox', 'txt': 'QTextEdit', 'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget', 'space': 'QSpacerItem', 'menu' : 'QMenu', 'menubar' : 'QMenuBar', } self.qui_user_dict = {} #------------------------------
Example #21
Source File: universal_tool_template_1110.py From universal_tool_template.py with MIT License | 4 votes |
def __init__(self, parent=None, mode=0): QtWidgets.QMainWindow.__init__(self, parent) #------------------------------ # class variables #------------------------------ self.version = '0.1' self.date = '2017.01.01' self.log = 'no version log in user class' self.help = 'no help guide in user class' self.uiList={} # for ui obj storage self.memoData = {} # key based variable data storage self.memoData['font_size_default'] = QtGui.QFont().pointSize() self.memoData['font_size'] = self.memoData['font_size_default'] self.memoData['last_export'] = '' self.memoData['last_import'] = '' self.name = self.__class__.__name__ self.location = '' if getattr(sys, 'frozen', False): # frozen - cx_freeze self.location = sys.executable else: # unfrozen self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__) self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png') self.iconPix = QtGui.QPixmap(self.iconPath) self.icon = QtGui.QIcon(self.iconPath) self.fileType='.{0}_EXT'.format(self.name) #------------------------------ # core function variable #------------------------------ self.qui_core_dict = { 'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout', 'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget', 'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox', 'txt': 'QTextEdit', 'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget', 'space': 'QSpacerItem', 'menu' : 'QMenu', 'menubar' : 'QMenuBar', } self.qui_user_dict = {}
Example #22
Source File: universal_tool_template_1100.py From universal_tool_template.py with MIT License | 4 votes |
def __init__(self, parent=None, mode=0): QtWidgets.QMainWindow.__init__(self, parent) #------------------------------ # class variables #------------------------------ self.version = '0.1' self.date = '2017.01.01' self.log = 'no version log in user class' self.help = 'no help guide in user class' self.uiList={} # for ui obj storage self.memoData = {} # key based variable data storage self.memoData['font_size_default'] = QtGui.QFont().pointSize() self.memoData['font_size'] = self.memoData['font_size_default'] self.memoData['last_export'] = '' self.memoData['last_import'] = '' self.name = self.__class__.__name__ self.location = '' if getattr(sys, 'frozen', False): # frozen - cx_freeze self.location = sys.executable else: # unfrozen self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__) self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png') self.iconPix = QtGui.QPixmap(self.iconPath) self.icon = QtGui.QIcon(self.iconPath) self.fileType='.{0}_EXT'.format(self.name) #------------------------------ # core function variable #------------------------------ self.qui_core_dict = { 'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout', 'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget', 'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox', 'txt': 'QTextEdit', 'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget', 'space': 'QSpacerItem', 'menu' : 'QMenu', 'menubar' : 'QMenuBar', } self.qui_user_dict = {}
Example #23
Source File: universal_tool_template_1115.py From universal_tool_template.py with MIT License | 4 votes |
def __init__(self, parent=None, mode=0): QtWidgets.QMainWindow.__init__(self, parent) #------------------------------ # class variables #------------------------------ self.version = '0.1' self.date = '2017.01.01' self.log = 'no version log in user class' self.help = 'no help guide in user class' self.hotkey = {} self.uiList={} # for ui obj storage self.memoData = {} # key based variable data storage self.memoData['font_size_default'] = QtGui.QFont().pointSize() self.memoData['font_size'] = self.memoData['font_size_default'] self.memoData['last_export'] = '' self.memoData['last_import'] = '' self.name = self.__class__.__name__ self.location = '' if getattr(sys, 'frozen', False): # frozen - cx_freeze self.location = sys.executable else: # unfrozen self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__) self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png') self.iconPix = QtGui.QPixmap(self.iconPath) self.icon = QtGui.QIcon(self.iconPath) self.fileType='.{0}_EXT'.format(self.name) #------------------------------ # core function variable #------------------------------ self.qui_core_dict = { 'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout', 'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget', 'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox', 'txt': 'QTextEdit', 'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget', 'space': 'QSpacerItem', 'menu' : 'QMenu', 'menubar' : 'QMenuBar', } self.qui_user_dict = {}