Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- from PySide2.QtWidgets import *
- class MainWindow(QMainWindow):
- def __init__(self, parent = None):
- super(MainWindow, self).__init__()
- self.curFile = ''
- self.initUI()
- def initUI(self):
- import findModeWidget
- # x and y coordinates on the screen, width, height
- self.setGeometry(100,100,1030,800)
- self.setWindowTitle("ManyNotes")
- self.switchNotebookButton = QPushButton('Test', self)
- self.switchNotebookButton.clicked.connect(self.findMode)
- layout = QVBoxLayout(self)
- layout.addWidget(self.switchNotebookButton)
- def resizeEvent(self, event):
- theWidth = self.width()
- theHeight = self.height()
- self.switchNotebookButton.setGeometry(theWidth - 100, theHeight - 100, 100, 150)
- def findMode(self):
- theWidth = self.width()
- theHeight = self.height()
- self.switchNotebookButton.setGeometry(theWidth - 100, theHeight - 100, 100, 150)
- def main():
- app = QApplication(sys.argv)
- main = MainWindow()
- main.show()
- sys.exit(app.exec_())
- if __name__ == "__main__":
- main()
Add Comment
Please, Sign In to add comment