Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: If using "Promoted Widget", How to add LivePlotWidget(title=...., axisItems=......, **kwargs) #13

Closed
optio50 opened this issue Nov 24, 2022 · 2 comments

Comments

@optio50
Copy link

optio50 commented Nov 24, 2022

I don't normally use a promoted widget but thought I would try it out in QT Designer.
Normally I create the widget manually.
If it's promoted and created in the QT Designer how do I add,
LivePlotWidget(title="Chart Title", axisItems={'bottom': bottom_axis}, **kwargs)

I can add title with .setLabels
I can add axisItems with .setAxisItems

Those are done with pyqtgraph options.
How do I add ** kwargs that recognize the pglive crosshairs?

Can it all be done with a one liner like I normally do with a widget created manually?

I know you're busy. Thanks for looking.

@domarm-comat
Copy link
Owner

domarm-comat commented Nov 24, 2022

Qt is using property system to add additional properties to the widget after widget creation. In designer, you can do it by adding dynamic property:

Qt Designer_008

However pyqtgraph doesn't support this approach and therefore it's not possible in pglive. It would be quite a lot of work to implement and wrap every property to be compatible with get / set property system of Qt. Each property name would have to be checked and bind with it's function call in pyqtgraph. Also it's not possible to pass lists, tuples or dicts from designer, only static types such as string, int, bool, ..., so many properties won't work and would need some workaround to implement. It would make everything much more complex with big room for bugs and mistakes...

@optio50
Copy link
Author

optio50 commented Nov 24, 2022

Thanks for explaining.
I was just wondering, not wanting you to change anything. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants