Giter Club home page Giter Club logo

multithreading's Introduction

Multithreading GUI Example with PyQt6

This project demonstrates the use of multithreading in a PyQt6 application to manage character appending and deleting to a QLineEdit widget, with real-time updates on a simple ASCII progress bar.


Image of an interface of a multithreading exemplary app

App's Graphical User Interface

Overview

The application features a main window with:

  • A read-only QLineEdit where characters are appended and deleted.
  • An ASCII progress bar that visually represents the percentage of characters in the QLineEdit.
  • A text box to set the delay for deleting characters.
  • A start button to initiate the threads.

Functionality

  • Appending Characters: Three threads (thread1, thread2, thread3) continuously append characters ('p', 's', 't') to the text box.
  • Deleting Characters: A separate thread (deleting_thread) continuously removes the last character from the text box based on a user-defined delay.
  • Progress Bar: Updates in real-time to reflect the current percentage of the maximum 40 characters allowed in the text box.

Setup

Prerequisites

Ensure you have Python installed along with PyQt6. You can install PyQt6 using pip if it's not already installed:

pip install PyQt6

Running the Application

Clone this repository and navigate to the directory containing multithread.py. Run the following command to start the application:

python multithread.py

Architecture

  • MainWindow: Manages the UI and threads.
  • Worker: Handles the appending of characters.
  • DeletingWorker: Manages the deletion of characters.

Each worker is moved to a separate QThread to ensure that the GUI remains responsive.

multithreading's People

Contributors

nakerthefirst avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.