Updated todo list, understanding menubar, buttons and shortcuts for buttons.

This commit is contained in:
coyote 2022-01-03 06:48:31 +01:00
parent f26a5f2caf
commit 6eebf6df20
5 changed files with 213 additions and 0 deletions

View File

@ -3,6 +3,10 @@
El objetivo del proyecto es de hacer un programa de simulacion gravitacional de N-cuerpos en 2D y 3D.
## TO-DO
- [ ] 1 pendulo
- [ ] 1 pendulo mas 1 pendulo
- [ ] 3 pendulos y 4 pendulos
- [ ] Iniciar interfaz grafica para elegir simulacion.
- [ ] Simulacion en 2D
- [ ] Simulacion de 2 cuerpos
- [ ] Visualizacion de cuerpos (matplotlib)

View File

@ -0,0 +1,96 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'QtDesigner_intro/test2.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(800, 600)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.label = QtWidgets.QLabel(self.centralwidget)
self.label.setGeometry(QtCore.QRect(240, 140, 341, 201))
font = QtGui.QFont()
font.setPointSize(36)
self.label.setFont(font)
self.label.setScaledContents(False)
self.label.setObjectName("label")
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 23))
self.menubar.setObjectName("menubar")
self.menuFile = QtWidgets.QMenu(self.menubar)
self.menuFile.setObjectName("menuFile")
self.menuEdit = QtWidgets.QMenu(self.menubar)
self.menuEdit.setObjectName("menuEdit")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.actionNew = QtWidgets.QAction(MainWindow)
self.actionNew.setShortcut("")
self.actionNew.setObjectName("actionNew")
self.actionSave = QtWidgets.QAction(MainWindow)
self.actionSave.setObjectName("actionSave")
self.actionCopy = QtWidgets.QAction(MainWindow)
self.actionCopy.setObjectName("actionCopy")
self.actionPaste = QtWidgets.QAction(MainWindow)
self.actionPaste.setObjectName("actionPaste")
self.menuFile.addAction(self.actionNew)
self.menuFile.addAction(self.actionSave)
self.menuEdit.addAction(self.actionCopy)
self.menuEdit.addAction(self.actionPaste)
self.menubar.addAction(self.menuFile.menuAction())
self.menubar.addAction(self.menuEdit.menuAction())
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
self.actionNew.triggered.connect(lambda: self.clicked("New was clicked"))
self.actionSave.triggered.connect(lambda: self.clicked("Save was clicked"))
self.actionCopy.triggered.connect(lambda: self.clicked("Copy was clicked"))
self.actionPaste.triggered.connect(lambda: self.clicked("Paste was clicked"))
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
self.label.setText(_translate("MainWindow", "TextLabel"))
self.menuFile.setTitle(_translate("MainWindow", "File"))
self.menuEdit.setTitle(_translate("MainWindow", "Edit"))
self.actionNew.setText(_translate("MainWindow", "New"))
self.actionNew.setStatusTip(_translate("MainWindow", "Create a new file."))
self.actionNew.setShortcut(_translate("MainWindow", "Ctrl+N"))
self.actionSave.setText(_translate("MainWindow", "Save"))
self.actionSave.setStatusTip(_translate("MainWindow", "Save a file."))
self.actionSave.setShortcut(_translate("MainWindow", "Ctrl+S"))
self.actionCopy.setText(_translate("MainWindow", "Copy"))
self.actionCopy.setStatusTip(_translate("MainWindow", "Copy a file."))
self.actionCopy.setShortcut(_translate("MainWindow", "Ctrl+C"))
self.actionPaste.setText(_translate("MainWindow", "Paste"))
self.actionPaste.setStatusTip(_translate("MainWindow", "Paste new file."))
self.actionPaste.setShortcut(_translate("MainWindow", "Ctrl+V"))
def clicked(self, text):
self.label.setText(text)
self.label.adjustSize()
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_())

View File

@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget">
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>240</x>
<y>140</y>
<width>341</width>
<height>201</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>36</pointsize>
</font>
</property>
<property name="text">
<string>TextLabel</string>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
</widget>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>23</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
<property name="title">
<string>File</string>
</property>
<addaction name="actionNew"/>
<addaction name="actionSave"/>
</widget>
<widget class="QMenu" name="menuEdit">
<property name="title">
<string>Edit</string>
</property>
<addaction name="actionCopu"/>
<addaction name="actionPaste"/>
</widget>
<addaction name="menuFile"/>
<addaction name="menuEdit"/>
</widget>
<widget class="QStatusBar" name="statusbar"/>
<action name="actionNew">
<property name="text">
<string>New</string>
</property>
<property name="statusTip">
<string>Create a new file.</string>
</property>
<property name="shortcut">
<string/>
</property>
</action>
<action name="actionSave">
<property name="text">
<string>Save</string>
</property>
<property name="statusTip">
<string>Save a file.</string>
</property>
<property name="shortcut">
<string>Ctrl+S</string>
</property>
</action>
<action name="actionCopu">
<property name="text">
<string>Copt</string>
</property>
<property name="statusTip">
<string>Copy a file.</string>
</property>
<property name="shortcut">
<string>Ctrl+C</string>
</property>
</action>
<action name="actionPaste">
<property name="text">
<string>Paste</string>
</property>
<property name="statusTip">
<string>Paste new file.</string>
</property>
<property name="shortcut">
<string>Ctrl+V</string>
</property>
</action>
</widget>
<resources/>
<connections/>
</ui>