GithubHelp home page GithubHelp logo

khamisikibet / qt-pyqt-pyside-custom-widgets Goto Github PK

View Code? Open in Web Editor NEW
604.0 15.0 199.0 27.43 MB

Awesome custom widgets made for QT Desktop Applications. Simplify your UI development process. These widgets can be used in QT Designer then imported to PySide code.

Home Page: https://khamisikibet.github.io/Docs-QT-PyQt-PySide-Custom-Widgets/

License: GNU General Public License v3.0

Python 89.92% SCSS 10.08%
design desktop gui modern pyqt pyside qt ui uix

qt-pyqt-pyside-custom-widgets's Introduction

GitHub GitHub top language GitHub code size in bytes GitHub issues

Custom Widgets Art

QT-PyQt-PySide-Custom-Widgets

Awesome custom widgets made for QT Desktop Applications. Simplify your UI development process. These widgets can be used in QT Designer then imported to PySide code.

Installation

First time installer:

pip install QT-PyQt-PySide-Custom-Widgets

Upgrade/install the latest version:

pip install --upgrade QT-PyQt-PySide-Custom-Widgets

Quick CMD/Terminal commands:

  • To launch ProjectMaker / project wizard, run
Custom_Widgets --create-project

This will create a Qt-python project inside your empty folder, ready to run.

  • Easy to convert UI files to py. The cutom widgets Theme Engine eliminated the need for QRC to python file conversion, therefore to generate UI-Python files without any errors, use
Custom_Widgets --convert-ui ui-path --qt-library your-lib
  • Monitor changes made to UI file and generate new .py file and other necessary files for the custom widgets
Custom_Widgets --monitor-ui ui-path --qt-library your-lib

Where: ui-path is the UI file path or folder containing UI files. your-lib is PySide6, PySide2, PyQt5 or PyQt6

Updating old GUI app to work with the current Custom Widgets module update

Testing

The examples folder in this repository contains a few code examples you can use to test and learn about the custom widgets.

How to use it.

Please read the required project structure and other important updates here before proceeding.

Documentation:

  • Available custom widgets:

    • AnalogGaugeWidget - A digital analog widget using just a single QWidget. Read more
    • QCustomCheckBox - Customize and animate QCheckBox. Read more
    • QCustomProgressIndicator - Create a beautiful modern progress indicator for multiple tasks. Read more
    • QCustomQPushButton - Customize and animate QPushButton with preset themes and use iconify to animate the icons. Read more
    • QCustomQSlider - Easily move the slider to the current clicked position of a QSlider. Read more
    • QCustomQStackedWidget - Add beautiful transition animations and navigate through QStackedWidget. Read more
    • QCustomSlideMenu - Expand and collapse the size of your QWidgets i.e side menu, popup notifications, floating widgets etc. Read more
    • QMainWindow - Apply custom window title bar and navigation. Read more
    • QCustomModals - Provides custom modal dialogs for PySide/PyQt applications. It includes various types of modal dialogs such as Information, Success, Warning, Error, and Custom modals. Read more
    • QDraggableWidget - Provides custom draggable widget functionality for PyQt/PySide applications. It includes two main classes: QDragItem and QDragWidget. Read more
  • Other extra functions:

    • ProjectMaker / project wizard - Used for creating a Qt-Python project on an empty folder. Read more
    • QCards - Apply the same syle ie drop-shadow effect to a group of QFrame, QWidget etc. Best for creating dashboard cards. Read more
    • QCustomQPushButtonGroup - Create a group of QPushButtons with different stylesheets for the current active or clicked button and other innactive buttons. Read more
    • Qt Theme Engine - Beautify your app. This feature will create multiple themes for QT for Python apps. Read more
    • QSettings - Easily save your app configurations that will be remembered even after restarting the app ie app theme from Qt Theme Engine`. Watch the tutorial
    • JSON Stylesheet Cheatsheet - JSON stylesheet is used to customize the appearance and behavior of PyQt/PySide custom widgets in the QT-PyQt-PySide-Custom-Widgets module. Read more
  • Or watch the tutorial videos here

Credits

Support 💖

Thanks to all supporters on YouTube, Patreon and other platforms.

If you find this project valuable and would like to contribute to its development and maintenance, you can support us on Patreon. Your sponsorship means a lot and is greatly appreciated!💖

Contributors

Thanks to all the contributors involved in the development of the project!

Made with contrib.rocks.

App gallery

A list of modern GUI's made using the custom widgets module. View

qt-pyqt-pyside-custom-widgets's People

Contributors

ameasere avatar boscs avatar khamisikibet avatar t-brunet avatar youngsikshin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qt-pyqt-pyside-custom-widgets's Issues

OSError: no library called "cairo-2" was found

I am using PYQT-6 , and PYQT5 Pyside2 and Pyside2 on windows 10, while running the following code :

########################################################################
## SPINN DESIGN CODE
# YOUTUBE: (SPINN TV) https://www.youtube.com/spinnTv
# WEBSITE: spinndesign.com
########################################################################

########################################################################
## IMPORTS
########################################################################

import os
import sys
from PySide2 import *
from PySide6 import *
#import json



########################################################################
# IMPORT GUI FILE
from ui_Dashboard_Finance import *
########################################################################

########################################################################
# IMPORT Custom widgets
from Custom_Widgets.Widgets import *
########################################################################


########################################################################
## MAIN WINDOW CLASS
########################################################################
class MainWindow(QMainWindow):
    def __init__(self):
        QMainWindow.__init__(self)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        ########################################################################
        # APPLY JSON STYLESHEET
        ########################################################################
        # self = QMainWindow class
        # self.ui = Ui_MainWindow / user interface class
        loadJsonStyle(self, self.ui)
        ########################################################################

        ########################################################################

        self.show()


########################################################################
## EXECUTE APP
########################################################################
if __name__ == "__main__":
    app = QApplication(sys.argv)
    window = MainWindow()
    sys.exit(app.exec_())
########################################################################
## END===>
###########################################
```#############################  

I am getting the following error 

