-
-
Save frueter/a5b722926a847c291d1472a6fd145dbf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PySide2 import QtWidgets, QtGui, QtCore | |
class PublishTable(QtWidgets.QTableWidget): | |
def paintEvent(self, event): | |
super(PublishTable, self).paintEvent(event) | |
painter = QtGui.QPainter(self) | |
gradient = QtGui.QLinearGradient(QtCore.QPoint(0,0), QtCore.QPoint(self.width()/2, 0)) | |
painter.setBrush(QtGui.QBrush(gradient)) | |
#painter.setPen(QtCore.Qt.transparent) | |
rect = QtCore.QRect(0, | |
0, | |
self.width()*.5, | |
self.height()) | |
painter.drawRect(rect) | |
if __name__ == '__main__': | |
import sys | |
args = sys.argv | |
app = QtWidgets.QApplication(args) | |
w = PublishTable() | |
w.show() | |
sys.exit(app.exec_()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment