Guest User

main.py

a guest
Nov 23rd, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. import sys
  2. from PySide2.QtWidgets import *
  3.  
  4.  
  5. class MainWindow(QMainWindow):
  6.  
  7.  
  8. def __init__(self, parent = None):
  9. super(MainWindow, self).__init__()
  10.  
  11. self.curFile = ''
  12.  
  13. self.initUI()
  14.  
  15. def initUI(self):
  16. import findModeWidget
  17.  
  18. # x and y coordinates on the screen, width, height
  19. self.setGeometry(100,100,1030,800)
  20.  
  21. self.setWindowTitle("ManyNotes")
  22.  
  23. self.switchNotebookButton = QPushButton('Test', self)
  24. self.switchNotebookButton.clicked.connect(self.findMode)
  25. layout = QVBoxLayout(self)
  26. layout.addWidget(self.switchNotebookButton)
  27.  
  28. def resizeEvent(self, event):
  29.  
  30. theWidth = self.width()
  31. theHeight = self.height()
  32.  
  33. self.switchNotebookButton.setGeometry(theWidth - 100, theHeight - 100, 100, 150)
  34.  
  35.  
  36. def findMode(self):
  37. theWidth = self.width()
  38. theHeight = self.height()
  39.  
  40. self.switchNotebookButton.setGeometry(theWidth - 100, theHeight - 100, 100, 150)
  41.  
  42.  
  43.  
  44.  
  45. def main():
  46.  
  47. app = QApplication(sys.argv)
  48.  
  49. main = MainWindow()
  50. main.show()
  51.  
  52. sys.exit(app.exec_())
  53.  
  54.  
  55.  
  56. if __name__ == "__main__":
  57. main()
Add Comment
Please, Sign In to add comment