开发者

slightly customized widget for PyQt4 with qtdesigner

开发者 https://www.devze.com 2023-03-13 04:59 出处:网络
I am creating an application with PyQt4 and I want to use qtDesigner to design the layout. The application contains a QGraphicView, for which I want to implement panning and zomming per mouse. The onl

I am creating an application with PyQt4 and I want to use qtDesigner to design the layout. The application contains a QGraphicView, for which I want to implement panning and zomming per mouse. The only way I know how to do that is deriving from QGraphicView overwriting the "mouse*" functions to do the panning and zooming.

Now I want to use this new custom widget with qtdesigner.

googling I find that 开发者_运维技巧I could write a "custom widget plugin" for qtdesigner. While it does not seem to be to difficult, I still find it overkill for such a little adjustment I want to make.

What other ways are there to customize a widget in PyQt4 when the layout is done with qdesigner?

Thanks!


You can promote your QGraphicsView to your own subclass In the designer, right click on the QGraphicsView and select "Promote To" and fill the dialog with relevant information about your own subclass:

slightly customized widget for PyQt4 with qtdesigner

0

精彩评论

暂无评论...
验证码 换一张
取 消