Git Product home page Git Product logo

dayu_widgets's Introduction

dayu_widgets

python version PyPI version Downloads Status License pypi format Maintenance

All Contributors

Components for PySide

主要参考了 AntDesign 组件库,其他参考了 iView 组件库,微信基础组件。

更多在此基础上的组件插件:

提供亮色(light)暗色(dark) 两种主题,每种主题可以设置主题颜色。 以下截图以:

  • 亮色 #1890ff
  • 暗色 #fa8c16

General

MPushButton(<- QPushButton)

pagerespageres

MLabel (<- QLabel)

pagerespageres

MLoading (<- QWidget)

pagerespageres

MToolButton (<- QToolButton)

pagerespageres

Navigation

MBreadcrumb (<- QWidget)

pagerespageres

MMenuTabWidget (<- QWidget)

pagerespageres

MPage (<- QWidget)

pagerespageres

Data Entry

MCheckBox <- QCheckBox

pagerespageres

MClickBrowserFilePushButton <- MPushButton

MClickBrowserFileToolButton <- MToolButton

MClickBrowserFolderPushButton <- MPushButton

MClickBrowserFolderToolButton <- MToolButton

MDragFileButton <- MToolButton

MDragFolderButton <- MToolButton

pagerespageres

MLineEdit <- QLineEdit

pagerespageres

MRadioButton <- QRadioButton

pagerespageres

MSwitch <- QRadioButton

pagerespageres

MSilder <- QSlider

pagerespageres

MSpinBox <- QSpinBox

MDoubleSpinBox <- QDoubleSpinBox

MDateTimeEdit <- QDateTimeEdit

MDateEdit <- QDateEdit

MTimeEdit <- QTimeEdit

pagerespageres

Data Display

MAvatar <- QLabel

pagerespageres

MBadge <- QWidget

pagerespageres

MCarousel <- QGraphicsView

pagerespageres

MCard <- QWidget

pagerespageres

MCollapse <- QWidget

pagerespageres

MLineTabWidget <- QWidget

pagerespageres

MTag <- QLabel

MCheckableTag <- QCheckBox

MNewTag <- QWidget

pagerespageres

Feedback

MAlert <- QWidget

pagerespageres

MDrawer <- QWidget

pagerespageres

MMessage <- QWidget

pagerespageres

MProgressBar <- QProgressBar

pagerespageres

MProgressCircle <- QProgressBar

pagerespageres

MToast <- QWidget

pagerespageres

Other

MDivider <- QWidget

pagerespageres

如何贡献代码

安装poetry

shell pip install poetry

安装依赖

poetry install

运行单元测试

poetry run pytest

运行 black检查

poetry run black dayu_widgets

运行isort

poetry run isort dayu_widgets

提交代码

poetry run cz commit

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Yanru Mu

💻

Hal

💻

FXTD-ODYSSEY

💻

dayu_widgets's People

Contributors

fanshiyuan001 avatar github-actions[bot] avatar loonghao avatar muyr avatar renovate[bot] avatar wandth avatar zsd-tim 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

dayu_widgets's Issues

样式表可否支持PyQt原生类?比如QListWidget

Describe the bug
QListWidget现在没有MListWidget的替代
自定义样式和整体dayu_widgets样式不统一,且自定义还需要定义亮暗主题,较为麻烦

Expected behavior
希望支持原类,原类只需支持基本样式,dayu_sise不必支持,增加灵活性

Screenshots
image

MLabel引起线程问题崩溃

MLabel的__init__
self.setTextInteractionFlags(QtCore.Qt.TextBrowserInteraction | QtCore.Qt.LinksAccessibleByMouse)
在houdini的18.5, py2.7运行容易出现线程问题而引起奔溃
例如在一个widget类中创建另一个widget窗口

当前版本在3dsmax运行的问题

我用的是max 2017,当前版本的dayu_widgets是使用Qt.py来导入的,然后我在max里面一引入Qt就直接崩溃了
有没有什么好的解决方案

