From 92d47d8b3fd8a443f6763394d6b219369ccf9622 Mon Sep 17 00:00:00 2001 From: Pratyanj Date: Fri, 6 Jun 2025 11:29:34 +0530 Subject: [PATCH 1/9] bd creating error solve --- bank_managment_system/backend.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bank_managment_system/backend.py b/bank_managment_system/backend.py index 42475416fa0..7ea679863b5 100644 --- a/bank_managment_system/backend.py +++ b/bank_managment_system/backend.py @@ -1,12 +1,11 @@ import sqlite3 - +import os # Making connection with database def connect_database(): global conn global cur - conn = sqlite3.connect("bankmanaging.db") + conn = sqlite3.connect(os.path.join(os.path.dirname(__file__), "bankmanaging.db")) cur = conn.cursor() - cur.execute( """ CREATE TABLE IF NOT EXISTS bank ( From 28a792b9aa8289ae2b915cbef7afd99e798c44ea Mon Sep 17 00:00:00 2001 From: Pratyanj Date: Fri, 6 Jun 2025 12:16:39 +0530 Subject: [PATCH 2/9] update employee data page finish --- bank_managment_system/QTFrontend.py | 113 ++++++++++++++++++++++++---- 1 file changed, 98 insertions(+), 15 deletions(-) diff --git a/bank_managment_system/QTFrontend.py b/bank_managment_system/QTFrontend.py index 08fa1143ef5..443276df1fe 100644 --- a/bank_managment_system/QTFrontend.py +++ b/bank_managment_system/QTFrontend.py @@ -3,6 +3,7 @@ import sys import backend backend.connect_database() +employee_data = None def create_styled_frame(parent, min_size=None, style=""): """Create a styled QFrame with optional minimum size and custom style.""" frame = QtWidgets.QFrame(parent) @@ -68,6 +69,7 @@ def create_input_field(parent, label_text, min_label_size=(120, 0)): layout.addWidget(label) layout.addWidget(line_edit) return frame, line_edit + def show_popup_message(parent, message: str, page: int = None, show_cancel: bool = True): """Reusable popup message box. @@ -131,6 +133,7 @@ def on_reject(): button_box.rejected.connect(on_reject) dialog.exec_() + def get_employee_name(parent, name_field_text="Enter Employee Name"): page, main_layout = create_page_with_header(parent, "Employee Data Update") @@ -152,18 +155,28 @@ def get_employee_name(parent, name_field_text="Enter Employee Name"): main_layout.addWidget(content_frame) def on_search_button_clicked(): + global employee_data entered_name = name_field.text().strip() + print(f"Entered Name: {entered_name}") if not entered_name: QtWidgets.QMessageBox.warning(parent, "Input Error", "Please enter an employee name.") return try: - cur = backend.cur - cur.execute("SELECT * FROM staff WHERE name = ?", (entered_name,)) - fetch = cur.fetchone() - if fetch: - QtWidgets.QMessageBox.information(parent, "Employee Found", - f"Employee data:\nID: {fetch[0]}\nName: {fetch[1]}\nDept: {fetch[2]}\nRole: {fetch[3]}") + employee_check = backend.check_name_in_staff(entered_name) + print(f"Employee Check: {type(employee_check)},{employee_check}") + if employee_check: + cur = backend.cur + cur.execute("SELECT * FROM staff WHERE name = ?", (entered_name,)) + employee_data = cur.fetchone() + print(f"Employee Data: {employee_data}") + parent.setCurrentIndex(6) + + # if employee_data: + # QtWidgets.QMessageBox.information(parent, "Employee Found", + # f"Employee data:\nID: {fetch[0]}\nName: {fetch[1]}\nDept: {fetch[2]}\nRole: {fetch[3]}") + + else: QtWidgets.QMessageBox.information(parent, "Not Found", "Employee not found.") except Exception as e: @@ -175,6 +188,7 @@ def on_search_button_clicked(): #backend.check_name_in_staff() + def create_login_page(parent ,title, name_field_text="Name :", password_field_text="Password :", submit_text="Submit",): """Create a login page with a title, name and password fields, and a submit button.""" page, main_layout = create_page_with_header(parent, "Admin Menu") @@ -210,6 +224,7 @@ def create_login_page(parent ,title, name_field_text="Name :", password_field_te return page, name_edit, password_edit, submit_button + def on_login_button_clicked(parent, name_field, password_field): name = name_field.text().strip() password = password_field.text().strip() @@ -277,6 +292,7 @@ def create_home_page(parent, on_admin_clicked, on_employee_clicked, on_exit_clic exit_button.clicked.connect(on_exit_clicked) return page + def create_page_with_header(parent, title_text): """Create a page with a styled header and return the page + main layout.""" page = QtWidgets.QWidget(parent) @@ -291,6 +307,7 @@ def create_page_with_header(parent, title_text): main_layout.addWidget(header_frame, 0, QtCore.Qt.AlignTop) return page, main_layout + def create_admin_menu_page(parent): page, main_layout = create_page_with_header(parent, "Admin Menu") @@ -315,7 +332,6 @@ def create_admin_menu_page(parent): main_layout.addWidget(button_frame) return page, *buttons # Unpack as add_button, update_employee, etc. - def create_add_employee_page(parent, title, submit_text="Submit",update_btn:bool=False): page, main_layout = create_page_with_header(parent, title) @@ -330,21 +346,32 @@ def create_add_employee_page(parent, title, submit_text="Submit",update_btn:bool # Define input fields fields = ["Name :", "Password :", "Salary :", "Position :"] + name_edit = None + password_edit = None + salary_edit = None + position_edit = None edits = [] - for field in fields: + for i, field in enumerate(fields): field_frame, field_edit = create_input_field(form_frame, field) form_layout.addWidget(field_frame) + if i == 0: + name_edit = field_edit + elif i == 1: + password_edit = field_edit + elif i == 2: + salary_edit = field_edit + elif i == 3: + position_edit = field_edit edits.append(field_edit) - # Submit button button_frame = create_styled_frame(form_frame, style="padding: 7px;") button_layout = QtWidgets.QVBoxLayout(button_frame) if update_btn: - update_button = create_styled_button(button_frame, "Update", min_size=(150, 0)) + update_button = create_styled_button(button_frame, "Update", min_size=(100, 50)) button_layout.addWidget(update_button, 0, QtCore.Qt.AlignHCenter) else: - submit_button = create_styled_button(button_frame, submit_text, min_size=(150, 0)) + submit_button = create_styled_button(button_frame, submit_text, min_size=(100, 50)) button_layout.addWidget(submit_button, 0, QtCore.Qt.AlignHCenter) @@ -352,9 +379,9 @@ def create_add_employee_page(parent, title, submit_text="Submit",update_btn:bool content_layout.addWidget(form_frame, 0, QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter) main_layout.addWidget(content_frame) if update_btn: - return page, *edits, update_button + return page, name_edit, password_edit, salary_edit, position_edit, update_button else: - return page, *edits, submit_button # Unpack as name_edit, password_edit, etc. + return page, name_edit, password_edit, salary_edit, position_edit, submit_button # Unpack as name_edit, password_edit, etc. def setup_main_window(main_window): """Set up the main window with a stacked widget containing home, admin, and employee pages.""" @@ -474,10 +501,65 @@ def fetch_employee_data(name): update_employee_page1 = get_employee_name(stacked_widget) # apply the update_employee_data function to the submit button + update_employee_page2 ,update_employee_name, update_employee_password, update_employee_salary, update_employee_position,update_employee_update = create_add_employee_page(stacked_widget,"Update Employee Details",update_btn=True) + def populate_employee_data(): + global employee_data + if employee_data: + print("employee_data is not None") + update_employee_name.setText(str(employee_data[0])) # Name + update_employee_password.setText(str(employee_data[1])) # Password + update_employee_salary.setText(str(employee_data[2])) # Salary + update_employee_position.setText(str(employee_data[3])) # Position + else: + # Clear fields if no employee data is available + print("employee_data is None") + update_employee_name.clear() + update_employee_password.clear() + update_employee_salary.clear() + update_employee_position.clear() + QtWidgets.QMessageBox.warning(stacked_widget, "No Data", "No employee data available to display.") + def on_page_changed(index): + if index == 6: # update_employee_page2 is at index 6 + populate_employee_data() + + # Connect the currentChanged signal to the on_page_changed function + stacked_widget.currentChanged.connect(on_page_changed) + def update_employee_data(name, password, salary, position, name_to_update): + try: + if not name_to_update: + show_popup_message(stacked_widget, "Original employee name is missing.", 5) + return + if not (name or password or salary or position): + show_popup_message(stacked_widget, "Please fill at least one field to update.", 5) + return + if name: + backend.update_employee_name(name, name_to_update) + if password: + backend.update_employee_password(password, name_to_update) + if salary: + try: + salary = int(salary) + backend.update_employee_salary(salary, name_to_update) + except ValueError: + show_popup_message(stacked_widget, "Salary must be a valid number.", 5) + return + if position: + backend.update_employee_position(position, name_to_update) + show_popup_message(stacked_widget, "Employee updated successfully.", 3, False) + except Exception as e: + show_popup_message(stacked_widget, f"Error updating employee: {str(e)}", 5) + update_employee_update.clicked.connect( + lambda: update_employee_data( + update_employee_name.text().strip(), + update_employee_password.text().strip(), + update_employee_salary.text().strip(), + update_employee_position.text().strip(), + employee_data[0] if employee_data else "" + ) + ) + - - # /////////////////////////// emp_submit.clicked.connect( lambda: add_employee_form_submit( emp_name.text(), @@ -501,6 +583,7 @@ def fetch_employee_data(name): stacked_widget.addWidget(admin_menu_page)#3 stacked_widget.addWidget(add_employee_page)#4 stacked_widget.addWidget(update_employee_page1)#5 + stacked_widget.addWidget(update_employee_page2)#6 main_layout.addWidget(stacked_widget) main_window.setCentralWidget(central_widget) From e68f3c2c606c794add7055902a92e8b0862b117e Mon Sep 17 00:00:00 2001 From: Pratyanj Date: Sat, 7 Jun 2025 11:04:39 +0530 Subject: [PATCH 3/9] GUI done --- Emoji Dictionary/QT_GUI.py | 53 +++++ Emoji Dictionary/QT_GUI.ui | 407 +++++++++++++++++++++++++++++++++++++ 2 files changed, 460 insertions(+) create mode 100644 Emoji Dictionary/QT_GUI.py create mode 100644 Emoji Dictionary/QT_GUI.ui diff --git a/Emoji Dictionary/QT_GUI.py b/Emoji Dictionary/QT_GUI.py new file mode 100644 index 00000000000..fc6ece76e86 --- /dev/null +++ b/Emoji Dictionary/QT_GUI.py @@ -0,0 +1,53 @@ + +# -*- coding: utf-8 -*- + +import sys +from PyQt5.QtCore import * +from PyQt5.QtGui import * +from PyQt5.QtWidgets import * +from PyQt5 import uic + +class MainWindow(QMainWindow): + def __init__(self): + super(MainWindow, self).__init__() + + # Load the UI file + uic.loadUi('Emoji Dictionary/QT_GUI.ui', self) + cells = [ + ["๐Ÿ˜€", "๐Ÿฅฐ", "๐Ÿ˜ด", "๐Ÿค“", "๐Ÿคฎ", "๐Ÿคฌ", "๐Ÿ˜จ", "๐Ÿค‘", "๐Ÿ˜ซ", "๐Ÿ˜Ž"], + ["๐Ÿ’", "๐Ÿ•", "๐ŸŽ", "๐Ÿช", "๐Ÿ", "๐Ÿ˜", "๐Ÿฆ˜", "๐Ÿฆˆ", "๐Ÿ“", "๐Ÿ", "๐Ÿ‘€", "๐Ÿฆด", "๐Ÿ‘ฉ๐Ÿฟ", "โ€๐Ÿค", "๐Ÿง‘", "๐Ÿพ", "๐Ÿ‘ฑ๐Ÿฝ", "โ€โ™€", "๐ŸŽž", "๐ŸŽจ", "โšฝ"], + ["๐Ÿ•", "๐Ÿ—", "๐Ÿœ", "โ˜•", "๐Ÿด", "๐Ÿ‰", "๐Ÿ“", "๐ŸŒด", "๐ŸŒต", "๐Ÿ›บ", "๐Ÿšฒ", "๐Ÿ›ด", "๐Ÿš‰", "๐Ÿš€", "โœˆ", "๐Ÿ›ฐ", "๐Ÿšฆ", "๐Ÿณ", "โ€๐ŸŒˆ", "๐ŸŒŽ", "๐Ÿงญ"], + ["๐Ÿ”ฅ", "โ„", "๐ŸŒŸ", "๐ŸŒž", "๐ŸŒ›", "๐ŸŒ", "๐ŸŒง", "๐Ÿงบ", "๐Ÿงท", "๐Ÿช’", "โ›ฒ", "๐Ÿ—ผ", "๐Ÿ•Œ", "๐Ÿ‘", "โ€๐Ÿ—จ", "๐Ÿ’ฌ", "โ„ข", "๐Ÿ’ฏ", "๐Ÿ”•", "๐Ÿ’ฅ", "โค"] + ] + + self.emoji_buttons = [] + self.emoji_layout = QGridLayout() + self.emoji_widget = QWidget() + self.emoji_widget.setLayout(self.emoji_layout) + self.frame_2.setLayout(QVBoxLayout()) + self.frame_2.layout().addWidget(self.emoji_widget) + self.emoji_widget.hide() + self.pushButton.clicked.connect(lambda: self.emoji_widget.show()) + + for row_idx, row in enumerate(cells): + for col_idx, emoji in enumerate(row): + button = QPushButton(emoji) + button.setFixedSize(40, 40) + button.setStyleSheet(""" + QPushButton { + background-color: #ffffff; + border: 1px solid #e0e0e0; + border-radius: 5px; + } + QPushButton:hover { + background-color: #f0f0f0; + } + """) + # button.clicked.connect(lambda checked, e=emoji: self.emoji_clicked(e)) + self.emoji_layout.addWidget(button, row_idx, col_idx) + self.emoji_buttons.append(button) +if __name__ == '__main__': + app = QApplication(sys.argv) + window = MainWindow() + window.show() + sys.exit(app.exec_()) diff --git a/Emoji Dictionary/QT_GUI.ui b/Emoji Dictionary/QT_GUI.ui new file mode 100644 index 00000000000..dc87c8dbc0a --- /dev/null +++ b/Emoji Dictionary/QT_GUI.ui @@ -0,0 +1,407 @@ + + + MainWindow + + + + 0 + 0 + 948 + 527 + + + + MainWindow + + + background-color: #f0f2f5; + + + + background-color: transparent; + + + + 8 + + + 10 + + + 10 + + + 10 + + + 10 + + + + + background-color: #ffffff; + border-radius: 10px; + padding: 15px; + box-shadow: 0 2px 4px rgba(0,0,0,0.1); + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 30 + + + + color: #1a73e8; + padding: 10px; + + + EMOJI DICTIONARY + + + Qt::AlignCenter + + + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + background-color: transparent; + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 20 + + + + color: #333333; + padding: 10px; + + + Enter any Emoji you want to search... + + + + + + + background-color: #ffffff; + border-radius: 8px; + box-shadow: 0 2px 4px rgba(0,0,0,0.1); + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + -1 + + + + QLineEdit { + border: 1px solid #dcdcdc; + border-radius: 5px; + padding: 8px; + font-size: 14px; + background-color: #fafafa; + } + QLineEdit:focus { + border-color: #1a73e8; + background-color: #ffffff; + } + + + + + + + true + + + + -1 + 62 + true + + + + QPushButton { + background-color: #1a73e8; + color: white; + border-radius: 5px; + padding: 8px; + font-size: 14px; + font-weight: 500; + } + QPushButton:hover { + background-color: #1557b0; + } + QPushButton:pressed { + background-color: #104080; + } + + + Emoji Board + + + + + + + + + + background-color: transparent; + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + -1 + 62 + true + + + + QPushButton { + background-color: #34c759; + color: white; + border-radius: 5px; + padding: 8px; + font-size: 14px; + font-weight: 500; + } + QPushButton:hover { + background-color: #2ea44f; + } + QPushButton:pressed { + background-color: #26833b; + } + + + ๐Ÿ” Search + + + + + + + + -1 + 62 + true + + + + QPushButton { + background-color: #ff3b30; + color: white; + border-radius: 5px; + padding: 8px; + font-size: 14px; + font-weight: 500; + } + QPushButton:hover { + background-color: #cc2f27; + } + QPushButton:pressed { + background-color: #99231f; + } + + + ๐Ÿงน Clear + + + + + + + + + + + + + + 0 + 0 + + + + background-color: #ffffff; + border-radius: 10px; + box-shadow: 0 2px 4px rgba(0,0,0,0.1); + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 16 + 50 + false + + + + color: #333333; + padding-bottom: 10px; + + + Meaning... + + + + + + + + -1 + + + + QTextEdit { + border: 1px solid #dcdcdc; + border-radius: 5px; + padding: 10px; + font-size: 14px; + background-color: #fafafa; + } + QTextEdit:focus { + border-color: #1a73e8; + background-color: #ffffff; + } + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:14px; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:20pt;"><br /></p></body></html> + + + + + + + + 140 + 40 + + + + + -1 + 62 + true + + + + QPushButton { + background-color: #ff9500; + color: white; + border-radius: 5px; + padding: 10px; + font-size: 14px; + font-weight: 500; + } + QPushButton:hover { + background-color: #cc7700; + } + QPushButton:pressed { + background-color: #995900; + } + + + EXIT + + + + + + + + + + + + From 9e91388d562fc98456eb7d34bae4216ac7b9e6b8 Mon Sep 17 00:00:00 2001 From: Pratyanj Date: Sat, 7 Jun 2025 11:14:38 +0530 Subject: [PATCH 4/9] add emoji show and hide function --- Emoji Dictionary/QT_GUI.py | 21 +- Emoji Dictionary/untitled.ui | 406 +++++++++++++++++++++++++++++++++++ 2 files changed, 421 insertions(+), 6 deletions(-) create mode 100644 Emoji Dictionary/untitled.ui diff --git a/Emoji Dictionary/QT_GUI.py b/Emoji Dictionary/QT_GUI.py index fc6ece76e86..524b02842c4 100644 --- a/Emoji Dictionary/QT_GUI.py +++ b/Emoji Dictionary/QT_GUI.py @@ -8,18 +8,24 @@ from PyQt5 import uic class MainWindow(QMainWindow): - def __init__(self): + def __init__(self): super(MainWindow, self).__init__() # Load the UI file uic.loadUi('Emoji Dictionary/QT_GUI.ui', self) cells = [ - ["๐Ÿ˜€", "๐Ÿฅฐ", "๐Ÿ˜ด", "๐Ÿค“", "๐Ÿคฎ", "๐Ÿคฌ", "๐Ÿ˜จ", "๐Ÿค‘", "๐Ÿ˜ซ", "๐Ÿ˜Ž"], + ["๐Ÿ’", "๐Ÿ•", "๐ŸŽ", "๐Ÿช", "๐Ÿ", "๐Ÿ˜", "๐Ÿฆ˜", "๐Ÿฆˆ", "๐Ÿ“", "๐Ÿ", "๐Ÿ‘€", "๐Ÿฆด", "๐Ÿ‘ฉ๐Ÿฟ", "โ€๐Ÿค", "๐Ÿง‘", "๐Ÿพ", "๐Ÿ‘ฑ๐Ÿฝ", "โ€โ™€", "๐ŸŽž", "๐ŸŽจ", "โšฝ"], ["๐Ÿ•", "๐Ÿ—", "๐Ÿœ", "โ˜•", "๐Ÿด", "๐Ÿ‰", "๐Ÿ“", "๐ŸŒด", "๐ŸŒต", "๐Ÿ›บ", "๐Ÿšฒ", "๐Ÿ›ด", "๐Ÿš‰", "๐Ÿš€", "โœˆ", "๐Ÿ›ฐ", "๐Ÿšฆ", "๐Ÿณ", "โ€๐ŸŒˆ", "๐ŸŒŽ", "๐Ÿงญ"], - ["๐Ÿ”ฅ", "โ„", "๐ŸŒŸ", "๐ŸŒž", "๐ŸŒ›", "๐ŸŒ", "๐ŸŒง", "๐Ÿงบ", "๐Ÿงท", "๐Ÿช’", "โ›ฒ", "๐Ÿ—ผ", "๐Ÿ•Œ", "๐Ÿ‘", "โ€๐Ÿ—จ", "๐Ÿ’ฌ", "โ„ข", "๐Ÿ’ฏ", "๐Ÿ”•", "๐Ÿ’ฅ", "โค"] + ["๐Ÿ”ฅ", "โ„", "๐ŸŒŸ", "๐ŸŒž", "๐ŸŒ›", "๐ŸŒ", "๐ŸŒง", "๐Ÿงบ", "๐Ÿงท", "๐Ÿช’", "โ›ฒ", "๐Ÿ—ผ", "๐Ÿ•Œ", "๐Ÿ‘", "โ€๐Ÿ—จ", "๐Ÿ’ฌ", "โ„ข", "๐Ÿ’ฏ", "๐Ÿ”•", "๐Ÿ’ฅ", "โค"], + ["๐Ÿ˜€", "๐Ÿฅฐ", "๐Ÿ˜ด", "๐Ÿค“", "๐Ÿคฎ", "๐Ÿคฌ", "๐Ÿ˜จ", "๐Ÿค‘", "๐Ÿ˜ซ", "๐Ÿ˜Ž"], ] - + def emoji_wight_btn(): + if self.emoji_widget.isVisible(): + self.emoji_widget.hide() + else: + self.emoji_widget.show() + self.emoji_buttons = [] self.emoji_layout = QGridLayout() self.emoji_widget = QWidget() @@ -27,12 +33,14 @@ def __init__(self): self.frame_2.setLayout(QVBoxLayout()) self.frame_2.layout().addWidget(self.emoji_widget) self.emoji_widget.hide() - self.pushButton.clicked.connect(lambda: self.emoji_widget.show()) + self.pushButton.clicked.connect(lambda:emoji_wight_btn()) + for row_idx, row in enumerate(cells): for col_idx, emoji in enumerate(row): button = QPushButton(emoji) button.setFixedSize(40, 40) + button.setFont(QFont("Arial", 20)) button.setStyleSheet(""" QPushButton { background-color: #ffffff; @@ -45,7 +53,8 @@ def __init__(self): """) # button.clicked.connect(lambda checked, e=emoji: self.emoji_clicked(e)) self.emoji_layout.addWidget(button, row_idx, col_idx) - self.emoji_buttons.append(button) + self.emoji_buttons.append(button) + if __name__ == '__main__': app = QApplication(sys.argv) window = MainWindow() diff --git a/Emoji Dictionary/untitled.ui b/Emoji Dictionary/untitled.ui new file mode 100644 index 00000000000..a6753b7dd19 --- /dev/null +++ b/Emoji Dictionary/untitled.ui @@ -0,0 +1,406 @@ + + + MainWindow + + + + 0 + 0 + 948 + 527 + + + + MainWindow + + + background-color: #f0f2f5; + + + + background-color: transparent; + + + + 8 + + + 10 + + + 10 + + + 10 + + + 10 + + + + + background-color: #ffffff; + border-radius: 10px; + padding: 15px; + box-shadow: 0 2px 4px rgba(0,0,0,0.1); + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 30 + + + + color: #1a73e8; + padding: 10px; + + + EMOJI DICTIONARY + + + Qt::AlignCenter + + + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + background-color: transparent; + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 20 + + + + color: #333333; + padding: 10px; + + + Enter any Emoji you want to search... + + + + + + + background-color: #ffffff; +border-radius: 8px; + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + -1 + + + + QLineEdit { + border: 1px solid #dcdcdc; + border-radius: 5px; + padding: 8px; + font-size: 14px; + background-color: #fafafa; + } + QLineEdit:focus { + border-color: #1a73e8; + background-color: #ffffff; + } + + + + + + + true + + + + -1 + 62 + true + + + + QPushButton { + background-color: #1a73e8; + color: white; + border-radius: 5px; + padding: 8px; + font-size: 14px; + font-weight: 500; + } + QPushButton:hover { + background-color: #1557b0; + } + QPushButton:pressed { + background-color: #104080; + } + + + Emoji Board + + + + + + + + + + background-color: transparent; + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + -1 + 62 + true + + + + QPushButton { + background-color: #34c759; + color: white; + border-radius: 5px; + padding: 8px; + font-size: 14px; + font-weight: 500; + } + QPushButton:hover { + background-color: #2ea44f; + } + QPushButton:pressed { + background-color: #26833b; + } + + + ๐Ÿ” Search + + + + + + + + -1 + 62 + true + + + + QPushButton { + background-color: #ff3b30; + color: white; + border-radius: 5px; + padding: 8px; + font-size: 14px; + font-weight: 500; + } + QPushButton:hover { + background-color: #cc2f27; + } + QPushButton:pressed { + background-color: #99231f; + } + + + ๐Ÿงน Clear + + + + + + + + + + + + + + 0 + 0 + + + + background-color: #ffffff; + border-radius: 10px; + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 16 + 50 + false + + + + color: #333333; +padding-bottom: 10px; + + + Meaning... + + + + + + + + -1 + + + + QTextEdit { + border: 1px solid #dcdcdc; + border-radius: 5px; + padding: 10px; + font-size: 14px; + background-color: #fafafa; + } + QTextEdit:focus { + border-color: #1a73e8; + background-color: #ffffff; + } + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:14px; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:20pt;"><br /></p></body></html> + + + + + + + + 140 + 40 + + + + + -1 + 62 + true + + + + QPushButton { + background-color: #ff9500; + color: white; + border-radius: 5px; + padding: 10px; + font-size: 14px; + font-weight: 500; + } + QPushButton:hover { + background-color: #cc7700; + } + QPushButton:pressed { + background-color: #995900; + } + + + EXIT + + + + + + + + + + + + From 6c5d0547c4c119e9af8750a5e4674986a1b67765 Mon Sep 17 00:00:00 2001 From: Pratyanj Date: Sat, 7 Jun 2025 11:40:09 +0530 Subject: [PATCH 5/9] exite btn done --- Emoji Dictionary/QT_GUI.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Emoji Dictionary/QT_GUI.py b/Emoji Dictionary/QT_GUI.py index 524b02842c4..b90aab7dce4 100644 --- a/Emoji Dictionary/QT_GUI.py +++ b/Emoji Dictionary/QT_GUI.py @@ -13,6 +13,7 @@ def __init__(self): # Load the UI file uic.loadUi('Emoji Dictionary/QT_GUI.ui', self) + self.pushButton_4.clicked.connect(self.close) cells = [ ["๐Ÿ’", "๐Ÿ•", "๐ŸŽ", "๐Ÿช", "๐Ÿ", "๐Ÿ˜", "๐Ÿฆ˜", "๐Ÿฆˆ", "๐Ÿ“", "๐Ÿ", "๐Ÿ‘€", "๐Ÿฆด", "๐Ÿ‘ฉ๐Ÿฟ", "โ€๐Ÿค", "๐Ÿง‘", "๐Ÿพ", "๐Ÿ‘ฑ๐Ÿฝ", "โ€โ™€", "๐ŸŽž", "๐ŸŽจ", "โšฝ"], From b82068a57bacf7cfb732153f711eec367aba8747 Mon Sep 17 00:00:00 2001 From: Pratyanj Date: Sat, 7 Jun 2025 11:40:29 +0530 Subject: [PATCH 6/9] remove box-show and small changes --- Emoji Dictionary/QT_GUI.ui | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/Emoji Dictionary/QT_GUI.ui b/Emoji Dictionary/QT_GUI.ui index dc87c8dbc0a..fd652852ed4 100644 --- a/Emoji Dictionary/QT_GUI.ui +++ b/Emoji Dictionary/QT_GUI.ui @@ -7,7 +7,7 @@ 0 0 948 - 527 + 638 @@ -41,8 +41,7 @@ background-color: #ffffff; border-radius: 10px; - padding: 15px; - box-shadow: 0 2px 4px rgba(0,0,0,0.1); + padding: 15px; QFrame::StyledPanel @@ -147,8 +146,7 @@ background-color: #ffffff; - border-radius: 8px; - box-shadow: 0 2px 4px rgba(0,0,0,0.1); + border-radius: 8px; QFrame::StyledPanel @@ -161,7 +159,7 @@ - -1 + 14 @@ -186,7 +184,7 @@ - -1 + 14 62 true @@ -231,7 +229,7 @@ - -1 + 14 62 true @@ -261,7 +259,7 @@ - -1 + 14 62 true @@ -303,8 +301,7 @@ background-color: #ffffff; - border-radius: 10px; - box-shadow: 0 2px 4px rgba(0,0,0,0.1); + border-radius: 10px; QFrame::StyledPanel @@ -335,7 +332,7 @@ - -1 + 14 @@ -370,7 +367,7 @@ p, li { white-space: pre-wrap; } - -1 + 14 62 true From b6335cd5a0601ace1a5276e8ab1186ced9c2a71c Mon Sep 17 00:00:00 2001 From: Pratyanj Date: Sat, 7 Jun 2025 11:44:38 +0530 Subject: [PATCH 7/9] change indention and add search_emoji --- Emoji Dictionary/QT_GUI.py | 88 +++++++++++++++++++++----------------- 1 file changed, 48 insertions(+), 40 deletions(-) diff --git a/Emoji Dictionary/QT_GUI.py b/Emoji Dictionary/QT_GUI.py index b90aab7dce4..711b7a71f33 100644 --- a/Emoji Dictionary/QT_GUI.py +++ b/Emoji Dictionary/QT_GUI.py @@ -9,52 +9,60 @@ class MainWindow(QMainWindow): def __init__(self): - super(MainWindow, self).__init__() + super(MainWindow, self).__init__() - # Load the UI file - uic.loadUi('Emoji Dictionary/QT_GUI.ui', self) - self.pushButton_4.clicked.connect(self.close) - cells = [ - - ["๐Ÿ’", "๐Ÿ•", "๐ŸŽ", "๐Ÿช", "๐Ÿ", "๐Ÿ˜", "๐Ÿฆ˜", "๐Ÿฆˆ", "๐Ÿ“", "๐Ÿ", "๐Ÿ‘€", "๐Ÿฆด", "๐Ÿ‘ฉ๐Ÿฟ", "โ€๐Ÿค", "๐Ÿง‘", "๐Ÿพ", "๐Ÿ‘ฑ๐Ÿฝ", "โ€โ™€", "๐ŸŽž", "๐ŸŽจ", "โšฝ"], - ["๐Ÿ•", "๐Ÿ—", "๐Ÿœ", "โ˜•", "๐Ÿด", "๐Ÿ‰", "๐Ÿ“", "๐ŸŒด", "๐ŸŒต", "๐Ÿ›บ", "๐Ÿšฒ", "๐Ÿ›ด", "๐Ÿš‰", "๐Ÿš€", "โœˆ", "๐Ÿ›ฐ", "๐Ÿšฆ", "๐Ÿณ", "โ€๐ŸŒˆ", "๐ŸŒŽ", "๐Ÿงญ"], - ["๐Ÿ”ฅ", "โ„", "๐ŸŒŸ", "๐ŸŒž", "๐ŸŒ›", "๐ŸŒ", "๐ŸŒง", "๐Ÿงบ", "๐Ÿงท", "๐Ÿช’", "โ›ฒ", "๐Ÿ—ผ", "๐Ÿ•Œ", "๐Ÿ‘", "โ€๐Ÿ—จ", "๐Ÿ’ฌ", "โ„ข", "๐Ÿ’ฏ", "๐Ÿ”•", "๐Ÿ’ฅ", "โค"], - ["๐Ÿ˜€", "๐Ÿฅฐ", "๐Ÿ˜ด", "๐Ÿค“", "๐Ÿคฎ", "๐Ÿคฌ", "๐Ÿ˜จ", "๐Ÿค‘", "๐Ÿ˜ซ", "๐Ÿ˜Ž"], - ] - def emoji_wight_btn(): + # Load the UI file + uic.loadUi('Emoji Dictionary/QT_GUI.ui', self) + self.pushButton_4.clicked.connect(self.close) + cells = [ + + ["๐Ÿ’", "๐Ÿ•", "๐ŸŽ", "๐Ÿช", "๐Ÿ", "๐Ÿ˜", "๐Ÿฆ˜", "๐Ÿฆˆ", "๐Ÿ“", "๐Ÿ", "๐Ÿ‘€", "๐Ÿฆด", "๐Ÿ‘ฉ๐Ÿฟ", "โ€๐Ÿค", "๐Ÿง‘", "๐Ÿพ", "๐Ÿ‘ฑ๐Ÿฝ", "โ€โ™€", "๐ŸŽž", "๐ŸŽจ", "โšฝ"], + ["๐Ÿ•", "๐Ÿ—", "๐Ÿœ", "โ˜•", "๐Ÿด", "๐Ÿ‰", "๐Ÿ“", "๐ŸŒด", "๐ŸŒต", "๐Ÿ›บ", "๐Ÿšฒ", "๐Ÿ›ด", "๐Ÿš‰", "๐Ÿš€", "โœˆ", "๐Ÿ›ฐ", "๐Ÿšฆ", "๐Ÿณ", "โ€๐ŸŒˆ", "๐ŸŒŽ", "๐Ÿงญ"], + ["๐Ÿ”ฅ", "โ„", "๐ŸŒŸ", "๐ŸŒž", "๐ŸŒ›", "๐ŸŒ", "๐ŸŒง", "๐Ÿงบ", "๐Ÿงท", "๐Ÿช’", "โ›ฒ", "๐Ÿ—ผ", "๐Ÿ•Œ", "๐Ÿ‘", "โ€๐Ÿ—จ", "๐Ÿ’ฌ", "โ„ข", "๐Ÿ’ฏ", "๐Ÿ”•", "๐Ÿ’ฅ", "โค"], + ["๐Ÿ˜€", "๐Ÿฅฐ", "๐Ÿ˜ด", "๐Ÿค“", "๐Ÿคฎ", "๐Ÿคฌ", "๐Ÿ˜จ", "๐Ÿค‘", "๐Ÿ˜ซ", "๐Ÿ˜Ž"], + ] + def emoji_wight_btn(): if self.emoji_widget.isVisible(): self.emoji_widget.hide() else: self.emoji_widget.show() + + def search_emoji(): + word = self.lineEdit.text() + if word == "": + self.textEdit.setText("You have entered no emoji.") + else: + means = emoji.demojize(word) + self.textEdit.setText("Meaning of Emoji : " + str(word) + "\n\n" + means) - self.emoji_buttons = [] - self.emoji_layout = QGridLayout() - self.emoji_widget = QWidget() - self.emoji_widget.setLayout(self.emoji_layout) - self.frame_2.setLayout(QVBoxLayout()) - self.frame_2.layout().addWidget(self.emoji_widget) - self.emoji_widget.hide() - self.pushButton.clicked.connect(lambda:emoji_wight_btn()) - - - for row_idx, row in enumerate(cells): - for col_idx, emoji in enumerate(row): - button = QPushButton(emoji) - button.setFixedSize(40, 40) - button.setFont(QFont("Arial", 20)) - button.setStyleSheet(""" - QPushButton { - background-color: #ffffff; - border: 1px solid #e0e0e0; - border-radius: 5px; - } - QPushButton:hover { - background-color: #f0f0f0; - } - """) - # button.clicked.connect(lambda checked, e=emoji: self.emoji_clicked(e)) - self.emoji_layout.addWidget(button, row_idx, col_idx) - self.emoji_buttons.append(button) + self.emoji_buttons = [] + self.emoji_layout = QGridLayout() + self.emoji_widget = QWidget() + self.emoji_widget.setLayout(self.emoji_layout) + self.frame_2.setLayout(QVBoxLayout()) + self.frame_2.layout().addWidget(self.emoji_widget) + self.emoji_widget.hide() + self.pushButton.clicked.connect(lambda:emoji_wight_btn()) + + + for row_idx, row in enumerate(cells): + for col_idx, emoji in enumerate(row): + button = QPushButton(emoji) + button.setFixedSize(40, 40) + button.setFont(QFont("Arial", 20)) + button.setStyleSheet(""" + QPushButton { + background-color: #ffffff; + border: 1px solid #e0e0e0; + border-radius: 5px; + } + QPushButton:hover { + background-color: #f0f0f0; + } + """) + # button.clicked.connect(lambda checked, e=emoji: self.emoji_clicked(e)) + self.emoji_layout.addWidget(button, row_idx, col_idx) + self.emoji_buttons.append(button) if __name__ == '__main__': app = QApplication(sys.argv) From 7b2330bf1257f02053c65485df6385efed26b48d Mon Sep 17 00:00:00 2001 From: Pratyanj Date: Sat, 7 Jun 2025 12:24:44 +0530 Subject: [PATCH 8/9] all logic done --- Emoji Dictionary/QT_GUI.py | 22 +++++++++++++++++----- Emoji Dictionary/QT_GUI.ui | 25 ++++++++++++++++--------- 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/Emoji Dictionary/QT_GUI.py b/Emoji Dictionary/QT_GUI.py index 711b7a71f33..92e0f6d4aca 100644 --- a/Emoji Dictionary/QT_GUI.py +++ b/Emoji Dictionary/QT_GUI.py @@ -6,14 +6,18 @@ from PyQt5.QtGui import * from PyQt5.QtWidgets import * from PyQt5 import uic +from emoji import demojize +import os class MainWindow(QMainWindow): def __init__(self): super(MainWindow, self).__init__() # Load the UI file - uic.loadUi('Emoji Dictionary/QT_GUI.ui', self) + uic.loadUi(os.path.join(os.path.dirname(__file__),'QT_GUI.ui'),self) self.pushButton_4.clicked.connect(self.close) + self.pushButton_2.clicked.connect(lambda:search_emoji()) + self.pushButton_3.clicked.connect(lambda:clear_text()) cells = [ ["๐Ÿ’", "๐Ÿ•", "๐ŸŽ", "๐Ÿช", "๐Ÿ", "๐Ÿ˜", "๐Ÿฆ˜", "๐Ÿฆˆ", "๐Ÿ“", "๐Ÿ", "๐Ÿ‘€", "๐Ÿฆด", "๐Ÿ‘ฉ๐Ÿฟ", "โ€๐Ÿค", "๐Ÿง‘", "๐Ÿพ", "๐Ÿ‘ฑ๐Ÿฝ", "โ€โ™€", "๐ŸŽž", "๐ŸŽจ", "โšฝ"], @@ -28,12 +32,20 @@ def emoji_wight_btn(): self.emoji_widget.show() def search_emoji(): - word = self.lineEdit.text() + word = self.lineEdit.text() + print(f"Field Text: {word}") if word == "": self.textEdit.setText("You have entered no emoji.") else: - means = emoji.demojize(word) - self.textEdit.setText("Meaning of Emoji : " + str(word) + "\n\n" + means) + means = demojize(word) + self.textEdit.setText("Meaning of Emoji : " + str(word) + "\n\n" + means.replace("::", ":\n: ")) + + def add_input_emoji(emoji): + self.lineEdit.setText(self.lineEdit.text() + emoji) + + def clear_text(): + self.lineEdit.setText("") + self.textEdit.setText("") self.emoji_buttons = [] self.emoji_layout = QGridLayout() @@ -60,7 +72,7 @@ def search_emoji(): background-color: #f0f0f0; } """) - # button.clicked.connect(lambda checked, e=emoji: self.emoji_clicked(e)) + button.clicked.connect(lambda checked, e=emoji: add_input_emoji(e)) self.emoji_layout.addWidget(button, row_idx, col_idx) self.emoji_buttons.append(button) diff --git a/Emoji Dictionary/QT_GUI.ui b/Emoji Dictionary/QT_GUI.ui index fd652852ed4..6a50a3f0071 100644 --- a/Emoji Dictionary/QT_GUI.ui +++ b/Emoji Dictionary/QT_GUI.ui @@ -6,7 +6,7 @@ 0 0 - 948 + 944 638 @@ -159,7 +159,9 @@ - 14 + -1 + 50 + false @@ -175,6 +177,9 @@ background-color: #ffffff; } + + + @@ -184,7 +189,7 @@ - 14 + -1 62 true @@ -229,7 +234,7 @@ - 14 + -1 62 true @@ -259,7 +264,7 @@ - 14 + -1 62 true @@ -332,11 +337,13 @@ - 14 + -1 - QTextEdit { + + +QTextEdit { border: 1px solid #dcdcdc; border-radius: 5px; padding: 10px; @@ -353,7 +360,7 @@ <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:14px; font-weight:400; font-style:normal;"> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:20pt;"><br /></p></body></html> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:7.8pt;"><br /></p></body></html> @@ -367,7 +374,7 @@ p, li { white-space: pre-wrap; } - 14 + -1 62 true From f9229b05b70ae2896afd1ff91daabf484d6ac615 Mon Sep 17 00:00:00 2001 From: Pratyanj Date: Sat, 7 Jun 2025 12:29:04 +0530 Subject: [PATCH 9/9] remove part that cause warning msg --- Emoji Dictionary/QT_GUI.py | 1 - Emoji Dictionary/QT_GUI.ui | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Emoji Dictionary/QT_GUI.py b/Emoji Dictionary/QT_GUI.py index 92e0f6d4aca..a4dd819ccb8 100644 --- a/Emoji Dictionary/QT_GUI.py +++ b/Emoji Dictionary/QT_GUI.py @@ -51,7 +51,6 @@ def clear_text(): self.emoji_layout = QGridLayout() self.emoji_widget = QWidget() self.emoji_widget.setLayout(self.emoji_layout) - self.frame_2.setLayout(QVBoxLayout()) self.frame_2.layout().addWidget(self.emoji_widget) self.emoji_widget.hide() self.pushButton.clicked.connect(lambda:emoji_wight_btn()) diff --git a/Emoji Dictionary/QT_GUI.ui b/Emoji Dictionary/QT_GUI.ui index 6a50a3f0071..49267698e80 100644 --- a/Emoji Dictionary/QT_GUI.ui +++ b/Emoji Dictionary/QT_GUI.ui @@ -159,7 +159,7 @@ - -1 + 14 50 false @@ -189,7 +189,7 @@ - -1 + 14 62 true @@ -234,7 +234,7 @@ - -1 + 14 62 true @@ -264,7 +264,7 @@ - -1 + 14 62 true @@ -337,7 +337,7 @@ - -1 + 14 @@ -374,7 +374,7 @@ p, li { white-space: pre-wrap; } - -1 + 14 62 true