[讨论]关于Qt下图形与图像的叠加显示方案
-
!http://doc.qt.digia.com/qq/qq26-openglwidgets2.png(叠加后的效果)!
刚刚在QQ26上找到"一篇文章":http://doc.qt.digia.com/qq/qq26-openglcanvas.html,这是我所希望的实现效果,但我希望透明叠加能做到对每个QWidget对象透明,最好能够只在QWidget树的根节点进行处理,感觉既然存在native Widget,应当能够做到在顶层窗口改变所有子Widget的绘制目标吧?
-
Why not use Qt Quick Controls Qt 5.1 ?
-
[quote author="Vincent007" date="1374589050"]Why not use Qt Quick Controls Qt 5.1 ?[/quote]
为什么要用Qt Quick Controls, Qt Quick能实现的,Qt C++不应该也能实现吗?我主要担心性能问题。
-
你现在研究的是我们将要研究的。
一般来说,通过Demo中的Boxes例子可以基本上满足你所需要的条件,这些对话框都是直接嵌套在窗口中的,而且可以在这个QGraphicsView中对中心立方体进行旋转操作。交互都不是问题。
第二种方案能够实现,Boxes例子就是第二种方法实现的,只是不是像你这么实现的,详情还是看看它的源代码,这样你可以再试一试第二种方法。
另外,LZ研究过嵌入式中使用Qt OpenGL和Native控件混合的情况吗?嵌入式中对于OpenGL的支持如何?
-
你担心性能问题, 就應該比較那個實現方法性能較佳. Qt Quick Controls 理應性能較佳, 因為 Qt Quick Controls 應是用 scene graph rendering 的。你提到的方法沒有一個用到scene graph rendering.
-
[quote author="Vincent007" date="1374758589"]你担心性能问题, 就應該比較那個實現方法性能較佳. Qt Quick Controls 理應性能較佳, 因為 Qt Quick Controls 應是用 scene graph rendering 的。你提到的方法沒有一個用到scene graph rendering.[/quote]
呵呵,明白,那我用QGraphicsView是不是也能达到同样的性能?
-
已经使用QGraphicsView进行了尝试,性能还不错,不过目前是用QGraphicsProxyWidget来进行动态图像绘制,换成setViewport( new GLWidget )性能没有改善,反而略有下降。
我看boxes里是用QGraphicsScene::drawBackground来进行OpenGL绘制,过几天准备用这个方法来试试对性能改善有没有帮助。[quote author="jiangcaiyang" date="1374727331"]你现在研究的是我们将要研究的。
一般来说,通过Demo中的Boxes例子可以基本上满足你所需要的条件,这些对话框都是直接嵌套在窗口中的,而且可以在这个QGraphicsView中对中心立方体进行旋转操作。交互都不是问题。
第二种方案能够实现,Boxes例子就是第二种方法实现的,只是不是像你这么实现的,详情还是看看它的源代码,这样你可以再试一试第二种方法。
另外,LZ研究过嵌入式中使用Qt OpenGL和Native控件混合的情况吗?嵌入式中对于OpenGL的支持如何?
[/quote] -
[quote author="chaosgrass" date="1375062154"]
[quote author="Vincent007" date="1374758589"]你担心性能问题, 就應該比較那個實現方法性能較佳. Qt Quick Controls 理應性能較佳, 因為 Qt Quick Controls 應是用 scene graph rendering 的。你提到的方法沒有一個用到scene graph rendering.[/quote]呵呵,明白,那我用QGraphicsView是不是也能达到同样的性能?[/quote]
QGraphicsView 的 rendering 沒有利用 scene graph, 因此 QGraphicsView的性能 應該比Qt Quick Controls 差.
-
[quote author="Vincent007" date="1375105268"]
[quote author="chaosgrass" date="1375062154"]
[quote author="Vincent007" date="1374758589"]你担心性能问题, 就應該比較那個實現方法性能較佳. Qt Quick Controls 理應性能較佳, 因為 Qt Quick Controls 應是用 scene graph rendering 的。你提到的方法沒有一個用到scene graph rendering.[/quote]呵呵,明白,那我用QGraphicsView是不是也能达到同样的性能?[/quote]
QGraphicsView 的 rendering 沒有利用 scene graph, 因此 QGraphicsView的性能 應該比Qt Quick Controls 差.
[/quote]
我使用QGraphicsView+QGraphicsScene,并且在QGraphicsScene::drawBackground中进行OpenGL绘制,rendering效率会比Qt Quick Controls差吗? -
我說了重點是 scene graph. Qt Quick Controls 用 scene graph rendering, QGraphicsScene 不是用 scene graph rendering, 所以 QGraphicsScene rendering效率理應 比Qt Quick Controls差.
"http://stackoverflow.com/questions/16267404/qt-quick-vs-graphics-view-framework-qgraphicsscene":http://stackoverflow.com/questions/16267404/qt-quick-vs-graphics-view-framework-qgraphicsscene
"In Qt4, I don't think QML is going to give any peformance advantage, as I think (did not verify now) there it is written on top QGraphicsView stuff."
"numbers from running the photoviewer demo":http://blog.qt.digia.com/wp-content/uploads/2011/05/numbers.png