Traceback (most recent call last):
File "f:\Development\desktop\OCR_Keyboard\main.py", line 26, in
from Custom_Widgets.Widgets import *
File "F:\Development\desktop\Lib\site-packages\shiboken2\files.dir\shibokensupport_feature_.py", line 142, in import
return original_import(name, *args, **kwargs)
File "F:\Development\desktop\lib\site-packages\Custom_Widgets\Widgets.py", line 19, in
from .Qss import SassCompiler
File "F:\Development\desktop\Lib\site-packages\shiboken2\files.dir\shibokensupport_feature
.py", line 142, in import
return original_import(name, *args, **kwargs)
File "F:\Development\desktop\lib\site-packages\Custom_Widgets\Qss\SassCompiler.py", line 20, in
from . SvgToPngIcons import NewIconsGenerator
File "F:\Development\desktop\Lib\site-packages\shiboken2\files.dir\shibokensupport_feature
.py", line 142, in import
return original_import(name, *args, **kwargs)
File "F:\Development\desktop\lib\site-packages\Custom_Widgets\Qss\SvgToPngIcons.py", line 1, in
import cairosvg
File "F:\Development\desktop\Lib\site-packages\shiboken2\files.dir\shibokensupport_feature
.py", line 142, in import
return original_import(name, *args, **kwargs)
File "F:\Development\desktop\lib\site-packages\cairosvg_init
.py", line 26, in
from . import surface # noqa isort:skip
File "F:\Development\desktop\Lib\site-packages\shiboken2\files.dir\shibokensupport_feature_.py", line 142, in import
return original_import(name, *args, **kwargs)
File "F:\Development\desktop\lib\site-packages\cairosvg\surface.py", line 9, in
import cairocffi as cairo
File "F:\Development\desktop\Lib\site-packages\shiboken2\files.dir\shibokensupport_feature
.py", line 142, in import
return original_import(name, *args, **kwargs)
File "F:\Development\desktop\lib\site-packages\cairocffi_init
.py", line 48, in
cairo = dlopen(
File "F:\Development\desktop\lib\site-packages\cairocffi_init_.py", line 45, in dlopen
raise OSError(error_message) # pragma: no cover
OSError: no library called "cairo-2" was found
no library called "cairo" was found
no library called "libcairo-2" was found
cannot load library 'libcairo.so.2': error 0x7e
cannot load library 'libcairo.2.dylib': error 0x7e
cannot load library 'libcairo-2.dll': error 0x7e




i have used these two following solution but all in vain: 

[Solution 1](https://stackoverflow.com/questions/38556368/getting-oserror-dlopen-failed-to-load-a-library-cairo-cairo-2-on-windows)

[Solution 2](https://stackoverflow.com/questions/43449436/oserror-cannot-load-library-libcairo-so-2-error-0x7e-additionally-ctypes-uti?rq=1)

Please needful help is required.

Test example does not run when following installation instructions...

Following the installer doc, and running the 2-line test program does not work:

  • sys not imported
  • iconify not resolved
  • mock not resolved
    etc

Pls update installation doc that is correct and shows how to install from scratch: show all needed dependencies.
Also in the meantime suggest to address #22 and #25.

I got this error when trying to launch the file

Traceback (most recent call last):
  File "C:\Users\aboud\Desktop\New folder\main.py", line 12, in <module>
    from ui_interface import *
  File "C:\Users\aboud\Desktop\New folder\ui_interface.py", line 15, in <module>
    import QSS_Resources_rc
  File "C:\Users\aboud\AppData\Local\Programs\Python\Python310\Lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
    return original_import(name, *args, **kwargs)
ModuleNotFoundError: No module named 'QSS_Resources_rc'

how do I fix it?

The error on MacOS

raise OSError(error_message) # pragma: no cover OSError: no library called "cairo-2" was found no library called "cairo" was found no library called "libcairo-2" was found cannot load library 'libcairo.so.2': dlopen(libcairo.so.2, 0x0002): tried: '/Users/abdullahkucuk/opt/anaconda3/envs/env2/bin/../lib/libcairo.so.2' (no such file), 'libcairo.so.2' (no such file), '/usr/local/lib/libcairo.so.2' (no such file), '/usr/lib/libcairo.so.2' (no such file), '/Users/abdullahkucuk/qtdesigngithub/qtdesign/libcairo.so.2' (no such file) cannot load library 'libcairo.2.dylib': dlopen(libcairo.2.dylib, 0x0002): tried: '/Users/abdullahkucuk/opt/anaconda3/envs/env2/bin/../lib/libcairo.2.dylib' (no such file), 'libcairo.2.dylib' (no such file), '/usr/local/lib/libcairo.2.dylib' (no such file), '/usr/lib/libcairo.2.dylib' (no such file), '/Users/abdullahkucuk/qtdesigngithub/qtdesign/libcairo.2.dylib' (no such file) cannot load library 'libcairo-2.dll': dlopen(libcairo-2.dll, 0x0002): tried: '/Users/abdullahkucuk/opt/anaconda3/envs/env2/bin/../lib/libcairo-2.dll' (no such file), 'libcairo-2.dll' (no such file), '/usr/local/lib/libcairo-2.dll' (no such file), '/usr/lib/libcairo-2.dll' (no such file), '/Users/abdullahkucuk/qtdesigngithub/qtdesign/libcairo-2.dll' (no such file)

I see the suggestion "Install GTK+ for Windows Runtime Environment Installer" but what can i do for MacOS?

Not able to import Custom_Widgets.Widgets when PySide6 is used.

Hello,

I am trying out Custom_Widgets.Widgets library with PySide6.
But, getting issues with importing

`
Type conversion already registered from type QFuture to type QFuture
Traceback (most recent call last):
File "d:\PySIDE6\Ui-Test\main.py", line 12, in
from Custom_Widgets.Widgets import *
File "C:\Users<user>\AppData\Local\Programs\Python\Python310\lib\site-packages\Custom_Widgets\Widgets.py", line 12, in
import iconify as ico #pip install iconify
File "C:\Users<use>\AppData\Local\Programs\Python\Python310\lib\site-packages\iconify_init_.py", line 1, in
from . import anim, fetch, path # noqa: F401
File "C:\Users<user>\AppData\Local\Programs\Python\Python310\lib\site-packages\iconify\anim.py", line 8, in
from iconify.qt import QtCore, QtGui
File "C:\Users<user>\AppData\Local\Programs\Python\Python310\lib\site-packages\iconify\qt.py", line 28, in
raise ImportError(_IMPORT_ERROR_MESSAGE.format(qtlib))
ImportError: Unable to import required Qt libraries from PySide2! Please set the 'ICONIFY_QTLIB' env var to the location of a Qt5 compliant python binding you would like to use.

`

Is there any pre-requisites required to work with PySide6?

Please guide to solve this issue.

minimize and sizeGrip on macOS NOT CLOSED

Hi i'm here cauze, as from title, the app is working fine, except the "minimize" button that's not doin' its job, and the sizeGrip, as well, not working at all. It's a problem of macOS or i've missing something?
i cannot understand also why when i try to view the python code, inside Qt Designer: FORM --> VIEW CODE, i recive an alert: Unable to launch /anaconda3/bin/uic (this append both having conda3 installed or not).

please help meeeee!!!! thank to everyone on u!

is not better to stay on PySide2?

Pyside6 is not working for me and I got an error like this: NameError: Error evaluating PySide6.QtWidgets.QWidget.__init__: name 'PySide6' is not defined

I search it And I Found

yes, I did it before I see this link. so I think just using pyside2 for now is better. I must always change PySide6 to PySide2 :(

Error Qpoints in analogguagewidget.py

WIN 10
Python 3.10.5
Visual Studio Code
Error message :

File "d:\Software\Python-Gui\analoggaugewidget.py", line 744, in rescale_method
   QPoint(-2, - self.widget_diameter / 2 * self.needle_scale_factor),
TypeError: arguments did not match any overloaded call:
 QPoint(): too many arguments
 QPoint(int, int): argument 2 has unexpected type 'float'
 QPoint(QPoint): argument 1 has unexpected type 'int'

cant find anything on this to help look for issue

Problem with PyQt5 Widget

I make a simple window with PyQt5 code,it works fine when I test it.
But when I import Custom_Widgets.Widgets package ,there are some error with my code.

from PyQt5.Qt import *
import sys
import os
from Custom_Widgets.Widgets import *
from test2 import *


class MainWindow(QMainWindow):
    def __init__(self):
        QMainWindow.__init__(self)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        # loadJsonStyle(self, self.ui)

if __name__ == '__main__':
    app = QApplication(sys.argv)
    window = MainWindow()
    window.show()
    sys.exit(app.exec_())

test2 is my pyqt5 code by qtdesigner
And error message is

Traceback (most recent call last):
  File "D:/Code/test/mian2.py", line 23, in <module>
    window = MainWindow()
  File "D:/Code/test/mian2.py", line 18, in __init__
    self.ui.setupUi(self)
  File "D:\Code\test\test2.py", line 18, in setupUi
    self.centralwidget = QtWidgets.QWidget(MainWindow)
TypeError: QWidget(parent: QWidget = None, flags: Union[Qt.WindowFlags, Qt.WindowType] = Qt.WindowFlags()): argument 1 has unexpected type 'MainWindow'

py -3.10 | Mapping in collections

On Python 3.10 during:
from Custom_Widgets.ProgressIndicator import test
There is an import error from collections

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\___Python\Python310\lib\site-packages\Custom_Widgets\ProgressIndicator\test.py", line 16, in <module>
    from Custom_Widgets.ProgressIndicator.ui_interface import *
  File "C:\___Python\Python310\Lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
    return original_import(name, *args, **kwargs)
  File "C:\___Python\Python310\lib\site-packages\Custom_Widgets\ProgressIndicator\ui_interface.py", line 15, in <module>
    from Custom_Widgets.Widgets import FormProgressIndicator
  File "C:\___Python\Python310\Lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
    return original_import(name, *args, **kwargs)
  File "C:\___Python\Python310\lib\site-packages\Custom_Widgets\Widgets.py", line 19, in <module>
    from .Qss import SassCompiler
  File "C:\___Python\Python310\Lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
    return original_import(name, *args, **kwargs)
  File "C:\___Python\Python310\lib\site-packages\Custom_Widgets\Qss\SassCompiler.py", line 13, in <module>
    import qtsass
  File "C:\___Python\Python310\Lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
    return original_import(name, *args, **kwargs)
  File "C:\___Python\Python310\lib\site-packages\qtsass\__init__.py", line 28, in <module>
    from qtsass.api import (
  File "C:\___Python\Python310\Lib\site-packages\shiboken2\files.dir\shibokensupport\__feature__.py", line 142, in _import
    return original_import(name, *args, **kwargs)
  File "C:\___Python\Python310\lib\site-packages\qtsass\api.py", line 16, in <module>
    from collections import Mapping, Sequence
ImportError: cannot import name 'Mapping' from 'collections' (C:\___Python\Python310\lib\collections\__init__.py)

[Errno cairo returned CAIRO_STATUS_WRITE_ERROR: b'error while writing to output stream']

If you encounter this error

[Errno cairo returned CAIRO_STATUS_WRITE_ERROR: b'error while writing to output stream'] 11
[Errno cairo returned CAIRO_STATUS_WRITE_ERROR: b'error while writing to output stream'] 11
[Errno cairo returned CAIRO_STATUS_WRITE_ERROR: b'error while writing to output stream'] 11
[Errno cairo returned CAIRO_STATUS_WRITE_ERROR: b'error while writing to output stream'] 11
[Errno cairo returned CAIRO_STATUS_WRITE_ERROR: b'error while writing to output stream'] 11

[WinError 267] The directory name is invalid: 'C:\\Users\\kibet\\Desktop\\testprojectmaker\\QSS\\00bcff'
Traceback (most recent call last):
  File "C:\Users\kibet\anaconda3\lib\site-packages\Custom_Widgets\WidgetsWorker.py", line 82, in run
    result = self.fn(*self.args, **self.kwargs)
  File "C:\Users\kibet\anaconda3\lib\site-packages\Custom_Widgets\Widgets.py", line 912, in compileSassTheme
    NewIconsGenerator.generateNewIcons(self, progress_callback)
  File "C:\Users\kibet\anaconda3\lib\site-packages\Custom_Widgets\Qss\SvgToPngIcons.py", line 140, in generateNewIcons
    file_names = os.listdir(source_dir)
NotADirectoryError: [WinError 267] The directory name is invalid: 'C:\\Users\\kibet\\Desktop\\testprojectmaker\\QSS\\00bcff'

Support Python3.10+ and PyQt6/Pyside6

Few related issue are here, but in order to add support newer Pythons and Qt there is easy trick.
There are few issues in setup.py:

  • hardcode dependencies Pyside2 - which support up to Python3.9
  • you don't need both PyQt5 and PySide2 just one
  • minor - set two different licenses GPL3 and MIT

Here small refactor of setup.py, I'm lazy and just replace to PySide6 the best solution is to use QtPy abstraction, but there is need update around codebase:

import pathlib
from setuptools import setup

HERE = pathlib.Path(__file__).parent

# The text of the README file
README = (HERE / "README.md").read_text()

setup(
    name = 'QT-PyQt-PySide-Custom-Widgets',         # How you named your package folder (MyLib)
    packages = [
        'Custom_Widgets',
        'Custom_Widgets.ProgressIndicator',
        'Custom_Widgets.Qss',
    ],
    include_package_data=True,
    version = '0.6.4', 
    license="GNU General Public License v3.0",        
    description = 'Custom widgets and widget animations made for QT applications',   # Give a short description about your library
    long_description=README,
    long_description_content_type="text/markdown",
    author = 'Khamisi Kibet',                  
    author_email = '[email protected]',      
    url = 'https://github.com/KhamisiKibet/QT-PyQt-PySide-Custom-Widgets',   
    keywords = ['PySide6', 'animation', 'custom', 'widgets', "QML", "C++", "QT Creator"],  
    install_requires=[
        "PySide6",
        "iconify",
        "cairosvg",
        "qtsass",
        "matplotlib",
        "mock"
    ],
    classifiers=[
        'Development Status :: 3 - Alpha',      
        'Intended Audience :: Developers',     
        'Topic :: Software Development :: Build Tools',
        'License :: OSI Approved :: MIT License',  
        "Programming Language :: Python :: 3.6",
        "Programming Language :: Python :: 3.7",
        "Programming Language :: Python :: 3.8",
        "Programming Language :: Python :: 3.9",
        "Programming Language :: Python :: 3.10",
        "Programming Language :: Python :: 3.11",
    ],
    entry_points={

    },
)

Now you can build:

it will produce dist/QT_PyQt_PySide_Custom_Widgets-0.6.4-py3-none-any.whl

Now you can install with:
pip install <full path to QT_PyQt_PySide_Custom_Widgets-0.6.4-py3-none-any.whl>

Problem with python 3.10

Im currently using python 3.10.5, the first error i get:
File "C:\Users\%USER%\AppData\Local\Programs\Python\Python310\lib\site-packages\qtsass\api.py", line 16, in <module> from collections import Mapping, Sequence ImportError: cannot import name 'Mapping' from 'collections' (C:\Users\%USER%\AppData\Local\Programs\Python\Python310\lib\collections\__init__.py)
Which i understand its not your library, your just using it, and that python 3.10 changed how collections (the library) works, but this isnt were it end, once i go into that library and fix that issue, we get this usse:
cairo = dlopen( File "C:\Users\%USER%\AppData\Local\Programs\Python\Python310\lib\site-packages\cairocffi\__init__.py", line 45, in dlopen raise OSError(error_message) # pragma: no cover OSError: no library called "cairo-2" was found no library called "cairo" was found no library called "libcairo-2" was found cannot load library 'libcairo.so.2': error 0x7e cannot load library 'libcairo.2.dylib': error 0x7e cannot load library 'libcairo-2.dll': error 0x7e
i havent been able to get past this point, but is there anyway this can be fixed?

NameError: name 'sys' is not defined

After installing the library QT-PyQt-PySide-Custom-Widgets, I run the command from Custom_Widgets.ProgressIndicator import test in the terminal I get the following errors:
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/iwan/.local/lib/python3.8/site-packages/Custom_Widgets/ProgressIndicator/test.py", line 23, in <module> from Custom_Widgets.ProgressIndicator.ui_interface import * File "/home/iwan/.local/lib/python3.8/site-packages/Custom_Widgets/ProgressIndicator/ui_interface.py", line 10, in <module> if 'PySide2' in sys.modules: NameError: name 'sys' is not defined
I use Python 3.8.10 version and I tried it on Ubuntu 20.04.4 LTS and Windows 11

Project Builder/Project Setup Wizard

Hello i was trying create demo app by your project maker : https://khamisikibet.github.io/QT-PyQt-PySide-Custom-Widgets/docs/project-maker.html

And i got stuck on this error "

ubuntu@ubuntu-VirtualBox:~/Desktop/Test/QtPyUi$ python3 main.py

Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.

Traceback (most recent call last):

  File "/home/ubuntu/Desktop/Test/QtPyUi/main.py", line 66, in <module>

    window = MainWindow()

  File "/home/ubuntu/Desktop/Test/QtPyUi/main.py", line 31, in __init__

    self.ui.setupUi(self)

  File "/home/ubuntu/Desktop/Test/QtPyUi/ui_interface.py", line 53, in setupUi

    self.centralwidget = QWidget(MainWindow)

TypeError: 'PySide2.QtWidgets.QWidget' called with wrong argument types:

  PySide2.QtWidgets.QWidget(MainWindow)

Supported signatures:

  PySide2.QtWidgets.QWidget(typing.Optional[PySide2.QtWidgets.QWidget] = None, PySide2.QtCore.Qt.WindowFlags = Default(Qt.WindowFlags))

I was trying follow steps in this video also : https://www.youtube.com/watch?v=adC48qZ8p5Y&t=3150s

but get same error when i was importing custom widgets.

Error running test file on Manjaro

Hi
I just discovered your application for making great and modern widgets like analogwidget. Well done.

Before, I must precised than I'm running on Manjaro with the kernel 5.15 and I got Python 3.10 , Pyqt5/6 installed and all is functionnal.

I've downloaded your library with pip without any issues. If necessary, I can give you the installation.

I've tried to test in two ways. The first in a terminal (yakuake) and the second time after creating a file in geany and run this python file in the geany terminal. I've got this. I precise than I 've called my file customwidgettest.py

[olivier@fangorn Developpement]$ python customwidgettest.py File "/home/olivier/Developpement/customwidgettest.py", line 4 form Custom_Widgets.ProgressIndicator import test ^^^^^^^^^^^^^^ SyntaxError: invalid syntax

Did you clear my light ?

Thanks a lot by advance.

ERROR: TypeError: setWindowIcon(self, QIcon): argument 1 has unexpected type 'PySide2.QtGui.QIcon'

Hello, I am trying to apply the style to PyQt5 but I have not been able to, apparently I am mixing Pyside with PyQt. Can anybody help me?

`
import sys
import os

from Custom_Widgets.Widgets import *

from gui.uis.main_interfaz import Ui_MainWindow

from PyQt5.QtWidgets import QMainWindow, QApplication, QWidget, QDialog
import math

class VentanaPrincipal(QMainWindow, Ui_MainWindow):
def init(self, parent=None):
QMainWindow.init(self, parent)
self.setupUi(self)

    # APPLY JSON STYLESHEET
    
    # self = QMainWindow class
    self.ui = Ui_MainWindow() #/ user interface class
    loadJsonStyle(self, self.ui)

if name == "main":
app = QApplication([])
window = VentanaPrincipal()
window.show()
app.exec_()
`

Error

i am getting this error when i run the test code

Traceback (most recent call last):
File "c:\Users\georg\OneDrive\Υπολογιστής\from Custom_Widgets.ProgressIndicator im.py", line 1, in
from Custom_Widgets.ProgressIndicator import test
File "C:\Users\georg\AppData\Local\Programs\Python\Python39\lib\site-packages\Custom_Widgets\ProgressIndicator\test.py", line 23, in
from Custom_Widgets.ProgressIndicator.ui_interface import *
File "C:\Users\georg\AppData\Local\Programs\Python\Python39\lib\site-packages\Custom_Widgets\ProgressIndicator\ui_interface.py", line 10, in
if 'PySide2' in sys.modules:
NameError: name 'sys' is not defined

cairo-2 not found

Hello,
I have issue installing Custom Widget. I have already install pycairo. I report here the error:
Thanks in advance

from Custom_Widgets.ProgressIndicator import test
Traceback (most recent call last):
File "", line 1, in
File "C:\Python\Python_3.9.7\Lib\site-packages\shiboken2\files.dir\shibokensupport_feature_.py", line 142, in import
return original_import(name, *args, **kwargs)
File "C:\Python\Python_3.9.7\lib\site-packages\Custom_Widgets\ProgressIndicator\test.py", line 32, in
from Custom_Widgets.ProgressIndicator.ui_interface import *
File "C:\Python\Python_3.9.7\Lib\site-packages\shiboken2\files.dir\shibokensupport_feature
.py", line 142, in import
return original_import(name, *args, **kwargs)
File "C:\Python\Python_3.9.7\lib\site-packages\Custom_Widgets\ProgressIndicator\ui_interface.py", line 15, in
from Custom_Widgets.Widgets import FormProgressIndicator
File "C:\Python\Python_3.9.7\Lib\site-packages\shiboken2\files.dir\shibokensupport_feature
.py", line 142, in import
return original_import(name, *args, **kwargs)
File "C:\Python\Python_3.9.7\lib\site-packages\Custom_Widgets\Widgets.py", line 19, in
from .Qss import SassCompiler
File "C:\Python\Python_3.9.7\Lib\site-packages\shiboken2\files.dir\shibokensupport_feature
.py", line 142, in import
return original_import(name, *args, **kwargs)
File "C:\Python\Python_3.9.7\lib\site-packages\Custom_Widgets\Qss\SassCompiler.py", line 39, in
from . SvgToPngIcons import NewIconsGenerator
File "C:\Python\Python_3.9.7\Lib\site-packages\shiboken2\files.dir\shibokensupport_feature
.py", line 142, in import
return original_import(name, *args, **kwargs)
File "C:\Python\Python_3.9.7\lib\site-packages\Custom_Widgets\Qss\SvgToPngIcons.py", line 1, in
import cairosvg
File "C:\Python\Python_3.9.7\Lib\site-packages\shiboken2\files.dir\shibokensupport_feature
.py", line 142, in import
return original_import(name, *args, **kwargs)
File "C:\Python\Python_3.9.7\lib\site-packages\cairosvg_init
.py", line 26, in
from . import surface # noqa isort:skip
File "C:\Python\Python_3.9.7\Lib\site-packages\shiboken2\files.dir\shibokensupport_feature_.py", line 142, in import
return original_import(name, *args, **kwargs)
File "C:\Python\Python_3.9.7\lib\site-packages\cairosvg\surface.py", line 9, in
import cairocffi as cairo
File "C:\Python\Python_3.9.7\Lib\site-packages\shiboken2\files.dir\shibokensupport_feature
.py", line 142, in import
return original_import(name, *args, **kwargs)
File "C:\Python\Python_3.9.7\lib\site-packages\cairocffi_init
.py", line 48, in
cairo = dlopen(
File "C:\Python\Python_3.9.7\lib\site-packages\cairocffi_init_.py", line 45, in dlopen
raise OSError(error_message) # pragma: no cover
OSError: no library called "cairo-2" was found
no library called "cairo" was found
no library called "libcairo-2" was found
cannot load library 'libcairo.so.2': error 0x7e
cannot load library 'libcairo.2.dylib': error 0x7e
cannot load library 'libcairo-2.dll': error 0x7e

Error

from collections import Mapping, Sequence
ImportError: cannot import name 'Mapping' from 'collections' (C:\Users\mazen\AppData\Local\Programs\Python\Python310\lib\collections_init_.py

Pyqt6 and pyside6

TypeError: 'PySide2.QtWidgets.QWidget' called with wrong argument types:
PySide2.QtWidgets.QWidget(QFrame)
Supported signatures:
PySide2.QtWidgets.QWidget(typing.Optional[PySide2.QtWidgets.QWidget] = None, PySide2.QtCore.Qt.WindowFlags = Default(Qt.WindowFlags))

Keeps Trying to Generate Icons Every time I open the app.

After applying the theme and commenting out the code for applying the theme, every time I open run main.py it tries to generate new icons again. The only way I have found to stop it from trying to generate the icons again is to comment out

QAppSettings.updateAppSettings(self)

Of course when I do that the theme disappears.

  <# # Apply Theme to the application
    QAppSettings.updateAppSettings(self)
    # settings = QSettings()
    # # # CHANGE THE THEME NAME IN SETTINGS
    # # Use one of the app themes from your JSON file
    # settings.setValue("THEME", "Default-Dark")
    # #
    # # # RE APPLY THE NEW SETTINGS
    # # # CompileStyleSheet might also work
    # # # CompileStyleSheet.applyCompiledSass(self)
    # QAppSettings.updateAppSettings(self)>

.........\QSS\main.py"
Current icons color None New icons color #fff
Generating icons for your theme, please wait. This may take long

Process finished with exit code 0

'MainWindow' object has no attribute 'moveWindow'

I'm currently using Python 3.10 and while testing custom widget, I got error:

##########################################################################
Traceback (most recent call last):
File "G:\Python\Project\Z\main.py", line 20, in
window = MainWindow()
^^^^^^^^^^^^
File "G:\Python\Project\Z\main.py", line 13, in init
loadJsonStyle(self, self.ui)
File "G:\Python\Python\Lib\site-packages\Custom_Widgets\Widgets.py", line 1492, in loadJsonStyle
applyJsonStyle(self, self.ui, data)
File "G:\Python\Python\Lib\site-packages\Custom_Widgets\Widgets.py", line 2290, in applyJsonStyle
getattr(self.ui, str(navigation["moveWindow"])).mouseMoveEvent = self.moveWindow
^^^^^^^^^^^^^^^
AttributeError: 'MainWindow' object has no attribute 'moveWindow'
##########################################################################

So, what should I do to fix the problem.

TyperError

TypeError: arguments did not match any overloaded call:
QPoint(): too many arguments
QPoint(int, int): argument 2 has unexpected type 'float'
QPoint(QPoint): argument 1 has unexpected type 'int'

Major issue and recommendation

I've seen (and also experienced) multiple issues with this library, Here are some of them:

  1. Sys not imported in some files, Fix: import sys in the files that need it
  2. 3.10 Mapping with collections, Fix: not much you can do but tell people to change the collections to collections.abc in the file it is complaining about
  3. Svg2Png conversion, this one is a huge issue, beacuse yes, gtk is needed for CairoSVG, but, for people like me, i dont want people to have to download another system ontop of all the ones for my project, and so my work around was to completely disabled that script from being used, which means i cant use anything related to themes now, Fix: possable switch to an easier and more reliable Svg converter, maybe even something like svglib

These are all the issue and possible fixes that do need resolved

Cairocffi missing

import cairocffi as cairo
  File "C:\Program Files (x86)\Python39-32\lib\site-packages\cairocffi\__init__.py", line 48, in <module>
  cairo = dlopen(
    File "C:\path\to\cairocffi\__init__.py", line 44, in dlopen
   raise OSError(error_message)  # pragma: no cover

OSError: no library called "cairo-2" was found
no library called "cairo" was found
no library called "libcairo-2" was found
cannot load library 'libcairo.so.2': error 0x7e
cannot load library 'libcairo.2.dylib': error 0x7e
cannot load library 'libcairo-2.dll': error 0x7e

Hi I am facing this error

OSError: no library called "cairo-2" was found
no library called "cairo" was found
cannot load library 'C:\Program Files (x86)\GTK2-Runtime\bin\libcairo-2.dll': error 0xc1
cannot load library 'libcairo.so.2': error 0x7e
cannot load library 'libcairo.2.dylib': error 0x7e
cannot load library 'libcairo-2.dll': error 0xc1

pip install I installed QT-PyQt-PySide-Custom-Widgets

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies

ERROR: Cannot install qt-pyqt-pyside-custom-widgets==0.0.8, qt-pyqt-pyside-custom-widgets==0.0.9, qt-pyqt-pyside-custom-widgets==0.1.0, qt-pyqt-pyside-custom-widgets==0.1.1, qt-pyqt-pyside-custom-widgets==0.1.2, qt-pyqt-pyside-custom-widgets==0.1.3, qt-pyqt-pyside-custom-widgets==0.1.4, qt-pyqt-pyside-custom-widgets==0.1.5, qt-pyqt-pyside-custom-widgets==0.1.6, qt-pyqt-pyside-custom-widgets==0.1.7, qt-pyqt-pyside-custom-widgets==0.1.8, qt-pyqt-pyside-custom-widgets==0.1.9, qt-pyqt-pyside-custom-widgets==0.2.0, qt-pyqt-pyside-custom-widgets==0.2.1, qt-pyqt-pyside-custom-widgets==0.2.2, qt-pyqt-pyside-custom-widgets==0.2.3, qt-pyqt-pyside-custom-widgets==0.2.4, qt-pyqt-pyside-custom-widgets==0.2.5, qt-pyqt-pyside-custom-widgets==0.2.6, qt-pyqt-pyside-custom-widgets==0.3.1, qt-pyqt-pyside-custom-widgets==0.3.2, qt-pyqt-pyside-custom-widgets==0.3.6, qt-pyqt-pyside-custom-widgets==0.3.7, qt-pyqt-pyside-custom-widgets==0.3.8, qt-pyqt-pyside-custom-widgets==0.3.9, qt-pyqt-pyside-custom-widgets==0.4.1, qt-pyqt-pyside-custom-widgets==0.4.3, qt-pyqt-pyside-custom-widgets==0.4.6, qt-pyqt-pyside-custom-widgets==0.4.8, qt-pyqt-pyside-custom-widgets==0.4.9, qt-pyqt-pyside-custom-widgets==0.5.0, qt-pyqt-pyside-custom-widgets==0.5.1, qt-pyqt-pyside-custom-widgets==0.5.2, qt-pyqt-pyside-custom-widgets==0.5.3, qt-pyqt-pyside-custom-widgets==0.5.4, qt-pyqt-pyside-custom-widgets==0.5.5, qt-pyqt-pyside-custom-widgets==0.5.6, qt-pyqt-pyside-custom-widgets==0.5.7, qt-pyqt-pyside-custom-widgets==0.5.8, qt-pyqt-pyside-custom-widgets==0.5.9, qt-pyqt-pyside-custom-widgets==0.6.0, qt-pyqt-pyside-custom-widgets==0.6.1, qt-pyqt-pyside-custom-widgets==0.6.2 and qt-pyqt-pyside-custom-widgets==0.6.3 because these package versions have conflicting dependencies.

runtime error

I followed steps as per your documentation, but getting the following error during running:
AttributeError: 'PySide2.QtWidgets.QPushButton' object has no attribute 'setObjectTheme'

Not working with PySide6

Hello
I have Pyside 6 installed. But, when using pip install command, pip installs also PyQt5 and PySide 2.

To launch ProjectMaker, it stucks with error: "Please install PySide2 or Pyside6"… so I’ve both now…

Tweaking by doing "import PySide6" before launching ProjectMaker, it works! But I can’t launch main.py, because: name "PySide6" is not defined !

Any way to use your widgets with PySide6 (only) ? I’m using Windows (with PyCharm and poetry).

Thanks !

I got this by mistake after adding loadJsonStyle to main.py and I couldn't solve it even though I tried for hours

Traceback (most recent call last):
File "c:\Users\Emir\Desktop\OOPP2\main.py", line 3, in
from interface import *
File "c:\Users\Emir\Desktop\OOPP2\interface.py", line 563, in
from Custom_Widgets.Widgets import QCustomSlideMenu, QCustomStackedWidget
File "C:\Users\Emir\AppData\Roaming\Python\Python310\site-packages\shiboken2\files.dir\shibokensupport_feature_.py", line 142, in import
return original_import(name, *args, **kwargs)
File "C:\Users\Emir\AppData\Roaming\Python\Python310\site-packages\Custom_Widgets\Widgets.py", line 20, in
from .Qss import SassCompiler
File "C:\Users\Emir\AppData\Roaming\Python\Python310\site-packages\shiboken2\files.dir\shibokensupport_feature
.py", line 142, in import
return original_import(name, *args, **kwargs)
File "C:\Users\Emir\AppData\Roaming\Python\Python310\site-packages\Custom_Widgets\Qss\SassCompiler.py", line 25, in
from .SvgToPngIcons import NewIconsGenerator
File "C:\Users\Emir\AppData\Roaming\Python\Python310\site-packages\shiboken2\files.dir\shibokensupport_feature
.py", line 142, in import
return original_import(name, *args, **kwargs)
File "C:\Users\Emir\AppData\Roaming\Python\Python310\site-packages\Custom_Widgets\Qss\SvgToPngIcons.py", line 1, in
import cairosvg
File "C:\Users\Emir\AppData\Roaming\Python\Python310\site-packages\shiboken2\files.dir\shibokensupport_feature
.py", line 142, in import
return original_import(name, *args, **kwargs)
File "C:\Users\Emir\AppData\Roaming\Python\Python310\site-packages\cairosvg_init
.py", line 26, in
from . import surface # noqa isort:skip
File "C:\Users\Emir\AppData\Roaming\Python\Python310\site-packages\shiboken2\files.dir\shibokensupport_feature_.py", line 142, in import
return original_import(name, *args, **kwargs)
File "C:\Users\Emir\AppData\Roaming\Python\Python310\site-packages\cairosvg\surface.py", line 9, in
import cairocffi as cairo
File "C:\Users\Emir\AppData\Roaming\Python\Python310\site-packages\shiboken2\files.dir\shibokensupport_feature
.py", line 142, in import
return original_import(name, *args, **kwargs)
File "C:\Users\Emir\AppData\Roaming\Python\Python310\site-packages\cairocffi_init
.py", line 48, in
cairo = dlopen(
File "C:\Users\Emir\AppData\Roaming\Python\Python310\site-packages\cairocffi_init_.py", line 45, in dlopen
raise OSError(error_message) # pragma: no cover
OSError: no library called "cairo-2" was found
no library called "cairo" was found
no library called "libcairo-2" was found
cannot load library 'libcairo.so.2': error 0x7e
cannot load library 'libcairo.2.dylib': error 0x7e
cannot load library 'libcairo-2.dll': error 0x7e

Installation error on Ubuntu.

jud@qt-devel:$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focal
jud@qt-devel:
$ pip3 install QT-PyQt-PySide-Custom-Widgets
Collecting QT-PyQt-PySide-Custom-Widgets
Using cached QT-PyQt-PySide-Custom-Widgets-0.3.9.tar.gz (60 kB)
Collecting PyQt5
Using cached PyQt5-5.15.6-cp36-abi3-manylinux1_x86_64.whl (8.3 MB)
Requirement already satisfied: PySide2 in ./.local/lib/python3.8/site-packages (from QT-PyQt-PySide-Custom-Widgets) (5.15.2)
Collecting cairosvg
Using cached CairoSVG-2.5.2-py3-none-any.whl (45 kB)
ERROR: Could not find a version that satisfies the requirement codecs (from QT-PyQt-PySide-Custom-Widgets) (from versions: none)
ERROR: No matching distribution found for codecs (from QT-PyQt-PySide-Custom-Widgets)

Weird Behavior

Hi, I would like to thank you for this amazing repo.
I was testing your programs and they bahave a bit weirdly.
When Sliding Widget is expanded, the main window keeps increasing in size.
qslide

tutorial

Do you have any ideas how to fix this?

The error after installing the package 'libxcb.dll'

I got an error after installing the package first, Cairo Library ... After installing it, this error appeared in this library

lib = ffi.dlopen(soname)
OSError: cannot load library 'libxcb.dll': error 0x7e

python code is not working

Hi, I've installed QT-PyQt-PySide-Custom-Widgets as you show in your video and this is in your file "SOURCES.txt".
But there is an error and I can't open any examples. It's always shows an error that some imports are impossible.

Then I tried to run the code which you put into file "SOURCES.txt" and have an error. Could you help please?
"from Custom_Widgets.ProgressIndicator import test
test.main()"

There is a full text of error in attached file

QT-PyQt-PySide_Custome_Widgets _ error.txt

Confusing instructions: from Custom_Widgets.ProgressIndicator should be run from a python3 shell

I'm running Linux Mint, python 3 .8.10, and after successfully running "pip install QT-PyQt-PySide-Custom-Widgets", I try to follow the Installation Testing that state that I should Run this from your terminal or create a python file: from Custom_Widgets.ProgressIndicator import test ... but "from" is not a valid shell command!

I suggest changing the test instructions to: Create a file test.py with the following code:

from Custom_Widgets.ProgressIndicator import test
test.main()

Run it from the command line with python3 test.py

One last thing: The test still didn't run after running pip install PySide6 but did after pip install PySide2

Thanks for your all your work!

The following error occurred. Why?

from Custom_Widgets import ProjectMaker
Traceback (most recent call last):
File "", line 1, in
File "C:\anaconda3\envs\venv_test\lib\site-packages\Custom_Widgets\ProjectMaker.py", line 14, in
import cairosvg
File "C:\anaconda3\envs\venv_test\lib\site-packages\cairosvg_init_.py", line 26, in
from . import surface # noqa isort:skip
File "C:\anaconda3\envs\venv_test\lib\site-packages\cairosvg\surface.py", line 9, in
import cairocffi as cairo
File "C:\anaconda3\envs\venv_test\lib\site-packages\cairocffi_init_.py", line 50, in
('libcairo.so.2', 'libcairo.2.dylib', 'libcairo-2.dll'))
File "C:\anaconda3\envs\venv_test\lib\site-packages\cairocffi_init_.py", line 45, in dlopen
raise OSError(error_message) # pragma: no cover
OSError: no library called "cairo-2" was found
no library called "cairo" was found
no library called "libcairo-2" was found
cannot load library 'libcairo.so.2': error 0x7e
cannot load library 'libcairo.2.dylib': error 0x7e
cannot load library 'libcairo-2.dll': error 0x7e

Is it a Windows OS error?

No module named 'PySide2'

from PySide2.QtCore import * # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'PySide2'

How can we use multiple gauges on one window?

How can we have multiple instances of the Analog gauge on a single window? I have need of having 5 or 6 different gauges (different sizes, min, max, increment, etc for measuring different things) on the same window.

Toggle Button issue with CustomSlideMenu

Following the instructions for animated side menu, I encounter the following

Traceback (most recent call last):
File "C:\Users\Musa Abdullahi\Desktop\PyQt5GUI\main.py", line 66, in
window = MainWindow()
File "C:\Users\Musa Abdullahi\Desktop\PyQt5GUI\main.py", line 39, in init
loadJsonStyle(self, self.ui)
File "C:\Users\Musa Abdullahi\AppData\Local\Programs\Python\Python310\lib\site-packages\Custom_Widgets\Widgets.py", line 1492, in loadJsonStyle
applyJsonStyle(self, self.ui, data)
File "C:\Users\Musa Abdullahi\AppData\Local\Programs\Python\Python310\lib\site-packages\Custom_Widgets\Widgets.py", line 1604, in applyJsonStyle
raise Exception("Error: Button named"+str(button)+" was not found.")
Exception: Error: Button namedpushButton was not found.

For some reason, it expects the toggle button to be in the QPushButtonGroups

Some Questions in Installation

My Environment : Windows 11 Pro , python 3.7.10, conda 4.11.0

When I use command "pip install QT-PyQt-PySide-Custom-Widgets" installing the pkgs, there is nothing happened. It's means everything is OK (that what I thought). But when I run the following code to see if the installation was successful.
-------------python 3.7.10

from Custom_Widgets.ProgressIndicator import test

Lots of errors have occurred! Look like this:

OSError: no library called "cairo-2" was found
no library called "cairo" was found
cannot load library 'D:\GTK2-Runtime Win64\bin\libcairo-2.dll': error 0x7f
cannot load library 'libcairo.so.2': error 0x7e
cannot load library 'libcairo.2.dylib': error 0x7e
cannot load library 'libcairo-2.dll': error 0x7f

I spent my whole day trying to solve it, but I failed. Up to now, I even donot understand what's the problem is! It makes me desperate!

Below are the solution I have ever tryed:
pip install cairosvg
pip install cairocffi
Install GTK+ for Windows Runtime Environment Installer: 64-bit
Refer to stackflow
install uniconvertor-2.0rc4-win64_headless

During this time, I restart my system a few times, but Nothing changed,

Hope someone could help me , Thanks a lot!

QRect- overloaded error

I have that error after applying Notification button and apply the JS code, after running:
this error appears:
" Traceback (most recent call last):
File "C:\Users\IslamShahin\AppData\Local\Programs\Python\Python310\lib\site-packages\Custom_Widgets\Widgets.py", line 1466, in paintEvent
self.floatMenu()
File "C:\Users\IslamShahin\AppData\Local\Programs\Python\Python310\lib\site-packages\Custom_Widgets\Widgets.py", line 1152, in floatMenu
self.height()))
TypeError: arguments did not match any overloaded call:
QRect(): too many arguments
QRect(int, int, int, int): argument 1 has unexpected type 'float'
QRect(QPoint, QPoint): argument 1 has unexpected type 'float'
QRect(QPoint, QSize): argument 1 has unexpected type 'float'
QRect(QRect): argument 1 has unexpected type 'float'
PS C:\Users\IslamShahin\Documents\Custom Widget Example> c:; cd 'c:\Users\IslamShahin\Documents\Custom Widget Example'; & 'C:\Users\IslamShahin\AppData\Local\Programs\Python\Python310\python.exe' 'c:\Users\IslamShahin.vscode\extensions\ms-python.python-2023.2.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher' '55179' '--' 'c:\Users\IslamShahin\Documents\Custom Widget Example\main.py'

Useing different buttons to control a CustomSlideMenu

Hi,

I got a issue when I want to use different push buttons to control a CustomSlideMenu. The documentation only gives me the option to use the same button to control both collapsed and expanded.

"toggleButton": [{
			"buttonName": "open_close_side_bar_btn",
			"icons": [{
				"whenMenuIsCollapsed": ":/icons/icons/align-left.svg",
				"whenMenuIsExpanded": ":/icons/icons/chevron-left.svg"
			}],
			"style": [{
				"whenMenuIsCollapsed": [
					"border: 2px solid transparent"
				],
				"whenMenuIsExpanded": [
					"border: 2px solid rgb(9, 5, 13)"
				]
			}]

May I know if there's a way to use different button control different tasks?

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.