Qt:透明QRubberBand?

发布于 2024-07-27 18:15:32 字数 195 浏览 1 评论 0原文

我正在尝试在 QGLWidget 上绘制 QRubberBand。 由于某种原因,橡皮筋的区域被绘制为不透明,我看不到它后面的内容。 这有点违背了橡皮筋作为选择其内部内容的方式的目的。
我在 QStyleOptionRubberBand 的文档中看到有一个“不透明”成员,但我不知道如何以默认样式访问它或如何更改它。

有人做过这个吗?

I'm trying to draw a QRubberBand on a QGLWidget. For some reason the area of the rubber band is drawn as opaque and I don't see what's behind it. This kinda beats the purpose of the rubber band as a way to select stuff inside it.
I've seen in docs for QStyleOptionRubberBand that there's an 'opaque' member but I have no idea how to access this in the default style or how to change it.

Anybody ever done this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

雄赳赳气昂昂 2024-08-03 18:15:32

如果有源代码就太好了?
但我将尝试解决此问题的方法如下:

  1. 子类 QRubberBand
  2. 重新定义 PaintEvent 方法
  3. 调用 iniStyleOption 来激活您选择的样式选项

希望它有帮助!

It would be great having any source code ?
But here are how I would attempt to fix the problem :

  1. Subclass QRubberBand
  2. Redefine PaintEvent method
  3. call iniStyleOption to activate style options of your choice

Hope it helps !

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文