Giter Site home page Giter Site logo

QCefView上覆盖真窗口 about qcefview HOT 7 CLOSED

tishion avatar tishion commented on July 17, 2024
QCefView上覆盖真窗口

from qcefview.

Comments (7)

tishion avatar tishion commented on July 17, 2024

Hi @sunpeishuai 不好意思很晚才看到这个issue。
这个问题不属于QCefView这个控件的issue,属于你的程序设计问题,我不推荐在CEF的显示区域上面放置控件或者窗口,如果可以请直接使用web实现你需要的功能,应为QCefView具备C++代码和JavaScript交互的能力。
祝好运 : )

如果没有更多问题,请顺手close掉这个issue。多谢。

from qcefview.

looksoo avatar looksoo commented on July 17, 2024

我也碰到相同的问题, 我想做一个 网页内容的搜索功能, 类似于这样,
image
有没有可行的办法解决遮挡的问题?

from qcefview.

tishion avatar tishion commented on July 17, 2024

@looksoo 这个功能是可以实现的,我所说的“不推荐在CEF显示区域上面放置控件或者窗口”意思是说不要给CEF添加子窗口或者控件。而你可以在实现的搜索浮动控件的时候让他属于外层窗口的子窗口,而不是CEF控件的子窗口,这样的话你可以把搜索窗口放置在任意位置。

from qcefview.

looksoo avatar looksoo commented on July 17, 2024

@tishion 感谢回复, 在外层窗口中添加子窗口, 界面会被Web页面遮挡, 使用QStackLayout并设置为 stackAll, 也同样不能解决遮挡的问题;

from qcefview.

tishion avatar tishion commented on July 17, 2024

@looksoo 如果你所说的子窗口是指QT中的child的话,确实是无法实现的,因为QT是direct UI,所以他所有的child widget的绘制都是其顶层窗口负责,所以我们说QT的子窗口其实只是从绘制层面划分出来的。而CEF本身的窗口是windows的真窗口,是浮在其父窗口(QT窗口之上的),所以你可以把搜索窗口转换成native 窗口,具体做法只要调用一下他的winId() 即可转换成native窗口。

对于Qt和Native窗口的混合编程问题:
1.加深对QT的绘制体系和windows窗口的绘制体系的理解,
2.多使用 Spy++观察一下窗口层次关系
基本就能解决所有问题了。

from qcefview.

looksoo avatar looksoo commented on July 17, 2024

@tishion 非常感谢!

from qcefview.

AdonLuo avatar AdonLuo commented on July 17, 2024

@looksoo 你好,你问题有解决吗?我也遇到类似需求,有一个窗体需要浮在Qcefview上层,和QCefVie同父窗体,显示位置通过主窗或者父窗口进行设置坐标大小,希望得到的效果是跟随主窗口一起显示隐藏,移动,缩放,目前做法是子窗设置setWindowFlags(windowFlags() | Qt::Tool | Qt::FramelessWindowHint);但是这样就相当于脱离主窗体,他的上层是电脑桌面了,移动缩放关闭等都不受控制,不知有没有比较好的解决方法

from qcefview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.