Answers for "python execute cursor"

0

how to change cursor to hand in pyqt5

# simply use
your_widget.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))

# Example :
import sys
from PyQt5 import QtCore, QtGui
from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QVBoxLayout

app = QApplication(sys.argv)

window = QWidget()
window.setGeometry(300, 300, 400, 200)
window.show()

v = QVBoxLayout()
l1 = QLabel("This label now has pointing hand cursor")
l2 = QLabel("but this label has default cursor")
l1.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) # set cursor to pointing hand

v.addWidget(l1)
v.addWidget(l2)
window.setLayout(v)

app.exec_()
Posted by: Guest on November-16-2020
0

python cursor placement

print("33[6;3HHello")
Posted by: Guest on September-04-2020

Python Answers by Framework

Browse Popular Code Answers by Language