Introduce QML-like declarative structure to Python world. Developer writes only pure Python code for QML.

Overview

📝 English documentation is on the way. See Chinese version below.

Declare QtQuick | 声明式 QtQuick 界面库

以全新的方式编写 QtQuick (QML) 界面.

declare-qtquick 支持开发者以纯 Python 语法 + 声明式语法结构编写现代化的界面程序. 它看起来长这样:

from declare_qtquick import Application
from declare_qtquick.widgets import *
from lk_lambdex import lambdex  # pip install lk-lambdex

with Application() as app:

    with Window() as win:
        win.width = 300
        win.height = 400
        win.color = '#F9F0F5'
        win.visible = True
        
        with Rectangle() as rect:
            rect.x = 10
            rect.y = 10
            rect.width = 200
            rect.height = 270
            
            rect.color = 'white'
            rect.radius = 8
    
            rect.width.set_anim(duration=1000)
            rect.height.set_anim(duration=1000)
            
            with Text() as txt:
                txt.anchors.center_in = rect
                txt.text = 'Hello World'
                txt.font.pixel_size = 24
                
            with MouseArea() as area:
                area.anchors.fill = rect
                area.clicked.connect(lambdex('', """
                    rect.width = win.width - 20
                    rect.height = win.height - 20
                """))

    app.start()

运行截图:

FIXME: 下图是示意图, 实际代码仍在开发中.

它等同于以下 QML 代码:

import QtQuick
import QtQuick.Window

Window {
    id: win
    width: 300
    height: 400
    color: '#F9F0F5'
    visible: true
    
    Rectangle {
        id: rect
        x: 10
        y: 10
        width: 200
        height: 270
        
        color: 'white'
        radius: 8
        
        Behavior on width {
            NumberAnimation {
                duration: 1000
            }
        }
        
        Behavior on height {
            NumberAnimation {
                duration: 1000
            }
        }
        
        Text {
            id: txt
            anchors.centerIn: rect
            text: 'Hello World'
            font.pixelSize: 24
        }
        
        MouseArea {
            id: area
            anchors.fill: rect
            onClicked: {
                rect.width = win.width - 20
                rect.height = win.height - 20
            }
        }
    }
}

TODO:More...

Owner
likianta
Hola, I'm likia :) Python programmer work in JLSemi Inc.
likianta
WhirlEdit, an excellent {code} editor

HELP! If you're experienced, I want you to make an executable for your platform (windows/mac/linux) and help me.. For more info get in touch at whirlp

whmsft 10 Aug 18, 2022
CBMPy Metadraft: a flexible and extensible genome-scale model reconstruction tool

CBMPy Metadraft: a flexible and extensible, GUI-based genome-scale model reconstruction tool that supports multiple Systems Biology standards.

Systems Biology Lab, Vrije Universiteit Amsterdam 1 Mar 14, 2022
A Simple GUI application to organize and store accounts/passwords.

PyssView A Simple GUI application to organize and store accounts/passwords. Install/Run (Linux) Via script This way will install a binary version and

Jefferson Richard Dias 1 Nov 24, 2021
A really minimalistic operating system made using python's GUI module Tkinter.

BoxOS V1.0.0 About A really minimalistic operating system made using python's GUI module Tkinter. What seperates it from the other operating systems m

Fahim 2 Dec 08, 2022
Basic browser based on PyQt5

goneDev-browser "basic browser based on PyQt5" This application is primarily built on macOS with more adaptibility for MacOS than Windows. v1.0 will s

Harsh ADV) 1 Jan 19, 2022
Declarative User Interfaces for Python

Welcome to Enaml Enaml is a programming language and framework for creating professional-quality user interfaces with minimal effort. What you get A d

1.4k Jan 07, 2023
Gmail account using brute force attack

Programmed in Python | PySimpleGUI Gmail Hack Python script with PySimpleGUI for hack gmail account using brute force attack If you like it give it

Adrijan 127 Dec 30, 2022
A GUI frontend for the Kamyroll-API using Python and PySide6

Kamyroll-GUI A GUI frontend for the Kamyroll-API using Python and PySide6 Usage When starting the application you will be presented with a list and so

Simon Sawicki 15 Oct 09, 2022
A small GUI random roll call program made by Python.

A small GUI random roll call program made by Python.

Yuchen Ren 0 Feb 21, 2022
Currency calculator with PyQt5

currency-calculator currency calculator with PyQt5

Vusal Akhundzada 2 Mar 08, 2022
Win32mica: a simple module to add the Mica effect on legacy python windows.

Win32mica (aka PyMica): A simple module to add the Mica effect on legacy python windows The aim of this project is to apply the Mica effect on python

Martí Climent 40 Dec 13, 2022
GUIOfTemperatureConverterUsingPython - GUI Of Temperature Converter Using Python

Fahrenheit To Celcius GUI Of Temperature Converter Below Video is the Output Of

SUJITHA RASAMSETTY 0 Mar 06, 2022
Criando interfaces gráficas com Python e Qt 6 (PyQt6)

Criando interfaces gráficas com Python e Qt 6 (PyQt6) Qt O Qt é um framework para criação de interfaces gráficas multiplataforma, atualmente ele é des

Renato Cruz 1 Jun 07, 2022
This is a GUI based text and image messenger. Other functionalities will be added soon.

Pigeon-Messenger (Requires Python and Kivy) Pigeon is a GUI based text and image messenger using Kivy and Python. Currently the layout is built. Funct

4 Jan 21, 2022
Json IDE made with Python tkinter!

JIDE Json IDE made with Python tkinter! Download: https://github.com/LouisTheXIV/JIDE/releases/tag/v0.1 Features In JIDE everything is customisable do

n0 7 May 14, 2022
A simple desktop news application written using python created using PyQt5

News-Application---Python This is a news application created using PyQt5. News is fetched through API from newsapi.org. Available top headlines from c

Sritiman Adak 1 Nov 14, 2021
An offline python frontend for the QuadVisions Colab Notebook using tkinter.

Visions GUI An offline python frontend for the QuadVisions Colab Notebook using tkinter. It offers basic options and interactively displays the genera

7 Feb 15, 2022
LyricsGenerator - A simple GUI made using Python(Tkinter) for generating song lyrics

Lyrics Generator Reference :- https://www.geeksforgeeks.org/create-a-gui-to-extr

Somya Ranjan Sahu 3 Mar 25, 2022
Python Web Version 3.0 Using PyQty module

Python-Web-Version-3.0 Python Web Version 3.0 Using PyQty module you have to install pyinstaller module then install PyQt5 module and install PyQtwebE

JehanKandy 9 Jul 13, 2022