开发者

qt4: overriding event-handler methods of widgets created by UI editor

I would like to know if it is possible to override methods like paintEvent or mousePressEvent, for example, for widgets that were开发者_运维知识库n't created programmatically but in UI editor.


There is no difference between widget created programmaticaly and created with UI editor. If you want to add your custom widget derived from base widget in editor, do the following:

  1. Add base widget in editor.
  2. Select it, rightclick and in menu look for "promote to..." item.
  3. Add your derived widget to list of promotions, and you will have your custom widget on form instead of base.
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