No module named 'dayu_path'

File "\dayu_widgets\sequence_file.py", line 11, in
from dayu_path import DayuPath
No module named 'dayu_path'
慕姐姐 瞅一眼

page.py模块的几个问题

dayu_widgets/page.py
1: 92行
self._current_page_spin_box.valueChanged.connect(self._emit_page_changed)
信号槽不放在底下对应self.bind之后,返回的是MSpinBox控件上次的数值

2:140行
def _slot_change_current_page(self, offset): self.set_field("current_page", self.field("current_page") + offset) self._emit_page_changed()
self._emit_page_changed()会导致self._pre_button和self._next_button点击时发送两次信号

3:108行
self.bind("total_page", self._current_page_spin_box, "maximum")
设置了这个bind以后,self._current_page_spin_box.setMinimum(1) 失效

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

github-actions
.github/workflows/bumpversion.yml
  • actions/checkout v3
.github/workflows/python-publish.yml
  • actions/checkout v3
  • actions/setup-python v4
pep621
pyproject.toml
  • poetry-core >=1.0.0
poetry
pyproject.toml
  • python >=2.7,<2.8 || >=3.6.0
  • six ^1.16.0
  • singledispatch ^3.7.0
  • Qt.py ^1.3.6
  • dayu-path ^0.5.2
  • pytest ^7.0.0
  • pytest-qt ^4.0.2
  • isort ^5.10.1
  • commitizen ^2.20.0

  • Check this box to trigger a request for Renovate to run again on this repository

MMessage 显示位置错误

在DCC 中 显示Widget窗口 将 MMessage 显示在该窗口**存在 MMessage widget 偏移问题

修改前
image

修改后
image

修复方法:
dayu_widgets/message 133 行
image

MComboBox搜索功能鼠标箭头图标bug

鼠标样式改不回来了
MCombBox-error

复现过程
使用范例 combo_box_example.py
鼠标停留在搜索上显示手指图标时输入字符进行搜索,这之后图标一直都是手指,无法改回箭头图标

OS: Windows11
Qt: PyQt5
Python: conda 3.7

Is the TagWidget missing?

Hi guys, this looks like great work!
I'd be especially interested in the TagWidget but can't seem to find it in the code. If I am I overlooking it, could you please guide me to where I can find it?
Thanks!

MPage的页数信号错误

MPage的页数信号错误
每次切换Page size的时候,信号回传的值都为上一次的值

MPage01
MPage02

排查了一下是在Page size切换信号发出来的时候,page_size_selected的数值还未更新
self._change_page_size_button.sig_value_changed.connect(self._emit_page_changed)调到
self.bind( "page_size_selected", self._change_page_size_button, "value", signal="sig_value_changed", )
这里之后就可以正常了

样式表固定颜色疑问

Describe the bug
dayu_widgets/static/main.qss 样式表内有两处颜色是固定色,当背景色太深时,字体颜色太黑看不清

To Reproduce
Steps to reproduce the behavior:

  1. 运行examples/demo.py
  2. 选择左侧任意项

Expected behavior
希望可以换成自动颜色(深色背景白字,浅色背景黑字)

Screenshots
Snipaste_2024-06-13_16-33-48

image

PyQt4 support?

Thanks for this powerful widgets. I want to know if you have a plan to support PyQt4.
I run the code with PyQt4 env and there are many QString(come from .property()) based error.

在houdini中实例化MDivider错误

Describe the bug
实例化的时候出现如下错误
RuntimeError: Internal C++ object (PySide2.QtWidgets.QProxyStyle) already deleted.
image

houdini版本:19.0.531

MSortFilterModel 开启 recursiveFilteringEnabled 过滤触发报错

LogPython: Error: Traceback (most recent call last):
LogPython: Error:   File "C:\Magician\python\3.8\dayu_widgets\item_model.py", line 135, in rowCount
LogPython: Error: return len(children_obj) if not hasattr(children_obj, 'next') else 0
LogPython: Error: TypeError
LogPython: Error: : 
LogPython: Error: object of type 'NoneType' has no len()

