Guest User

Untitled

a guest
Jun 20th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. first_row = QtGui.QHBoxLayout()
  2.  
  3. setings_search = QtGui.QVBoxLayout()
  4. search_label = QtGui.QLabel()
  5. search_pixmap = QtGui.QPixmap()
  6. search_pixmap.load('search.png')
  7.  
  8. #search_pixmap.scaledToWidth(130)
  9. #search_pixmap.scaledToHeight(130)
  10.  
  11. search_label.setPixmap(search_pixmap)
  12.  
  13. setings_search.addWidget(search_label)
  14. first_row.addLayout(setings_search)
  15.  
  16. from PyQt4 import QtGui
  17.  
  18. app = QtGui.QApplication([])
  19.  
  20. label = QtGui.QLabel()
  21.  
  22. pixmap = QtGui.QPixmap()
  23. pixmap.load('test.png')
  24. pixmap = pixmap.scaledToWidth(20)
  25. label.setPixmap(pixmap)
  26.  
  27. label.show()
  28.  
  29. app.exec_()
  30.  
  31. def paintEvent(self, event):
  32. qp = QtGui.QPainter()
  33. search_pixmap = QtGui.QPixmap('search.png')
  34. qp.drawPixmap(posX, posY, width, height, pixmap.scaled(width, height, transformMode=QtCore.Qt.SmoothTransformation))
Add Comment
Please, Sign In to add comment