本文整理汇总了Python中PyQt5.QtWidgets.QToolTip.setFont方法的典型用法代码示例。如果您正苦于以下问题:Python QToolTip.setFont方法的具体用法?Python QToolTip.setFont怎么用?Python QToolTip.setFont使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QToolTip
的用法示例。
在下文中一共展示了QToolTip.setFont方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt5.QtWidgets import QToolTip [as 别名]
# 或者: from PyQt5.QtWidgets.QToolTip import setFont [as 别名]
def __init__(self,parent=None):
QWidget.__init__(self, parent)
self.setGeometry(300,300,250,150)
self.setWindowTitle('Tooltip')
self.setToolTip('This is a <b> QWidget </b>widget')
QToolTip.setFont(QFont('oldEnglish',10))
示例2: gui_choise_server_client
# 需要导入模块: from PyQt5.QtWidgets import QToolTip [as 别名]
# 或者: from PyQt5.QtWidgets.QToolTip import setFont [as 别名]
def gui_choise_server_client(self):
self.hide_last_objects()
QToolTip.setFont(QFont('SansSerif', 10))
btn_server = QPushButton('Server', self)
btn_server.clicked.connect(self.server_set_socket_settings_gui) # from server.ServerMixin TODO аналогично
btn_server.resize(btn_server.sizeHint())
btn_server.move(50, 50)
btn_client = QPushButton('Client', self)
btn_client.clicked.connect(self.client_set_socket_settings_gui) # from client.ClientMixin
btn_client.resize(btn_client.sizeHint())
btn_client.move(150, 50)
btn_exit = QPushButton('Quit', self)
btn_exit.clicked.connect(QCoreApplication.instance().quit)
btn_exit.resize(btn_exit.sizeHint())
btn_exit.move(200, 170)
self.setGeometry(450, 300, 300, 200)
self.setWindowTitle('Client_Server')
self.show()
self.objects_to_hide = (btn_exit, btn_client, btn_server)
self.show_current_objects()
示例3: initUI
# 需要导入模块: from PyQt5.QtWidgets import QToolTip [as 别名]
# 或者: from PyQt5.QtWidgets.QToolTip import setFont [as 别名]
def initUI(self):
"""On definit une methode pour definir la fenetre graphique"""
#On definit la police et la taille du texte dans les bulles d'aide
QToolTip.setFont(QFont('SansSerif', 10))
#On definit le texte a afficher lors du passage sur la fenetre
self.setToolTip("Exemple de creation d'une <b>bulle</b> d'aide pour la fenetre")
#Creation d'un bouton
btn = QPushButton('Bouton', self)
#On met en place une bulle d'aide
btn.setToolTip("Voici un bouton inutile !")
#On redefinit la taille sur le texte, ici on applique une taille recommandée
btn.resize(btn.sizeHint())
btn.move(50, 50)
#Creation du bouton pour quitter la fenetre
qbtn = QPushButton('Quit', self)
#On connecte une action au clique
qbtn.clicked.connect(QCoreApplication.instance().quit)
#On met en place une bulle d'aide
btn.setToolTip("Ce bouton sert à quitter la fenetre !")
qbtn.resize(qbtn.sizeHint())
#Positionnement du bouton
qbtn.move(150, 150)
#Definition des attributs de la fenetre
self.setGeometry(300, 300, 300, 220)
self.setWindowTitle('PC2')
self.setWindowIcon(QIcon('PC2.png'))
示例4: initUI
# 需要导入模块: from PyQt5.QtWidgets import QToolTip [as 别名]
# 或者: from PyQt5.QtWidgets.QToolTip import setFont [as 别名]
def initUI(self):
QToolTip.setFont(QFont('SansSerif', 10))
btNewChecklist = QPushButton('Criar', self)
btNewChecklist.clicked.connect(self.salvarChecklist)
nomeLabel = QLabel('Nome')
self._nome = QLineEdit()
grid = QGridLayout()
grid.setSpacing(10)
grid.addWidget(nomeLabel, 1, 0)
grid.addWidget(self._nome, 1, 1)
grid.addWidget(btNewChecklist, 3, 1)
self.setLayout(grid)
self.setGeometry(300, 300, 350, 300)
self.center()
self.setWindowTitle('CheckList')
self.show()
示例5: initUI
# 需要导入模块: from PyQt5.QtWidgets import QToolTip [as 别名]
# 或者: from PyQt5.QtWidgets.QToolTip import setFont [as 别名]
def initUI(self):
QToolTip.setFont(QFont('SansSerif', 10))
self.setToolTip('This is a <b>QWidget</b> widget.')
exitAction = QAction(QIcon('application-exit-4.png'), '&Exit', self)
exitAction.setShortcut('Alt+F4')
exitAction.setStatusTip('Exit Application')
exitAction.triggered.connect(qApp.quit)
menuBar = self.menuBar()
fileMenu = menuBar.addMenu('&File')
fileMenu.addAction(exitAction)
self.toolbar = self.addToolBar('Exit')
self.toolbar.addAction(exitAction)
grid = QGridLayout()
lbl_1 = QLabel('1,1')
lbl_2 = QLabel('1,2')
lbl_3 = QLabel('2,1')
lbl_4 = QLabel('2,2')
grid.addWidget(lbl_1, 1, 1)
grid.addWidget(lbl_2, 1, 2)
grid.addWidget(lbl_3, 2, 1)
grid.addWidget(lbl_4, 2, 2)
mainW = QWidget()
mainW.setLayout(grid)
self.setCentralWidget(mainW)
self.statusBar().showMessage('Ready')
self.setGeometry(300, 300, 500, 500)
self.setWindowTitle('Photos')
self.setWindowIcon(QIcon('camera-photo-5.png'))
self.center()
self.show()
示例6: __init__
# 需要导入模块: from PyQt5.QtWidgets import QToolTip [as 别名]
# 或者: from PyQt5.QtWidgets.QToolTip import setFont [as 别名]
def __init__(self, title):
super().__init__()
self.setWindowTitle(title)
QToolTip.setFont(QFont('SansSerif', 10))
self.setGeometry(400, 400, 300, 200)
self.build_buttons()
self.show()
示例7: initUI
# 需要导入模块: from PyQt5.QtWidgets import QToolTip [as 别名]
# 或者: from PyQt5.QtWidgets.QToolTip import setFont [as 别名]
def initUI(self):
QToolTip.setFont(QFont('SansSerif', 10))
self.setToolTip('This is a <b>QWidget</b> widget.')
#quitBtn = QPushButton('Quit', self)
#quitBtn.clicked.connect(self.quitBtnEvent())
#quitBtn.clicked.connect(QCoreApplication.instance().quit)
#quitBtn.setToolTip('This is a <b>QPushButton</b> widget.')
#quitBtn.resize(quitBtn.sizeHint())
exitAction = QAction(QIcon('application-exit-4.png'), '&Exit', self)
exitAction.setShortcut('Alt+F4')
exitAction.setStatusTip('Exit Application')
exitAction.triggered.connect(qApp.quit)
menuBar = QMenuBar()
fileMenu = menuBar.addMenu('&File')
fileMenu.addAction(exitAction)
fileMenu.resize(fileMenu.sizeHint())
toolBar = QToolBar(self)
toolBar.addAction(exitAction)
#toolBar.resize(toolBar.sizeHint())
toolBar.setFixedHeight(60)
hozLine = QFrame()
hozLine.setFrameStyle(QFrame.HLine)
#hozLine.setSizePolicy(QSizePolicy.Minimum,QSizePolicy.Expanding)
statusBar = QStatusBar(self)
statusBar.showMessage('Ready')
grid = QGridLayout()
lbl_1 = QLabel('1,1')
lbl_2 = QLabel('1,2')
lbl_3 = QLabel('2,1')
lbl_4 = QLabel('2,2')
grid.addWidget(lbl_1, 1, 1)
grid.addWidget(lbl_2, 1, 2)
grid.addWidget(lbl_3, 2, 1)
grid.addWidget(lbl_4, 2, 2)
vbox = QVBoxLayout()
vbox.addWidget(menuBar)
vbox.addWidget(hozLine)
vbox.addWidget(toolBar)
# vbox.addWidget(hozLine)
vbox.addLayout(grid)
vbox.addStretch(1)
vbox.addWidget(statusBar)
self.setLayout(vbox)
self.setGeometry(300, 300, 500, 500)
self.setWindowTitle('Photos')
self.setWindowIcon(QIcon('camera-photo-5.png'))
self.center()
self.show()
示例8: initUI
# 需要导入模块: from PyQt5.QtWidgets import QToolTip [as 别名]
# 或者: from PyQt5.QtWidgets.QToolTip import setFont [as 别名]
def initUI(self):
QToolTip.setFont(QFont('SansSerif', 10))
self.setToolTip('This is my widget')
btn = QPushButton('Push me', self)
btn.setToolTip('This is a button')
btn.resize(btn.sizeHint())
btn.move(50, 50)
self.setGeometry(300, 300, 300, 300)
self.setWindowTitle('Tooltip test')
self.show()
示例9: initUI
# 需要导入模块: from PyQt5.QtWidgets import QToolTip [as 别名]
# 或者: from PyQt5.QtWidgets.QToolTip import setFont [as 别名]
def initUI(self):
QToolTip.setFont(QFont('SansSerif',10))
self.setToolTip('This is a <b>widget</b>')
btn=QPushButton('push',self)
btn.setToolTip('press and push')
btn.resize(btn.sizeHint())
btn.move(40,50)
self.setGeometry(200,300,400,500)
self.setWindowTitle('setToolTip')
self.show()
示例10: initUI
# 需要导入模块: from PyQt5.QtWidgets import QToolTip [as 别名]
# 或者: from PyQt5.QtWidgets.QToolTip import setFont [as 别名]
def initUI(self):
"""Draw the UI."""
QToolTip.setFont(QFont('SansSerif', 12))
grid = QGridLayout()
self.setLayout(grid)
lbl_source = QLabel('Source:', self)
lbl_source.setAlignment(Qt.AlignCenter)
lbl_destination = QLabel('Destination:', self)
lbl_destination.setAlignment(Qt.AlignCenter)
self.cmb_source = QComboBox(self)
self.populate_cmb_source()
self.cmb_source.activated.connect(self.source_activated)
self.cmb_source.setToolTip("Select either a source USB device "
"or a source 'nb' backup directory")
self.cmb_destination = QComboBox(self)
self.populate_cmb_destination()
self.cmb_destination.activated.connect(self.destination_activated)
self.cmb_destination.setToolTip('Select a destination USB device')
self.lbl_status = QLabel('', self)
self.lbl_status.setAlignment(Qt.AlignLeft)
self.btn_copy = QPushButton('Copy', self)
# self.btn_copy.setFixedWidth(80)
self.btn_copy.setFixedWidth(self.btn_copy.width())
self.btn_copy.clicked.connect(self.start_copy)
self.btn_copy.setEnabled(False)
hbox = QHBoxLayout()
hbox.addWidget(self.lbl_status, Qt.AlignLeft)
hbox.addStretch(1)
hbox.addWidget(self.btn_copy, Qt.AlignRight)
hbox.maximumSize()
grid.addWidget(lbl_source, 0, 0, Qt.AlignRight)
grid.addWidget(self.cmb_source, 0, 1)
grid.addWidget(lbl_destination, 1, 0, Qt.AlignRight)
grid.addWidget(self.cmb_destination, 1, 1)
grid.addLayout(hbox, 2, 1)
grid.setColumnStretch(0, 0)
grid.setColumnStretch(1, 1)
self.setWindowTitle('%s %s' % (ProgName, ProgVersion))
self.setMinimumWidth(MinimumWidth)
self.show()
self.setFixedHeight(self.height())
示例11: initUI
# 需要导入模块: from PyQt5.QtWidgets import QToolTip [as 别名]
# 或者: from PyQt5.QtWidgets.QToolTip import setFont [as 别名]
def initUI(self):
QToolTip.setFont(QFont('SansSerif', 40))
self.setGeometry(300,250,360,400)
self.setWindowTitle('Instructions')
self.toshow = QTextBrowser(self)
self.toshow.resize(270,300)
self.toshow.move(30,20)
self.toshow.setText('good')
# self.toshow.setText('\n'.join(self.s))
self.show()
示例12: initUI
# 需要导入模块: from PyQt5.QtWidgets import QToolTip [as 别名]
# 或者: from PyQt5.QtWidgets.QToolTip import setFont [as 别名]
def initUI(self):
QToolTip.setFont(QFont('SanSerif', 10))
self.setToolTip('This is a <b>QWidget</b> widget')
btn = QPushButton('Button', self)
btn.setToolTip('This is a <b>QPushButton</b> widget')
btn.resize(btn.sizeHint())
btn.move(50, 50)
self.setGeometry(300, 300, 300, 200)
self.setWindowTitle('Tooltips')
self.show()
示例13: initUI
# 需要导入模块: from PyQt5.QtWidgets import QToolTip [as 别名]
# 或者: from PyQt5.QtWidgets.QToolTip import setFont [as 别名]
def initUI(self):
hbox = QHBoxLayout(self)
pixmap = QPixmap('owi_robot_hand_2.2.png')
lbl = QLabel(self)
lbl.setPixmap(pixmap)
hbox.addWidget(lbl)
self.setLayout(hbox)
QToolTip.setFont(QFont('SansSerif',14))
self.setToolTip('')
self.setGeometry(300, 300,1280, 720)
self.setWindowTitle('Owi Robot Hand Controler _v4')
self.setWindowIcon(QIcon('python.png'))
self.show()
示例14: initUI
# 需要导入模块: from PyQt5.QtWidgets import QToolTip [as 别名]
# 或者: from PyQt5.QtWidgets.QToolTip import setFont [as 别名]
def initUI(self):
QToolTip.setFont(QFont('SansSerif', 10))
self.setToolTip('This is a widget')
btn = QPushButton('Button', self)
btn.setToolTip('This is a button')
btn.resize(btn.sizeHint())
btn.move(50, 50)
self.setGeometry(700, 300, 500, 200)
self.setWindowTitle('Lilya\'s first widget')
self.show()
示例15: init_ui
# 需要导入模块: from PyQt5.QtWidgets import QToolTip [as 别名]
# 或者: from PyQt5.QtWidgets.QToolTip import setFont [as 别名]
def init_ui(self):
QToolTip.setFont(QFont("SansSerif", 10))
self.setToolTip("This is a <b>QWidget</b> widget")
btn = QPushButton("ЙА КНОПКО!!!", self)
btn.setToolTip("Это <b>КНОПКО</b>, причем даже на русском языке, " "запиленное 1го января 2016года")
btn.resize(btn.sizeHint())
btn.move(50, 50)
self.setGeometry(300, 300, 300, 200)
self.setWindowTitle("Тестовое приложенько")
self.show()