Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sign_up_window #4

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added __pycache__/constants.cpython-310.pyc
Binary file not shown.
Binary file added __pycache__/mvc.cpython-310.pyc
Binary file not shown.
Binary file modified __pycache__/sign_up_window.cpython-310.pyc
Binary file not shown.
Binary file not shown.
Binary file added book_search/__pycache__/constants.cpython-310.pyc
Binary file not shown.
1 change: 1 addition & 0 deletions book_search/constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
WINDOW_ICON = "icon/app_icon.ico"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wtf is this?

Binary file added book_search/icon/app_icon.ico
Binary file not shown.
12 changes: 12 additions & 0 deletions book_search/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import sys

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and wtf is this??????

from PyQt6.QtWidgets import QApplication
from book_search import BookSearch

def main():
app = QApplication(sys.argv)
window = BookSearch()
window.show()
sys.exit(app.exec())

main()
1 change: 1 addition & 0 deletions constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
WINDOW_ICON = "icon/app_icon.ico"
9 changes: 3 additions & 6 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
# Main file

import sys

from PyQt6.QtWidgets import QApplication, QWidget, QLabel, QLineEdit, QVBoxLayout
from PyQt6.QtGui import QIcon, QFont, QPixmap
from sign_up_window import Window
from PyQt6.QtWidgets import QApplication
from sign_up_window import SignUpWindow

def main():
app = QApplication(sys.argv)
window = Window()
window = SignUpWindow()
window.show()
sys.exit(app.exec())

Expand Down
19 changes: 9 additions & 10 deletions sign_up_window.py
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete useless comments (all of yours are useless)
rewrite this in the DRY principle way
I told you to read and write this module based on MVC did you

Type of Comments Good Bad Example
Autogenerated Comments None Redundant N/A
Clarification Comments Rarely Often // Increment the counter.
Commented-Out Code None Creates Dead Code // someFunction();
Marker Comments Sometimes Unclear Intent // BEGIN MAIN PROGRAM
TODO Comments Rarely Often Left Unresolved // TODO: Refactor this function
Amplification Comments Sometimes Non-essential Information // This function calculates the sum of two numbers.
Javadocs, XmlDocs, etc. Sometimes Errors, Incorrect Information /** This method returns the name of the person. **/
Commented-Out Tests None Creates False Sense of Security N/A
Legal Comments Sometimes Unmaintained, Misleading // Copyright (c) 2021 Company Name
Explanation of Intent Sometimes Misleading, Duplication // Check if the input is valid.
Explanation of Implementation Seldom Error-Prone // Use quicksort algorithm to sort the array.
Warning of Consequences Sometimes Conflicts with Code // Be careful while modifying this code.
TODO Comments (Implementation) Seldom Code Should be Well-Designed // TODO: Implement this function using a better algorithm.
Debugging Comments Seldom Debuggers are More Effective // Print debug information.
Global Information Seldom Obvious, Distracting // This is the main function.

if you had any more question --> google

Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
# sign_up_window

import sys

from PyQt6.QtWidgets import QApplication, QWidget, QLabel, QLineEdit, QVBoxLayout
from PyQt6.QtGui import QIcon, QFont, QPixmap
from constants import WINDOW_ICON

class Window(QWidget) :
class SignUpWindow(QWidget) :
def __init__(self) :
super().__init__()
self.setWindowTitle("X_Library | Sign Up Window")
self.setWindowIcon(QIcon("icon/app_icon.ico"))
self.setWindowIcon(QIcon(WINDOW_ICON))
self.resize(800, 600)

self.create_widgets()

def create_widgets(self) :
window_layout = QVBoxLayout()
# image box

image_box = QLabel(self)
captcha_image = QPixmap("icon/app_icon.ico")
image_box.setPixmap(captcha_image)
image_box.setGeometry(100, 100, 300, 300)
window_layout.addWidget(image_box)
# input box

input_box = QLineEdit(self)
input_box.setGeometry(150, 400, 200, 30)
window_layout.addWidget(input_box)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as in here .... DRY please

# applying layout

self.setLayout(window_layout)