from PyQt5.
QtWidgets import (
QMainWindow, QLabel, QToolBar, QAction, QFileDialog, QMessageBox
from PyQt5.QtGui import QIcon
from PyQt5.QtCore import QSize
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("NVivo Clone")
self.setGeometry(100, 100, 1000, 700)
label = QLabel("Welcome to NVivo Clone", self)
label.move(40, 80)
self.create_toolbar()
def create_toolbar(self):
toolbar = QToolBar("Main Toolbar")
toolbar.setIconSize(QSize(24, 24))
self.addToolBar(toolbar)
# Add New Project action
new_action = QAction(QIcon(), "New Project", self)
new_action.triggered.connect(self.new_project)
toolbar.addAction(new_action)
# Add Open File action
open_action = QAction(QIcon(), "Open File", self)
open_action.triggered.connect(self.open_file)
toolbar.addAction(open_action)
def new_project(self):
QMessageBox.information(self, "New Project", "New project creation not
implemented yet.")
def open_file(self):
file_path, _ = QFileDialog.getOpenFileName(self, "Open File", "", "Text
Files (*.txt);;All Files (*)")
if file_path:
QMessageBox.information(self, "File Selected", f"You selected:\
n{file_path}")