image

加上是否为空的判断可以修复问题

怎样在写 maya界面时用呢

你好,我试了一下,有一些报错。先说Qt文件没有,然后说functools里有个模块没有,应该是maya本身是py2的原因,请问怎么兼容进去吗

Running on python 3.11.7 some cast to int are needed

Describe the bug
Qtwidgets complain on use float instead of int

To Reproduce
python examples/carousel_example.py

$ python carousel_example.py 
QSocketNotifier: Can only be used with threads started with QThread
qt.qpa.qgnomeplatform.theme: The desktop style for QtQuick Controls 2 applications is not available on the system (qqc2-desktop-style). The application may look broken.
Traceback (most recent call last):
  File "/home/alberto/.local/lib/python3.11/site-packages/dayu_widgets/switch.py", line 45, in minimumSizeHint
    return QtCore.QSize(height, height / 2)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: arguments did not match any overloaded call:
  QSize(): too many arguments
  QSize(w: int, h: int): argument 1 has unexpected type 'float'
  QSize(a0: QSize): argument 1 has unexpected type 'float'

Expected behavior
Run the example

Screenshots
Not sure if all works smoothly, but it looks like using patch provided at the end

Desktop (please complete the following information):

  • OS: linux fedora 38
  • Qt Version:
$ qmake-qt5 --version
QMake version 3.1
Using Qt version 5.15.11 in /usr/lib64
$ qmake-qt4 --version
QMake version 2.01a
Using Qt version 4.8.7 in /usr/lib64
  • Python Version: 3.11.7

Additional context

this patch fixes it:

diff --git c/dayu_widgets/carousel.py i/dayu_widgets/carousel.py
index a5c55b2..ee4dc41 100644
--- c/dayu_widgets/carousel.py
+++ i/dayu_widgets/carousel.py
@@ -92,7 +92,7 @@ class MCarousel(QtWidgets.QGraphicsView):
         hud_widget = QtWidgets.QWidget(self)
         hud_widget.setLayout(self.navigate_lay)
         hud_widget.setStyleSheet("background:transparent")
-        hud_widget.move(width / 2 - total_width / 2, height - 30)
+        hud_widget.move(int(width / 2 - total_width / 2), height - 30)
 
         self.setFixedWidth(width + 2)
         self.setFixedHeight(height + 2)
diff --git c/dayu_widgets/switch.py i/dayu_widgets/switch.py
index b56cf8c..041fb15 100644
--- c/dayu_widgets/switch.py
+++ i/dayu_widgets/switch.py
@@ -42,7 +42,7 @@ class MSwitch(QtWidgets.QRadioButton):
         :return:
         """
         height = self._dayu_size * 1.2
-        return QtCore.QSize(height, height / 2)
+        return QtCore.QSize(int(height), int(height / 2))
 
     def get_dayu_size(self):
         """

Maybe previously floats are allowed or all that divisions are cast to int?

closeable vs closable

刚刚意识到,dayu_widgets 里使用了两个单词来代表“可关闭的”,closeable 和 closable,具体的区别我也不太懂,最后决定统一使用“closable”,因为 QTabBar 中的属性是 “tabsClosable ”,所以同步一致。

涉及到的组件有:

  • MAlert
  • MCollapse

MTableModel setData BUG

set_obj_value(data_obj, key, value)

如果 data_object 的 key 元素是个字典, 触发 edit 编辑之后会变成字符串

所以这里要保留原先的字典状态

val = data_obj.get(key)
if isinstance(val,dict):
    set_obj_value(val, "name", value)
else:
    set_obj_value(data_obj, key, value)
# 采用 self.dataChanged.emit方式在houdini16里面会报错      

我这里是修改为上述的代码 , 字典模式下默认显示 "name" 的值

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.