使用 Python 为 Qt Designer 自定义 Qt 小部件 [英] Custom Qt Widgets with python for Qt Designer

查看:76
本文介绍了使用 Python 为 Qt Designer 自定义 Qt 小部件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试仅使用 Python 为 Qt 设计器编写自定义小部件.我正在学习我在网上找到的几个教程,但没有一个是有效的,或者任何接近我称之为最小工作示例的教程.

I am trying to write a custom widget for the Qt Designer using only Python. I was following a couple of tutorials I found online but none of them were working or anything close to what I would call to be a minimum working example.

所以我的问题是:

  1. 在 Qt Designer 的 Widget Box 中显示自定义小部件需要哪些步骤?
  2. 如果你能抽出时间:请提供一个最小的工作示例(例如一个带有标签的小部件,上面写着一个真正最小的工作 Qt 自定义小部件示例").
  3. 或者可能根本不可能包含仅使用 Python 的自定义小部件?

推荐答案

我发现这篇文章就是你的答案:https://doc.qt.io/archives/qq/qq26-pyqtdesigner.html

I found this article to be your answer: https://doc.qt.io/archives/qq/qq26-pyqtdesigner.html

但是,我一直无法在 Qt Designer 中安装它 :D

But, I haven't been able to install it in Qt Designer though :D

这篇关于使用 Python 为 Qt Designer 自定义 Qt 小部件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