Qtica is a Python library that offers a lightweight API built around native PySide6. It enables swift GUI prototyping utilizing contemporary declarative UI methods, all within Python.
Project description
A Fast Way to Done Your Idea!
v0.3.3
Qtica
Qtica is a Python library that offers a lightweight API built around native PySide6. It enables swift GUI prototyping utilizing contemporary declarative UI methods, all within Python.
Features
- Lightweight API: Built around PySide6, Qtica offers a streamlined interface for GUI development.
- Declarative UI Techniques: Facilitates the use of modern UI techniques directly within Python.
- Swift Prototyping: Enables rapid GUI prototyping for efficient development.
Installation
You can install Qtica via pip:
pip install qtica
Usage
import os
import sys
from PySide6.QtGui import QColor
from PySide6.QtCore import QSize, Qt
from Qtica.services import randomColor, colorToHex
from Qtica.widgets import MainWindow, Label, Application
from Qtica import BehaviorDec, Api
class Window(BehaviorDec):
def get_text_color(self, color: QColor) -> QColor:
luma = ((0.299 * color.red()) + (0.587 * color.green()) + (0.114 * color.blue())) / 255
return QColor(0, 0, 0) if luma > 0.5 else QColor(255, 255, 255)
def update_background(self):
bg_color = randomColor()
fg_color = self.get_text_color(bg_color)
Api.fetch("window").qss.update({"background-color": bg_color.name()})
Api.fetch("label").qss.update({"color": fg_color.name()})
def __init__(self):
return MainWindow(
uid="window",
windowTitle="Welcome Qtica!",
methods = [
("resize", QSize(400, 200))
],
events = [
("mousePress", lambda _: self.update_background())
],
home=Label(
uid="label",
setText=f"Hello {os.environ.get('USER', '')}, Welcome to Qtica.<br>Click me!",
setTextFormat=Qt.TextFormat.RichText,
setAlignment=Qt.AlignmentFlag.AlignCenter,
qss={"font-size": "24px"}
),
qss={"background-color": colorToHex(randomColor())},
)
app = Application(sys.argv)
window = Window()
window.show()
sys.exit(app.exec())
Documentation
For more information and detailed usage examples, refer to the documentation.
License
This project is licensed under the GPL3 License.
NOTE
Welcome to Qtica!
Thank you for choosing Qtica! Please be aware that this library is continuously evolving and is not yet considered stable as it's actively under development. We encourage you to use it for experimentation and kindly ask for your feedback, bug reports, suggestions, or improvements that align with your preferences. Your input is invaluable! 😊
Thank you for being a part of Qtica's development journey!
Changelog
Unreleased - (Soon!)
Added
- parent_child_widgets.py example
0.1.1 - (2023-11-05)
Added
-
PySide6 Built-in Widgets
- QApplication
- QPushButton
- QLabel
- QFrame
- QMainWindow
- QSystemTrayIcon
- QGraphicsView
- QWidget
- QQuickWidget
- QQuickView
- QGraphicsOpacityEffect
- QGraphicsDropShadowEffect
- QGraphicsColorizeEffect
- QGraphicsBlurEffect
- QFormLayout
- QGridLayout
- QHBoxLayout
- QStackedLayout
- QVBoxLayout
-
PySide6 Additional Widgets
- WigglyWidget
- WaterRippleProgressBar
- WaterProgressBar
- ProgressIndicator
- MovieView
- MetroCircleProgress
- ElidingLabel
- FramelessWindow
- RoutingWindow
- TeachingTip
- SlidingStackedWidget
- SideBarWidget
- TerminalWidget
- NavBarWidget
- SilentTextDialog
- LargTextDialog
- ColourfulProgressBar
- OutsideNeumorphismEffect
- InsideNeumorphismEffect
- FlowLayout
- ExpandLayout
-
PySide6 Built-in Core
- QPropertyAnimation
-
PySide6 Additional Core
- StyleAnimation
- ProgressStyleAnimation
- Animation
0.1.2 - (2023-11-07)
Added
- Qtica
logo.png
- version_generator.py example
- status_edge.py example
- resources, and fonts into the
Application
class. tools.Painter class
tools.PaintStatusEdge
widgets.FramelessWindowSizeGrip
Changed
enums.Sizes.size_hint
->enums.Sizes.hint
Fixed
core.BehaviorDeclarative
, no uid in__init__
parameters
0.1.3 - (2023-11-12)
Added
widgets.ThemeSwitchButton
enums.AbstractIcons
to make enum icons that work with Qtica toolstools.Icon
utils.color.DetectImageColors
, using to get an image colors map.utils.color.get_image_average_color
, get an image rgb colorwidgets.LineEdit
core.WidgetBase
effect argument.core.AbstractBase
**kwargs, can now accept set value for method.widgets.ScrollArea
- get_start.py example
Changed
Theme.system_theme
to static method type.effects.*
from ObjectDeclarative class type toObjectBase
utils.color.get_hex_from_color
color arg to *rgb arg
Fixed
- pixmap error when you try to add
QIcon
totools.Icon
with color value.
0.1.4 (2023-11-24)
Added
- extras
icons
moduleselusive
feather
fluent
fontawesome
material
widgets.FramelessWindowSizeGrip
edge option.utils.methods.qt_corner_to_edge
convert Qt.Corner inputs to Qt.Edge values.widgets.StackedWidget
QStackedWidget built-in PySide6 classwidgets.IconWidget
widgets.MaskDialog
Fixed
widgets.FramelessWindow
window geometry changed when move window.widgets.FramelessWindowSizeGrip
cursor shape for SizeGrip hover.tools.Icon
list index out of range, when used colored icon
Updated
widgets.NavBarButton
it's now subclass fromcore.WidgetBase
0.2.0 (2023-12-08)
Added
widgets.HLine
, Horizontal Frame widget.widgets.VLine
, Vertical Frame widget.widgets.ToolButton
PySide6 Built-in QToolButtoncore.QStyleSheet
restore_qss method to restore last Qss value after update_qss call with save=False.tools.StatusEdgePaint
corner option.widgets.MainWindow
,widgets.FramelessWindow
,widgets.RoutingWindow
sys_tray parameter.widgets.Menu
, fork for PySide6.QtWidgets.QMenu.tools.Action
fork for PySide6.QtGui.QAction.utils.colors
core.AbstractBase
methods
parameter.core.AbstractTool
,core.ToolBase
core.AbstractIcon
,core.IconBase
core.AbstractPainter
,core.PainterBase
Removed
tools.Painter
__init__
return parent widget, you can now return from subclasses.core.Return
, we dont't need it any more!
Updated
layouts.HLayout
, andlayouts.VLayout
now you can addQSpacerItem
, andQLayoutItem
widget types to childrencore.QStyleSheet
improve Qss Parser.core.QStyleSheet
qss now accepting json files.widgets.LineEdit
password_mode parameter, add password echo mode supportwidgets.SlidingStackedWidget
now children parameter support Route
Fixed
tools.Icon
default color value -1, when color is Nonecore.Api.fetch
method NoneType error when fetchingPySide6.QtWidgets.QApplication
class type.
Changed
tools.PaintStatusEdge
totools.StatusEdgePaint
tools.ObjectBase
totools.QObjectBase
widgets.QuickWidget
parameterfile
toqml
widgets.QuickView
parameterfile
toqml
0.2.1 (2023-12-09)
Added
utils.caseconverter
, forkingcaseconverter
module to be as built-in
Changed
- moving pynput from dependencies to extras dependence.
Removed
requirements.txt
, we don't need it anymore, you can use poetry to install requirements.
0.3.0 (2024-01-03)
Changed
core.Api.fetch
\type argument has been renamed to qtypewidgets.MovieView
has been moved and renamed totools.Movie
tools.EnvVar
has been moved toutils.EnvVar
widgets.Application
list_styles has been renamed to style_listcore.WidgetBase
has been renamed toAbstractWidget
core.ObjectBase
has been renamed toAbstractQObject
core.BehavioDeclarative
has been renamed toBehavioDec
core.QStyleSheet
has been moved toutils.QStyleSheet
core.WidgetDeclarative
has been renamed toWidgetDec
core.ObjectDeclarative
has been renamed toQObjectDec
core.TrackingDeclarative
has been renamed to TrackingDec`utils.colors.get_image_average_color
has been renamed toimageAverageColor
utils.colors.imageAverageColor
returnQColor
type instedlist[int]
utils.colors.get_color_from_hex
has been renamed tohexToColor
utils.colors.get_hex_from_color
has been renamed tocolorToHex
utils.colors.get_random_color
has been renamed torandomColor
enums.TeachingTipTailPositions
has been renamed toTeachingTipTailPos
widgets.ScrollArea
child can know acceptedQLayout
Objectscore.AbstractBase.get
has been renamed tofetch
utils.colors.Contrast.color_type
has been renamed tocolor_mode
core.AbstractPainter._repaint
has been renamed torepaint
core.AbstractPainter._paint
has been renamed to_paint
core.AbstractPainter._super_paintEvent
has been renamed tosuper_paintEvent
Updated
core.AbstractBase
events keyword, now can accept methods without 'Event' suffixenums.EnvVars
, some variables addedcore.AbstractWidget
-core.AbstractWidget
Now you can add an event method without writing the 'Event' suffix, and the class will auto-detect the method.utils.Routes
add support for QStackedLayout
Fixed
core.Api.fetch
Improve QObject Finderutils.colors.ImageColors.most_common
change from property to methodcore.AbstractDec
saving uid for objects how was haveobjectName
method.
Added
- supporting for PySide6.{5,6}.x versions
widgets.IconWidget
supportQMovie
animation image.core.AbstractWidget
long_press Signalcore.AbstractBase.enable_event_stack
, know you can stack a widget event.sys_tray.py
to examples folder.stack.py
to examples folder.core.AbstractIcons
core.AbstractTool
core.AbstractPainter
core.AbstractDec
utils.theme_detect
forked to be Qtica built-in modulelayouts.ColumnLayout
layouts.ColumnLayoutItemWrapper
layouts.RowLayout
layouts.RowLayoutItemWrapper
layouts.BorderLayout
layouts.BorderLayoutItemWrapper
core.Api.dec_fetch
enums.Theme
services.showDialog
services.TakeScreenShot
services.UrlOpen
tools.SystemTray
tools.Action
widgets.Stack
tools.Pen
painters.CircularProgressPaint
core.AbstractDialog
widgets.dialogs.TeachingTipDialog
tools.action.LinePasswordAction
0.3.1 (2024-01-09)
Added
animations.ParallelAnimationGroup
animations.SequentialAnimationGroup
tools.Brush
Changed
Qtica.animation
has been renamed toQtica.animations
tools.painters
has been moved to the main directory of QticaQtica.painters
layouts.GridLayoutItemWrapper
has been moved totools.wrappers.GridLayoutWrapper
layouts.VLayoutItemWrapper
has been moved totools.wrappers.VLayoutWrapper
layouts.HLayoutItemWrapper
has been moved totools.wrappers.HLayoutWrapper
layouts.RowLayoutItemWrapper
has been moved totools.wrappers.RowLayoutWrapper
layouts.ColumnLayoutItemWrapper
has been moved totools.wrappers.ColumnLayoutWrapper
layouts.FormLayoutItemWrapper
has been moved totools.wrappers.FormLayoutWrapper
layouts.BorderLayoutItemWrapper
has been moved totools.wrappers.BorderLayoutWrapper
tools.AbstractConfig
has been moved tocore.AbstractConfig
widgets.container
has been renamed towidgets.frame
Removed
utils.colors
enums.teaching_tip_tails
enums.animation
enums.clipboard
enums.smooth_scroll
0.3.2 (2024-01-13)
Added
-
widgets.dialogs.MaskDialog
close button title bar. -
widgets.SpinBox
-
widgets.DoubleSpinBox
-
services.parse_css_linear_gradient
-
utils.maths.deg_to_coordinates
-
core.AbstractBase
handle add Methods in **kwargs -
tools.qtgui
- ActionGroup
- Clipboard
- DoubleValidator
- Drag
- GuiApplication
- InputDevice
- InputMethod
- IntValidator
- OffscreenSurface
- OpenGLContext
- OpenGLContextGroup
- PaintDeviceWindow
- PdfWriter
- PointingDevice
- PyTextObject
- RasterWindow
- RegularExpressionValidator
- Screen
- SessionManager
- Shortcut
- StandardItemModel
- StyleHints
- SyntaxHighlighter
- TextBlockGroup
- TextDocument
- TextFrame
- TextList
- TextObject
- TextTable
- UndoGroup
- UndoStack
- Validator
- Window
- BackingStore
- Bitmap
- ColorSpace
- ConicalGradient
- Cursor
- DesktopServices
- Font
- GlyphRun
- Gradient
- Image
- ImageIOHandler
- ImageReader
- ImageWriter
- LinearGradient
- PageLayout
- PagedPaintDevice
- PaintEngine
- Painter
- PainterPathStroker
- Palette
- Pen
- Picture
- Pixmap
- Quaternion
- RadialGradient
- Rgba64
- RhiBuffer
- RhiColorAttachment
- RhiCommandBuffer
- RhiComputePipeline
- RhiDepthStencilClearValue
- RhiGraphicsPipeline
- RhiReadbackDescription
- RhiRenderBuffer
- RhiRenderTarget
- RhiSampler
- RhiScissor
- RhiShaderResourceBindings
- RhiShaderStage
- RhiSwapChain
- RhiSwapChainRenderTarget
- RhiTexture
- RhiTextureCopyDescription
- RhiTextureRenderTarget
- RhiTextureRenderTargetDescription
- RhiTextureSubresourceUploadDescription
- RhiTextureUploadDescription
- RhiTextureUploadEntry
- RhiVertexInputAttribute
- RhiVertexInputBinding
- RhiVertexInputLayout
- RhiViewport
- Shader
- ShaderCode
- ShaderKey
- ShaderVersion
- StandardItem
- StaticText
- SurfaceFormat
- TextBlock
- TextBlockFormat
- TextCharFormat
- TextCursor
- TextDocumentWriter
- TextFormat
- TextFrameFormat
- TextImageFormat
- TextInlineObject
- TextLayout
- TextLine
- TextListFormat
- TextOption
- TextTableCell
- TextTableCellFormat
- TextTableFormat
- UndoCommand
- Vector2D
- Vector3D
- Vector4D
tools.qtcore
- QAnimationGroup
- QBuffer
- QConcatenateTablesProxyModel
- QCoreApplication
- QEventLoop
- QFileDevice
- QFileSelector
- QFileSystemWatcher
- QIODevice
- QIdentityProxyModel
- QItemSelectionModel
- QLibrary
- QMimeData
- QPauseAnimation
- QPluginLoader
- QProcess
- QSaveFile
- QSharedMemory
- QSignalMapper
- QSocketNotifier
- QSortFilterProxyModel
- QStringListModel
- QTemporaryFile
- QThread
- QThreadPool
- QTimeLine
- QTimer
- QTranslator
- QTransposeProxyModel
- QVariantAnimation
-
widgets
- AbstractButton
- AbstractItemView
- AbstractScrollArea
- AbstractSlider
- AbstractSpinBox
- CalendarWidget
- CheckBox
- ColorDialog
- ColumnView
- ComboBox
- CommandLinkButton
- DateEdit
- DateTimeEdit
- Dial
- Dialog
- DialogButtonBox
- DockWidget
- DoubleSpinBox
- ErrorMessage
- FileDialog
- FocusFrame
- FontComboBox
- FontDialog
- GraphicsProxyWidget
- GraphicsView
- GraphicsWidget
- GroupBox
- HeaderView
- InputDialog
- KeySequenceEdit
- LCDNumber
- ListView
- ListWidget
- MdiArea
- MdiSubWindow
- MenuBar
- MessageBox
- PlainTextEdit
- ProgressBar
- ProgressDialog
- RadioButton
- RubberBand
- ScrollBar
- Slider
- SpinBox
- SplashScreen
- Splitter
- SplitterHandle
- StatusBar
- TabBar
- TabWidget
- TableView
- TableWidget
- TextBrowser
- TextEdit
- TimeEdit
- ToolBar
- ToolBox
- TreeView
- TreeWidget
- UndoView
- Wizard
- WizardPage
Updated
widgets.dialogs.TeachingTipDialog
improvedcore.AbstractDialog
improvedtools.Settings
improved system detectingtools.CopyProgress
improvedcore.AbstractBase
improved
Changed
tools.Alignment
has been moved toutils.Alignment
tools.Modifiers
has been moved toutils.Modifiers
core.AbstractWidget
'long_press' signal has been renamed to long_pressed
Fixed
tools.Settings
_set_default_path, when system equal to windows.
0.3.3 (2024-01-14)
Added
widgets.window.BaseWindow
Fixed
widgets.ToolButton
requires a 'PySide6.QtWidgets.QPushButton' object but received a 'ToolButton'widgets.FramelessWindow
'init' method of object's base class (FramelessWindow) not called.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file qtica-0.3.3.tar.gz
.
File metadata
- Download URL: qtica-0.3.3.tar.gz
- Upload date:
- Size: 428.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.10.12 Linux/6.2.0-39-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 013c81a71cc53df1385bc441e91600e044e94d3ac6bc1e0081f393dea8b0a947 |
|
MD5 | 4a158ce8258ce01aed91591eebe91cfa |
|
BLAKE2b-256 | aefe8861dc3eb49ce12e160bea0e2060fd5c529e989b9283f2164c55052fb9cb |
File details
Details for the file qtica-0.3.3-py3-none-any.whl
.
File metadata
- Download URL: qtica-0.3.3-py3-none-any.whl
- Upload date:
- Size: 122.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.10.12 Linux/6.2.0-39-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cb127ffd3f348d3e67b4faf6f82f315b37367f2b978a2d1cdf7573a42ea1722 |
|
MD5 | 0877ab673b66a8d11e19433180e1ec04 |
|
BLAKE2b-256 | 50f4baeec98e7f15de4092a2c63f324caed5ea4ee239e22d5d73737390b30ebd |