Answer to Question #211652 in Python for Dorcus

Question #211652

You are required to develop a Multiple Document Interface application for the following scenario:

An MDI consists of a main window with a menu bar, toolbar and central workspace widget. You are required to develop a basic tourism event management application for your community that displays information of events,venues and bookings(reservation).Dates and start times are required for the events.Venue capacity, address and contact detail of event manager must be recorded for each venue.Client information in terms of name, and contact details must also be managed by your program.Store all your data in text files.

Make use of at least of the following widget.

QMenubar

QFileDialog

Any widgets used to date that may be usefull


1
Expert's answer
2021-06-29T00:13:27-0400
from PyQt5.QtWidgets import QApplication, QMainWindow, QMdiArea, QAction, QMdiSubWindow, QTextEdit
import sys

class MyWindow(QMainWindow):
    def __init__(self):
        super().__init__()


        self.mdi = QMdiArea()
        self.setCentralWidget(self.mdi)
        bar = self.menuBar()


        file = bar.addMenu("File")
        file.addAction("New")
        file.addAction("Save")
        file.addAction("Exit")
        file.triggered[QAction].connect(self.WindowTrig)
        self.setWindowTitle("Tourism event management application")


    def WindowTrig(self, t):

        if t.text() == "New":
            sub = QMdiSubWindow()
            sub.setWidget(QTextEdit())
            self.mdi.addSubWindow(sub)
            sub.show()

app = QApplication(sys.argv)
mdi  =MDIWindow()
mdi.show()
app.exec_()

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS