{"id":21528266,"url":"https://github.com/hrassi/pyqt5_starter","last_synced_at":"2025-06-30T02:04:01.203Z","repository":{"id":220785743,"uuid":"752587817","full_name":"hrassi/PyQt5_Starter","owner":"hrassi","description":null,"archived":false,"fork":false,"pushed_at":"2024-02-04T10:05:40.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-17T18:51:55.152Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hrassi.png","metadata":{"files":{"readme":"README.txt","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-04T09:36:11.000Z","updated_at":"2024-02-04T09:40:34.000Z","dependencies_parsed_at":"2024-02-04T10:54:27.163Z","dependency_job_id":null,"html_url":"https://github.com/hrassi/PyQt5_Starter","commit_stats":null,"previous_names":["hrassi/pyqt5_starter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hrassi/PyQt5_Starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrassi%2FPyQt5_Starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrassi%2FPyQt5_Starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrassi%2FPyQt5_Starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrassi%2FPyQt5_Starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hrassi","download_url":"https://codeload.github.com/hrassi/PyQt5_Starter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrassi%2FPyQt5_Starter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262697250,"owners_count":23349890,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-24T01:52:25.767Z","updated_at":"2025-06-30T02:04:01.163Z","avatar_url":"https://github.com/hrassi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyQt5_Starter\n\nthis is a starter kit to begin with Pyqt5\nu can use also qt designer app that help a lot to reduce writing code\nqt designer is an app for gui designing interface\nit will give u a file.ui usable witch will be translated to python\n\n********************************************************************\n\npython PyQt5 :\n\nframe button image label\n\nimport sys\n\nfrom PyQt5.QtWidgets import QApplication, QLabel, QPushButton, QVBoxLayout, QWidget, QFileDialog, QGridLayout,QLineEdit\n\nfrom PyQt5.QtGui import QPixmap\nfrom PyQt5 import QtGui, QtCore\nfrom PyQt5.QtGui import QCursor\n\n\n\nfull tutorial:\n\nhttps://youtu.be/9iZLDnW_vwU?si=jGDlj90v0veZnMj0\n\nQGrid Layout :\nhttps://www.pythontutorial.net/pyqt/pyqt-qgridlayout/\n\n\n\n# example 1  label:\n\nfrom PyQt5.QtWidgets import *\nfrom PyQt5.QtGui import QFont\n\napp=QApplication([])\nwindow=Qwidget()\nwindow.setGeometry(100,100,200,300) window coordinate and dimmentions\nwindow.setWindowTitle(“Houssam App”)\n\nlabel=QLabel(window)\nlabel.setText(“hello world”)\nlabel.setFont(QFont(“Arial”,16))\nlabel.move(50,100)      #coordinate of label\n\nwindow.show()\napp.exec_()\n\nif __name__ == ‘ __main__’:\n    main()\n\n\n\n# example 2 layout QVBoxLayout and push button\n# and label and text box:\n\nfrom PyQt5.QtWidgets import *\nfrom PyQt5.QtGui import QFont\n\napp=QApplication([])\nwindow=Qwidget()\nwindow.setGeometry(100,100,200,300) \nwindow.setWindowTitle(“Houssam App”)\n\nlabel = QLabel(“Press the button “)\ntextbox=QTextEdit()\nbutton = QPushButton(“Press Me !”)\nbutton.clicked.connect(on_click)\nbutton2 = QPushButton(“send msg”)\nbutton2.clicked.connect(lambda: on_click2(textbox.toPlainText()))\n\nlayout.addWidget(label)\nlayout.addWidget(button)\nlayout.addWidget(button2)\nlayout.addWidget(textbox)\nwindow.setLayout(layout)\n\n\n\nwindow.show()\napp.exec_()\n\ndef on_click():\n    print(“Hello world”)\n    message = QMessageBox()\n    message.setText(“Hello world”)\n    message.exec_()\n\ndef on_click2(msg):\n    message.setText(msg)\n    message.exec_()\n    \n\nif __name__ == ‘ __main__’:\n    main()\n\nQT Designer :\n\nhttps://youtu.be/MOItX2aKTGc?si=HxK15KkHKEDYCnI6\n\nfrom PyQt5.QtWidgets import *\nfrom PyQt5 import uic\n\nclass MyGUI(QMainWindow):\n    def __init__(self):\n        super(MyGUI,self).__init__()\n        uic.loadUi(“mygui.ui” , self) # mygui.ui is the file from QT Designer\n        self.show()\n        \n        self.pushButton.clicked.connect(self.login) # if pushButton is pushed\n        self.pushButton_2.clicked.connect(lambda: self.sayit(self.textEdit.toPlainText()\n        self.actionClose.triggered.connect(exit)\n\ndef login(self):\n    if self.lineEdit.text() == “hrassi” and self.lineEdit_2.text() == “password”:\n        self.textEdit.setEnabled(True)\n        self.pushButton_2.setEnabled(True)\n    else:\n        message = QMessageBox()\n        message.setText(“invalid login”)\n        message.exec_()\n\ndef sayit(self, msg):\n    message = QMessageBox()\n    message.setText(msg)\n    message.exec_()\n\n\ndef main():\n    app = QApplication([])\n    window = MyGUI()\n    app.exec_()\n\nif __name__ == ‘ __main__’:\n    main()\n\n\nQT DESIGNER TUTORIAL : youtube NeuralNine chanel\n\nhttps://youtu.be/MOItX2aKTGc?si=HxK15KkHKEDYCnI6\n\nhttps://youtu.be/vde95l737PI?si=9fTxVxOJOVkuvl1A\n\nusing color and properties and layout:\nhttps://youtu.be/i_Z-1F_U_yw?si=MPfgtebC0dW6Q2WO\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrassi%2Fpyqt5_starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhrassi%2Fpyqt5_starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrassi%2Fpyqt5_starter/lists"}