Python PyQt5.QtGui.QFont() Examples
The following are 30
code examples of PyQt5.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
PyQt5.QtGui
, or try the search function
.
Example #1
Source File: table.py From dunya-desktop with GNU General Public License v3.0 | 12 votes |
def __init__(self, parent=None): QTableView.__init__(self, parent=parent) # setting the table for no edit and row selection self.setEditTriggers(QAbstractItemView.NoEditTriggers) self.setSelectionBehavior(QAbstractItemView.SelectRows) # self.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) self.setMouseTracking(True) self.horizontalHeader().setStretchLastSection(True) font = QFont() font.setPointSize(13) self.horizontalHeader().setFont(font) # hiding the vertical headers self.verticalHeader().hide() # arranging the artist column for being multi-line self.setWordWrap(True) self.setTextElideMode(Qt.ElideMiddle) self._last_index = QPersistentModelIndex() self.viewport().installEventFilter(self) self._set_font()
Example #2
Source File: Project.py From Python-GUI with MIT License | 11 votes |
def boxclose(self): teamname = self.open_screen.OpenTheTeam.text() myteam= sqlite3.connect('TEAM.db') curser= myteam.cursor() curser.execute("SELECT PLAYERS from team WHERE NAMES= '"+teamname+"';") hu= curser.fetchall() self.listWidget.clear() for i in range(len(hu)): item= QtWidgets.QListWidgetItem(hu[i][0]) font = QtGui.QFont() font.setBold(True) font.setWeight(75) item.setFont(font) item.setBackground(QtGui.QColor('sea green')) self.listWidget.addItem(item) self.openDialog.close()
Example #3
Source File: sourcewindow.py From dcc with Apache License 2.0 | 10 votes |
def _get_format_from_style(self, token, style): """ Returns a QTextCharFormat for token by reading a Pygments style. """ result = QtGui.QTextCharFormat() for key, value in list(style.style_for_token(token).items()): if value: if key == 'color': result.setForeground(self._get_brush(value)) elif key == 'bgcolor': result.setBackground(self._get_brush(value)) elif key == 'bold': result.setFontWeight(QtGui.QFont.Bold) elif key == 'italic': result.setFontItalic(True) elif key == 'underline': result.setUnderlineStyle( QtGui.QTextCharFormat.SingleUnderline) elif key == 'sans': result.setFontStyleHint(QtGui.QFont.SansSerif) elif key == 'roman': result.setFontStyleHint(QtGui.QFont.Times) elif key == 'mono': result.setFontStyleHint(QtGui.QFont.TypeWriter) return result
Example #4
Source File: Banners.py From qiew with GNU General Public License v2.0 | 10 votes |
def __init__(self, dataModel, viewMode): self.width = 0 self.height = 0 self.dataModel = dataModel self.viewMode = viewMode self.qpix = self._getNewPixmap(self.width, self.height) self.backgroundBrush = QtGui.QBrush(QtGui.QColor(0, 0, 128)) # text font self.font = QtGui.QFont('Terminus', 11, QtGui.QFont.Light) # font metrics. assume font is monospaced self.font.setKerning(False) self.font.setFixedPitch(True) fm = QtGui.QFontMetrics(self.font) self.fontWidth = fm.width('a') self.fontHeight = fm.height() self.textPen = QtGui.QPen(QtGui.QColor(192, 192, 192), 0, QtCore.Qt.SolidLine)
Example #5
Source File: Banners.py From qiew with GNU General Public License v2.0 | 8 votes |
def __init__(self, dataModel, viewMode): self.width = 0 self.height = 0 self.dataModel = dataModel self.viewMode = viewMode self.qpix = self._getNewPixmap(self.width, self.height) self.backgroundBrush = QtGui.QBrush(QtGui.QColor(0, 0, 128)) # text font self.font = QtGui.QFont('Terminus', 11, QtGui.QFont.Bold) # font metrics. assume font is monospaced self.font.setKerning(False) self.font.setFixedPitch(True) fm = QtGui.QFontMetrics(self.font) self.fontWidth = fm.width('a') self.fontHeight = fm.height() self.textPen = QtGui.QPen(QtGui.QColor(255, 255, 0), 0, QtCore.Qt.SolidLine)
Example #6
Source File: scorewidnow.py From Python-GUI with MIT License | 8 votes |
def setupUi(self, ScoreWindow): ScoreWindow.setObjectName("ScoreWindow") ScoreWindow.resize(471, 386) self.centralwidget = QtWidgets.QWidget(ScoreWindow) self.centralwidget.setObjectName("centralwidget") self.Score = QtWidgets.QLineEdit(self.centralwidget) self.Score.setGeometry(QtCore.QRect(180, 180, 113, 22)) self.Score.setObjectName("Score") self.teamscore = QtWidgets.QLabel(self.centralwidget) self.teamscore.setGeometry(QtCore.QRect(180, 130, 151, 20)) font = QtGui.QFont() font.setBold(True) font.setWeight(75) self.teamscore.setFont(font) self.teamscore.setObjectName("teamscore") ScoreWindow.setCentralWidget(self.centralwidget) self.statusbar = QtWidgets.QStatusBar(ScoreWindow) self.statusbar.setObjectName("statusbar") ScoreWindow.setStatusBar(self.statusbar) self.retranslateUi(ScoreWindow) QtCore.QMetaObject.connectSlotsByName(ScoreWindow)
Example #7
Source File: Banners.py From qiew with GNU General Public License v2.0 | 8 votes |
def __init__(self, dataModel, viewMode): self.width = 0 self.height = 0 self.dataModel = dataModel self.viewMode = viewMode self.qpix = self._getNewPixmap(self.width, self.height) self.backgroundBrush = QtGui.QBrush(QtGui.QColor(0, 0, 128)) # text font self.font = QtGui.QFont('Consolas', 11, QtGui.QFont.Light) # font metrics. assume font is monospaced self.font.setKerning(False) self.font.setFixedPitch(True) fm = QtGui.QFontMetrics(self.font) self.fontWidth = fm.width('a') self.fontHeight = fm.height() self.textPen = QtGui.QPen(QtGui.QColor(255, 255, 0), 0, QtCore.Qt.SolidLine)
Example #8
Source File: easygui_qt.py From easygui_qt with BSD 3-Clause "New" or "Revised" License | 7 votes |
def __init__(self): super(SimpleApp, self).__init__([]) self.translator = QtCore.QTranslator() self.default_font = QtGui.QFont() if sys.version_info < (3,) : settings_path = ".easygui-qt2" else: settings_path = ".easygui-qt3" self.config_path = os.path.join(os.path.expanduser("~"), settings_path) try: self.load_config() self.setFont(self.default_font) except: pass self.save_config()
Example #9
Source File: elf.py From qiew with GNU General Public License v2.0 | 6 votes |
def __init__(self, dataModel, viewMode, elfplugin): self.width = 0 self.height = 0 self.dataModel = dataModel self.viewMode = viewMode self.qpix = self._getNewPixmap(self.width, self.height) self.backgroundBrush = QtGui.QBrush(QtGui.QColor(0, 0, 128)) self.elfplugin = elfplugin self.elf = self.elfplugin.elf # text font self.font = QtGui.QFont('Terminus', 11, QtGui.QFont.Bold) # font metrics. assume font is monospaced self.font.setKerning(False) self.font.setFixedPitch(True) fm = QtGui.QFontMetrics(self.font) self.fontWidth = fm.width('a') self.fontHeight = fm.height() self.textPen = QtGui.QPen(QtGui.QColor(192, 192, 192), 0, QtCore.Qt.SolidLine)
Example #10
Source File: player.py From MusicBox with MIT License | 6 votes |
def __init__(self, parent=None): super(DesktopLyric, self).__init__() self.lyric = QString('Lyric Show.') self.intervel = 0 self.maskRect = QRectF(0, 0, 0, 0) self.maskWidth = 0 self.widthBlock = 0 self.t = QTimer() self.screen = QApplication.desktop().availableGeometry() self.setObjectName(_fromUtf8("Dialog")) self.setWindowFlags(Qt.CustomizeWindowHint | Qt.FramelessWindowHint | Qt.Dialog | Qt.WindowStaysOnTopHint | Qt.Tool) self.setMinimumHeight(65) self.setAttribute(Qt.WA_TranslucentBackground) self.handle = lyric_handle(self) self.verticalLayout = QVBoxLayout(self) self.verticalLayout.setSpacing(0) self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.font = QFont(_fromUtf8('微软雅黑, verdana'), 50) self.font.setPixelSize(50) # QMetaObject.connectSlotsByName(self) self.handle.lyricmoved.connect(self.newPos) self.t.timeout.connect(self.changeMask)
Example #11
Source File: show_text_window.py From easygui_qt with BSD 3-Clause "New" or "Revised" License | 6 votes |
def __init__(self, parent=None): super(Highlighter, self).__init__(parent) keywordFormat = QtGui.QTextCharFormat() keywordFormat.setForeground(QtCore.Qt.blue) keywordFormat.setFontWeight(QtGui.QFont.Bold) keywordPatterns = ["\\b{}\\b".format(k) for k in keyword.kwlist] self.highlightingRules = [(QtCore.QRegExp(pattern), keywordFormat) for pattern in keywordPatterns] classFormat = QtGui.QTextCharFormat() classFormat.setFontWeight(QtGui.QFont.Bold) self.highlightingRules.append((QtCore.QRegExp("\\bQ[A-Za-z]+\\b"), classFormat)) singleLineCommentFormat = QtGui.QTextCharFormat() singleLineCommentFormat.setForeground(QtCore.Qt.gray) self.highlightingRules.append((QtCore.QRegExp("#[^\n]*"), singleLineCommentFormat)) quotationFormat = QtGui.QTextCharFormat() quotationFormat.setForeground(QtCore.Qt.darkGreen) self.highlightingRules.append((QtCore.QRegExp("\".*\""), quotationFormat)) self.highlightingRules.append((QtCore.QRegExp("'.*'"), quotationFormat))
Example #12
Source File: lrcwindow.py From QMusic with GNU Lesser General Public License v2.1 | 6 votes |
def initData(self): self._hovered = False self.linear_gradient = QLinearGradient() self.linear_gradient.setStart(0, 10) self.linear_gradient.setFinalStop(0, 40) self.linear_gradient.setColorAt(0.1, QColor(14, 179, 255)); self.linear_gradient.setColorAt(0.5, QColor(114, 232, 255)); self.linear_gradient.setColorAt(1, QColor(14, 179, 255)); self.mask_linear_gradient = QLinearGradient() self.mask_linear_gradient.setStart(0, 10) self.mask_linear_gradient.setFinalStop(0, 40) self.mask_linear_gradient.setColorAt(0.1, QColor(0, 100, 40)) self.mask_linear_gradient.setColorAt(0.5, QColor(0, 72, 16)) self.mask_linear_gradient.setColorAt(1, QColor(0, 255, 40)) self.text = "" self.percentage = 0 self.lyric_id = 0 self.line1_text = '' self.line1_percentage = 0 self.line2_text = '' self.line2_percentage = 0 self.lrcfont = QFont() self.lrcfont.setPixelSize(30) self.setFont(self.lrcfont) self._lineMode = 1
Example #13
Source File: uiutils.py From ddt4all with GNU General Public License v3.0 | 6 votes |
def getXMLFont(xml, scale = 1): font = getChildNodesByName(xml, "Font")[0] font_name = font.getAttribute("Name") font_size = float(font.getAttribute("Size").replace(',', '.')) font_bold = font.getAttribute("Bold") font_italic = font.getAttribute("Italic") if font_bold == '1': fnt_flags = gui.QFont.Bold else: fnt_flags = gui.QFont.Normal if font_italic == '1': fnt_flags |= gui.QFont.StyleItalic font_size = font_size / float(scale) * 14. qfnt = gui.QFont(font_name, font_size, fnt_flags) qfnt.setPixelSize(font_size) return qfnt
Example #14
Source File: globalmapwidget.py From PyPipboyApp with GNU General Public License v3.0 | 6 votes |
def __init__(self, uid, widget, imageFactory, color, size, parent = None, icon='StarFilled.svg'): super().__init__(widget.mapScene, widget.mapView, parent) self.markerType = 6 self.widget = widget self.imageFactory = imageFactory self.imageFilePath = os.path.join(icon) self.markerItem.setZValue(0) self.setColor(color,False) self.setSize(size, False) if self.color is not None: self.uncollectedColor = QtGui.QColor.fromRgb(self.color.red(), self.color.green(), self.color.blue()) self.collectedColor = self.color.darker(200) self.setLabelFont(QtGui.QFont("Times", 8, QtGui.QFont.Bold), False) self.setLabel('Collectable Marker', False) self.filterVisibleFlag = True self.uid = uid self.collected = False self.itemFormID = None self.collectedOverlayIcon = None self._rebuildOverlayIcons() self.doUpdate()
Example #15
Source File: globalmapwidget.py From PyPipboyApp with GNU General Public License v3.0 | 6 votes |
def __init__(self, uid, widget, imageFactory, color, size, iconfile='mapmarkerpoi_1.svg', parent = None): super().__init__(widget.mapScene, widget.mapView, parent) self.markerType = 5 self.widget = widget self.imageFactory = imageFactory self.imageFilePath = iconfile self.pipValueListenerDepth = 1 self.markerItem.setZValue(0) self.setColor(color,False) self.setSize(size,False) self.setLabelFont(QtGui.QFont("Times", 8, QtGui.QFont.Bold), False) self.setLabel('Point of Interest Marker', False) self.filterVisibleFlag = True self.uid = str(uid) self.thisCharOnly = True self.doUpdate()
Example #16
Source File: uiutils.py From ddt4all with GNU General Public License v3.0 | 6 votes |
def jsonFont(fnt, scale): font_name = fnt['name'] font_size = fnt['size'] if 'bold' in fnt: font_bold = fnt['bold'] else: font_bold = '0' if 'italic' in fnt: font_italic = fnt['italic'] else: font_italic = '0' if font_bold == '1': fnt_flags = gui.QFont.Bold else: fnt_flags = gui.QFont.Normal if font_italic == '1': fnt_flags |= gui.QFont.StyleItalic font_size = font_size / float(scale) * 14. qfnt = gui.QFont(font_name, font_size, fnt_flags); qfnt.setPixelSize(font_size) return qfnt
Example #17
Source File: globalmapwidget.py From PyPipboyApp with GNU General Public License v3.0 | 6 votes |
def __init__(self, widget, imageFactory, color, size, parent = None): super().__init__(widget.mapScene, widget.mapView, parent) self.markerType = 2 self.uid = 'powerarmormarker' self.widget = widget self.imageFactory = imageFactory self.imageFilePath = os.path.join('res', 'mapmarkerpowerarmor.svg') self.pipValueListenerDepth = 1 self.markerItem.setZValue(0) self.setColor(color,False) self.setSize(size,False) self.setLabelFont(QtGui.QFont("Times", 8, QtGui.QFont.Bold), False) self.setLabel('Power Armor', False) self.filterVisibleFlag = True self.PipVisible = False self.doUpdate()
Example #18
Source File: updateScreen.py From pip-gui with GNU General Public License v3.0 | 5 votes |
def setupUi(self, Form): Form.setObjectName(_fromUtf8("Form")) Form.resize(427, 456) self.listWidget = QtWidgets.QListWidget(Form) self.listWidget.setGeometry(QtCore.QRect(10, 60, 261, 381)) self.listWidget.setSelectionMode( QtWidgets.QAbstractItemView.MultiSelection) self.listWidget.setObjectName(_fromUtf8("listWidget")) self.verticalLayoutWidget = QtWidgets.QWidget(Form) self.verticalLayoutWidget.setGeometry( QtCore.QRect(290, 60, 121, 98)) self.verticalLayoutWidget.setObjectName( _fromUtf8("verticalLayoutWidget")) self.verticalLayout = QtWidgets.QVBoxLayout( self.verticalLayoutWidget) self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.btnUpdate = QtWidgets.QPushButton(self.verticalLayoutWidget) self.btnUpdate.setObjectName(_fromUtf8("btnUpdate")) self.verticalLayout.addWidget(self.btnUpdate) self.btnUpdateAll = QtWidgets.QPushButton(self.verticalLayoutWidget) self.btnUpdateAll.setObjectName(_fromUtf8("btnUpdateAll")) self.verticalLayout.addWidget(self.btnUpdateAll) self.btnBack = QtWidgets.QPushButton(self.verticalLayoutWidget) self.btnBack.setObjectName(_fromUtf8("btnBack")) self.verticalLayout.addWidget(self.btnBack) self.label = QtWidgets.QLabel(Form) self.label.setGeometry(QtCore.QRect(10, 20, 401, 21)) font = QtGui.QFont() font.setPointSize(14) self.label.setFont(font) self.label.setObjectName(_fromUtf8("label")) self.retranslateUi(Form) QtCore.QMetaObject.connectSlotsByName(Form)
Example #19
Source File: uiBasicWidget.py From TradeSim with Apache License 2.0 | 5 votes |
def loadFont(): """载入字体设置""" try: f = file("setting/VT_setting.json") setting = json.load(f) family = setting['fontFamily'] size = setting['fontSize'] font = QtGui.QFont(family, size) except: font = QtGui.QFont(u'微软雅黑', 12) return font
Example #20
Source File: arena.py From heap-viewer with GNU General Public License v3.0 | 5 votes |
def _create_menu(self): self.t_top_addr = QtWidgets.QLineEdit() self.t_top_addr.setFixedWidth(130) self.t_top_addr.setReadOnly(True) self.t_last_remainder = QtWidgets.QLineEdit() self.t_last_remainder.setFixedWidth(150) self.t_last_remainder.setReadOnly(True) self.lbl_top_warning = QtWidgets.QLabel() self.lbl_top_warning.setStyleSheet('color: red') self.lbl_top_warning.setVisible(False) self.t_attached_threads = QtWidgets.QLineEdit() self.t_attached_threads.setFixedWidth(130) self.t_attached_threads.setReadOnly(True) hbox_arena_top = QtWidgets.QHBoxLayout() hbox_arena_top.addWidget(QtWidgets.QLabel('Top:')) hbox_arena_top.addWidget(self.t_top_addr) hbox_arena_top.addWidget(QtWidgets.QLabel('Last remainder:')) hbox_arena_top.addWidget(self.t_last_remainder) btn_malloc_par = QtWidgets.QPushButton("Struct") btn_malloc_par.clicked.connect(self.btn_struct_on_click) hbox_arena_top.addWidget(btn_malloc_par) hbox_arena_top.addStretch(1) hbox_arena_others = QtWidgets.QHBoxLayout() hbox_arena_others.addWidget(self.lbl_top_warning) self.bold_font = QtGui.QFont() self.bold_font.setBold(True) grid_arenas = QtWidgets.QGridLayout() grid_arenas.addLayout(hbox_arena_top, 0, 0) grid_arenas.addLayout(hbox_arena_others, 1, 0) grid_arenas.addWidget(self.tbl_parsed_heap, 2, 0) self.setLayout(grid_arenas)
Example #21
Source File: helper.py From harvesters_gui with Apache License 2.0 | 5 votes |
def get_system_font(): if is_running_on_windows(): font, size = 'Calibri', 12 else: if is_running_on_macos(): font, size = 'Lucida Sans Unicode', 14 else: font, size = 'Sans-serif', 11 return QFont(font, size)
Example #22
Source File: qt_utils.py From kite with GNU General Public License v3.0 | 5 votes |
def drawText(self, event, qp): qp.setPen(self.textColor()) qp.setFont(QtGui.QFont('Arial', 10)) qp.drawText(event.rect(), QtCore.Qt.AlignLeft, self.format(self.main.start())) qp.drawText(event.rect(), QtCore.Qt.AlignRight, self.format(self.main.end()))
Example #23
Source File: qt_utils.py From kite with GNU General Public License v3.0 | 5 votes |
def drawText(self, event, qp): qp.setPen(self.textColor()) qp.setFont(QtGui.QFont('Arial', 10)) qp.drawText(event.rect(), QtCore.Qt.AlignRight, self.format(self.main.max()))
Example #24
Source File: qt_utils.py From kite with GNU General Public License v3.0 | 5 votes |
def drawText(self, event, qp): qp.setPen(self.textColor()) qp.setFont(QtGui.QFont('Arial', 10)) qp.drawText(event.rect(), QtCore.Qt.AlignLeft, self.format(self.main.min()))
Example #25
Source File: DyInfoDlg.py From DevilYuan with MIT License | 5 votes |
def _initUi(self, info): text = info label = QLabel() label.setText(text) label.setMinimumWidth(500) label.setFont(QFont('Courier New', 12)) vbox = QVBoxLayout() vbox.addWidget(label) self.setLayout(vbox)
Example #26
Source File: DyMainWindow.py From DevilYuan with MIT License | 5 votes |
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(473, 235) self.centralWidget = QtWidgets.QWidget(MainWindow) self.centralWidget.setObjectName("centralWidget") self.pushButtonSelectStock = QtWidgets.QPushButton(self.centralWidget) self.pushButtonSelectStock.setGeometry(QtCore.QRect(10, 10, 221, 91)) font = QtGui.QFont() font.setFamily("Arial") font.setPointSize(20) self.pushButtonSelectStock.setFont(font) self.pushButtonSelectStock.setObjectName("pushButtonSelectStock") self.pushButtonStockTrade = QtWidgets.QPushButton(self.centralWidget) self.pushButtonStockTrade.setGeometry(QtCore.QRect(240, 10, 221, 91)) font = QtGui.QFont() font.setFamily("Arial") font.setPointSize(20) self.pushButtonStockTrade.setFont(font) self.pushButtonStockTrade.setObjectName("pushButtonStockTrade") self.pushButtonStockData = QtWidgets.QPushButton(self.centralWidget) self.pushButtonStockData.setGeometry(QtCore.QRect(240, 110, 221, 91)) font = QtGui.QFont() font.setFamily("Arial") font.setPointSize(20) self.pushButtonStockData.setFont(font) self.pushButtonStockData.setObjectName("pushButtonStockData") self.pushButtonStockStrategyBackTestinig = QtWidgets.QPushButton(self.centralWidget) self.pushButtonStockStrategyBackTestinig.setGeometry(QtCore.QRect(10, 110, 221, 91)) font = QtGui.QFont() font.setFamily("Arial") font.setPointSize(20) self.pushButtonStockStrategyBackTestinig.setFont(font) self.pushButtonStockStrategyBackTestinig.setObjectName("pushButtonStockStrategyBackTestinig") MainWindow.setCentralWidget(self.centralWidget) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow)
Example #27
Source File: ui_cmd_console_dlg.py From dash-masternode-tool with MIT License | 5 votes |
def setupUi(self, CmdConsoleDlg): CmdConsoleDlg.setObjectName("CmdConsoleDlg") CmdConsoleDlg.resize(468, 334) self.verticalLayout = QtWidgets.QVBoxLayout(CmdConsoleDlg) self.verticalLayout.setObjectName("verticalLayout") self.edtCmdLog = QtWidgets.QTextBrowser(CmdConsoleDlg) font = QtGui.QFont() font.setFamily("Courier New") font.setPointSize(12) font.setKerning(False) self.edtCmdLog.setFont(font) self.edtCmdLog.setLineWrapMode(QtWidgets.QTextEdit.WidgetWidth) self.edtCmdLog.setObjectName("edtCmdLog") self.verticalLayout.addWidget(self.edtCmdLog) self.label = QtWidgets.QLabel(CmdConsoleDlg) self.label.setObjectName("label") self.verticalLayout.addWidget(self.label) self.edtCommand = QtWidgets.QLineEdit(CmdConsoleDlg) self.edtCommand.setClearButtonEnabled(True) self.edtCommand.setObjectName("edtCommand") self.verticalLayout.addWidget(self.edtCommand) self.buttonBox = QtWidgets.QDialogButtonBox(CmdConsoleDlg) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Close) self.buttonBox.setObjectName("buttonBox") self.verticalLayout.addWidget(self.buttonBox) self.retranslateUi(CmdConsoleDlg) self.buttonBox.accepted.connect(CmdConsoleDlg.accept) self.buttonBox.rejected.connect(CmdConsoleDlg.reject) QtCore.QMetaObject.connectSlotsByName(CmdConsoleDlg)
Example #28
Source File: proposals_dlg.py From dash-masternode-tool with MIT License | 5 votes |
def data(self, index, role=None): if index.isValid(): col_idx = index.column() row_idx = index.row() if row_idx < len(self.votes) and col_idx < len(self.columns): vote = self.votes[row_idx] if vote: if role == Qt.DisplayRole: if col_idx == 0: # vote timestamp value = vote[0] if value is not None: return app_utils.to_string(value) else: return '' elif col_idx == 1: # YES/NO/ABSTAIN return vote[1] elif col_idx == 2: # voting masternode label return vote[2] elif col_idx == 3: # voting masternode config-name if exists in the user's configuration return vote[3] elif role == Qt.ForegroundRole: if col_idx == 1: if vote[1] == 'YES': return QCOLOR_YES elif vote[1] == 'NO': return QCOLOR_NO elif vote[1] == 'ABSTAIN': return QCOLOR_ABSTAIN elif role == Qt.FontRole: if col_idx == 1: font = QtGui.QFont() font.setBold(True) return font return QVariant()
Example #29
Source File: sourcewindow.py From dcc with Apache License 2.0 | 5 votes |
def __init__(self, parent=None, lines=[]): super(SourceDocument, self).__init__(parent) self.parent = parent self.setDefaultFont(QtGui.QFont('Monaco', 9, QtGui.QFont.Light)) cursor = QtGui.QTextCursor(self) # position=0x0 self.binding = {} # save the cursor position before each interesting element for section, L in lines: for t in L: if t[0] in BINDINGS_NAMES: self.binding[cursor.position()] = t cursor.insertText(t[1])
Example #30
Source File: globalmapwidget.py From PyPipboyApp with GNU General Public License v3.0 | 5 votes |
def __init__(self, widget, imageFactory, color, size, parent = None): super().__init__(widget.mapScene, widget.mapView, parent) self.markerType = 0 self.uid = 'playermarker' self.widget = widget self.imageFactory = imageFactory self.imageFilePath = os.path.join('res', 'mapmarkerplayer.svg') self.pipValueListenerDepth = 1 self.markerItem.setZValue(10) self.setColor(color,False) self.setSize(size, False) self.setLabelFont(QtGui.QFont("Times", 8, QtGui.QFont.Bold), False) self.setLabel('Player', False) self.doUpdate()