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.6.0
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.
Qtica is currently in active development and not yet ready for stable release.
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
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
Applicationclass. tools.Painter classtools.PaintStatusEdgewidgets.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.ThemeSwitchButtonenums.AbstractIconsto make enum icons that work with Qtica toolstools.Iconutils.color.DetectImageColors, using to get an image colors map.utils.color.get_image_average_color, get an image rgb colorwidgets.LineEditcore.WidgetBaseeffect argument.core.AbstractBase**kwargs, can now accept set value for method.widgets.ScrollArea- get_start.py example
Changed
Theme.system_themeto static method type.effects.*from ObjectDeclarative class type toObjectBaseutils.color.get_hex_from_colorcolor arg to *rgb arg
Fixed
- pixmap error when you try to add
QIcontotools.Iconwith color value.
0.1.4 (2023-11-24)
Added
- extras
iconsmoduleselusivefeatherfluentfontawesomematerial widgets.FramelessWindowSizeGripedge option.utils.methods.qt_corner_to_edgeconvert Qt.Corner inputs to Qt.Edge values.widgets.StackedWidgetQStackedWidget built-in PySide6 classwidgets.IconWidgetwidgets.MaskDialog
Fixed
widgets.FramelessWindowwindow geometry changed when move window.widgets.FramelessWindowSizeGripcursor shape for SizeGrip hover.tools.Iconlist index out of range, when used colored icon
Updated
widgets.NavBarButtonit's now subclass fromcore.WidgetBase
0.2.0 (2023-12-08)
Added
widgets.HLine, Horizontal Frame widget.widgets.VLine, Vertical Frame widget.widgets.ToolButtonPySide6 Built-in QToolButtoncore.QStyleSheetrestore_qss method to restore last Qss value after update_qss call with save=False.tools.StatusEdgePaintcorner option.widgets.MainWindow,widgets.FramelessWindow,widgets.RoutingWindowsys_tray parameter.widgets.Menu, fork for PySide6.QtWidgets.QMenu.tools.Actionfork for PySide6.QtGui.QAction.utils.colorscore.AbstractBasemethodsparameter.core.AbstractTool,core.ToolBasecore.AbstractIcon,core.IconBasecore.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.VLayoutnow you can addQSpacerItem, andQLayoutItemwidget types to childrencore.QStyleSheetimprove Qss Parser.core.QStyleSheetqss now accepting json files.widgets.LineEditpassword_mode parameter, add password echo mode supportwidgets.SlidingStackedWidgetnow children parameter support Route
Fixed
tools.Icondefault color value -1, when color is Nonecore.Api.fetchmethod NoneType error when fetchingPySide6.QtWidgets.QApplicationclass type.
Changed
tools.PaintStatusEdgetotools.StatusEdgePainttools.ObjectBasetotools.QObjectBasewidgets.QuickWidgetparameterfiletoqmlwidgets.QuickViewparameterfiletoqml
0.2.1 (2023-12-09)
Added
utils.caseconverter, forkingcaseconvertermodule 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.MovieViewhas been moved and renamed totools.Movietools.EnvVarhas been moved toutils.EnvVarwidgets.Applicationlist_styles has been renamed to style_listcore.WidgetBasehas been renamed toAbstractWidgetcore.ObjectBasehas been renamed toAbstractQObjectcore.BehavioDeclarativehas been renamed toBehavioDeccore.QStyleSheethas been moved toutils.QStyleSheetcore.WidgetDeclarativehas been renamed toWidgetDeccore.ObjectDeclarativehas been renamed toQObjectDeccore.TrackingDeclarativehas been renamed to TrackingDec`utils.colors.get_image_average_colorhas been renamed toimageAverageColorutils.colors.imageAverageColorreturnQColortype instedlist[int]utils.colors.get_color_from_hexhas been renamed tohexToColorutils.colors.get_hex_from_colorhas been renamed tocolorToHexutils.colors.get_random_colorhas been renamed torandomColorenums.TeachingTipTailPositionshas been renamed toTeachingTipTailPoswidgets.ScrollAreachild can know acceptedQLayoutObjectscore.AbstractBase.gethas been renamed tofetchutils.colors.Contrast.color_typehas been renamed tocolor_modecore.AbstractPainter._repainthas been renamed torepaintcore.AbstractPainter._painthas been renamed to_paintcore.AbstractPainter._super_paintEventhas been renamed tosuper_paintEvent
Updated
core.AbstractBaseevents keyword, now can accept methods without 'Event' suffixenums.EnvVars, some variables addedcore.AbstractWidget-core.AbstractWidgetNow you can add an event method without writing the 'Event' suffix, and the class will auto-detect the method.utils.Routesadd support for QStackedLayout
Fixed
core.Api.fetchImprove QObject Finderutils.colors.ImageColors.most_commonchange from property to methodcore.AbstractDecsaving uid for objects how was haveobjectNamemethod.
Added
- supporting for PySide6.{5,6}.x versions
widgets.IconWidgetsupportQMovieanimation image.core.AbstractWidgetlong_press Signalcore.AbstractBase.enable_event_stack, know you can stack a widget event.sys_tray.pyto examples folder.stack.pyto examples folder.core.AbstractIconscore.AbstractToolcore.AbstractPaintercore.AbstractDecutils.theme_detectforked to be Qtica built-in modulelayouts.ColumnLayoutlayouts.ColumnLayoutItemWrapperlayouts.RowLayoutlayouts.RowLayoutItemWrapperlayouts.BorderLayoutlayouts.BorderLayoutItemWrappercore.Api.dec_fetchenums.Themeservices.showDialogservices.TakeScreenShotservices.UrlOpentools.SystemTraytools.Actionwidgets.Stacktools.Penpainters.CircularProgressPaintcore.AbstractDialogwidgets.dialogs.TeachingTipDialogtools.action.LinePasswordAction
0.3.1 (2024-01-09)
Added
animations.ParallelAnimationGroupanimations.SequentialAnimationGrouptools.Brush
Changed
Qtica.animationhas been renamed toQtica.animationstools.paintershas been moved to the main directory of QticaQtica.painterslayouts.GridLayoutItemWrapperhas been moved totools.wrappers.GridLayoutWrapperlayouts.VLayoutItemWrapperhas been moved totools.wrappers.VLayoutWrapperlayouts.HLayoutItemWrapperhas been moved totools.wrappers.HLayoutWrapperlayouts.RowLayoutItemWrapperhas been moved totools.wrappers.RowLayoutWrapperlayouts.ColumnLayoutItemWrapperhas been moved totools.wrappers.ColumnLayoutWrapperlayouts.FormLayoutItemWrapperhas been moved totools.wrappers.FormLayoutWrapperlayouts.BorderLayoutItemWrapperhas been moved totools.wrappers.BorderLayoutWrappertools.AbstractConfighas been moved tocore.AbstractConfigwidgets.containerhas been renamed towidgets.frame
Removed
utils.colorsenums.teaching_tip_tailsenums.animationenums.clipboardenums.smooth_scroll
0.3.2 (2024-01-13)
Added
-
widgets.dialogs.MaskDialogclose button title bar. -
widgets.SpinBox -
widgets.DoubleSpinBox -
services.parse_css_linear_gradient -
utils.maths.deg_to_coordinates -
core.AbstractBasehandle 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.TeachingTipDialogimprovedcore.AbstractDialogimprovedtools.Settingsimproved system detectingtools.CopyProgressimprovedcore.AbstractBaseimproved
Changed
tools.Alignmenthas been moved toutils.Alignmenttools.Modifiershas been moved toutils.Modifierscore.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.ToolButtonrequires a 'PySide6.QtWidgets.QPushButton' object but received a 'ToolButton'widgets.FramelessWindow'init' method of object's base class (FramelessWindow) not called.
0.4.0 (2024-01-23)
Added
widgets.icon_widgetsetIcon method.core.MArgswidgets.GroupBoxchild keyword argument-
tools.qtcore.tools- QBitArray
- QByteArray
- QByteArrayMatcher
- QCollator
- QDataStream
- QDate
- QDateTime
- QDeadlineTimer
- QDir
- QEasingCurve
- QFileInfo
- QFutureInterfaceBase
- QJsonDocument
- QLine
- QLineF
- QLocale
- QLockFile
- QLoggingCategory
- QMargins
- QMarginsF
- QNativeIpcKey
- QPoint
- QPointF
- QRect
- QRectF
- QRegularExpression
- QSize
- QSizeF
- QSystemSemaphore
- QTextStream
- QTime
- QUrl
- QUrlQuery
- QXmlStreamReader
- QXmlStreamWriter
Fixed
core.AbstractBaserepeating call of [add]Method when inserting to it Iterable value.
Changed
utils.Argshas been moved tocore.Argsutils.Funchas been moved tocore.Funcutils.Routeshas been moved tocore.Routesutils.QStyleSheethas been moved tocore.QStyleSheetutils.exceptionHandlerhas been renamed and moved tocore.TryExc
0.4.1 (2024-01-28)
Added
tools.SpacerItemwidgets.ElidingLabelservices.eliding_text
Updated
core.AbstractBase._set_eventscore.AbstractBasemethods argument can acceptcore.Args
Changed
-
remove force keyword argument
core.AbstractBasecore.AbstractToolcore.AbstractDialogcore.AbstractWidget
-
enums.eventsremove event suffix
Removed
widgets.AbstractButtonwidgets.AbstractItemViewwidgets.AbstractScrollAreawidgets.AbstractSliderwidgets.AbstractSpinBoxtools.ElidedText
Fixed
widgets.StackedWidgetQtica.core.routes.Routes() argument after ** must be a mapping, not dict_items.
0.4.2 (2024-02-14)
Fixed
widgets.ElidingLabelsome issus.
Updated
widgets.MaskDialogimprove resize method when change child setFixedSize values.tools.qtcore.toolscan now set*argsto init method
Added
widgets.MaskDialogfixed_size argumentpainters.StatusEdgePaintStyles(ellipse, rectangle, icon)widgets.FrameContainerwidgets.WidgetContainerwidgets.VideoWidgettools.MediaPlayer
Changed
widgets.frame.pyrenamed towidgets.container.py
0.4.3 (2024-03-05)
Added
core.AbstractBasesignals,events,methods dict type supportcore.QStyleSheetconverts Python values to Qss elementBorderRadiusRadialGradientLinearGradientBoxShadow
tools.ListWidgetItemwidgets.ListWidgetaddItemWidget, addItemDelegate methods
Fixed
tools.qtcore.tools,tools.qtgui.toolshas no attribute, in aarch64 machines
0.5.0 (2024-05-24)
Added
layout.stacked.StackedLayoutRoutes, dict types support.enums.QPA_Platformsvnc, wayland_egl, vkkhrdisplaycore.AbstractWidgetPosEventsRange, PosEventsArg, PosEvents classescore.AbstractWidgetat_pos argument.widgets.QuickWidgettools.qtcore.objects.Filetools.TempFileutils.BaseDirutils.Modifiers,utils.Keys,utils.KeySequencetools.LayoutWrapper
Fixed
core.AbstractBasevalue type error when insert MArgs class type to add[Methods]
Changed
tools.Filehas been renamed totools.OpenFileutils.modifiers.pyhas been renamed toutils.key_events.py
Updated
widgets.QuickWidgetqml argument can accept QML code from string.
Removed
utils.CheckNonetools.HLayoutWrapperColumnLayoutWrapperRowLayoutWrapperVLayoutWrapper
0.6.0 (2024-06-26)
Added
widgets.SvgWidgettools.SvgRenderertools.SvgGeneratorcore.AbstractIODevicecore.AbstractContainercore.AbstractBoxLayoutcore.AbstractButtoncore.AbstractWindowtools.qtmultimediautils.MouseButtonseffects.BoxShadoweffects.ShadowEffect
Updated
widgets.AbstractContaineryou can now add list of widgets to child argument as children of container widgets.
Removed
widgets.ListWidget.addItemDelegatewidgets.window.BaseWindowdockwidgets argumentwidgets.window.BaseWindowtoolbars argumenttools.wrappers.DockWidgetWrapperwe don't need it anymoretools.wrappers.ToolBarWrapper,tools.wrappers.ToolBarBreakWrapperwe don't need it anymore
Changed
widgets.window.BaseWindowhome argument has been renamed to childtools.SizePolicyhorizontal, vertical arguments has been renamed to hsizetype, vsizetypetools.wrappers.GridLayoutWrappercol argument has been renamed to column
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qtica-0.6.0.tar.gz.
File metadata
- Download URL: qtica-0.6.0.tar.gz
- Upload date:
- Size: 425.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.10.12 Linux/6.5.0-41-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f78ca05d8ce7fb893c67e7327b5afe4af9a8a224cd51a05c3b91fe3af163b124
|
|
| MD5 |
3cfc668a79e78464bb6e63cd4eb8f98d
|
|
| BLAKE2b-256 |
92d5973e02aba76c27fe76e789548bf60cd79efa81553d727fff8134d7e042a7
|
File details
Details for the file qtica-0.6.0-py3-none-any.whl.
File metadata
- Download URL: qtica-0.6.0-py3-none-any.whl
- Upload date:
- Size: 136.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.10.12 Linux/6.5.0-41-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8e01ca8be620a97e00680b864614382d5e9400ef0d800c11eb35edc71b85532
|
|
| MD5 |
08b8cc4b660f3d1a65a235509e8557d5
|
|
| BLAKE2b-256 |
f88768d4ac0a1700498a347ff226589647d95081a7dad73bb081876c64316397
|