Page 2 of 3

Re: Using CEF in a QT application

PostPosted: Tue Nov 27, 2012 5:49 pm
by Mayhew
Okay, I'm inching my way forward and am trying to figure things out from your last post but I have a few more questions.
1) I have libcef_dll_wrapper building as a static archive library but am not sure what to do with it. Is it just statically linked to the target app and libcef_dll_wrapper.a?
2) I assume I need to create a new app for the cefclient_helpers. The cefclient_helper source files are almost identical to the cefclient apps. What is needed in the client_helper app and how is it different than the cefclient?

Thanks for the help. Once I get this going I will provide a writeup on how to get CEF integrated for a new Cocoa or Qt app. That would be good to add to the Wiki. Thanks,
John

Re: Using CEF in a QT application

PostPosted: Tue Nov 27, 2012 5:53 pm
by magreenblatt
Mayhew wrote:1) I have libcef_dll_wrapper building as a static archive library but am not sure what to do with it. Is it just statically linked to the target app and libcef_dll_wrapper.a?

Your executables need to statically link against libcef_dll_wrapper. It provides the C++ wrapper around the C API exposed by the libcef dynamic library.

Mayhew wrote:2) I assume I need to create a new app for the cefclient_helpers. The cefclient_helper source files are almost identical to the cefclient apps. What is needed in the client_helper app and how is it different than the cefclient?

The scripts referenced from the previous post have inline comments explaining this.

Re: Using CEF in a QT application

PostPosted: Wed Nov 28, 2012 3:04 pm
by Mayhew
Okay thanks again for the help. I see the comments about how the various helpers are created by that script.

Are the following assumptions correct?
*For my new mac projcect I need to add a new target consisting of a Cocoa application (with no UI) for my helper.
*This helper, at its most basic, would simply contain a subclass for CefClient and CefApp and have a main() entry point.
*I don't currently need to override or modify the browser or renderer processes sp my CefApp subclass can leave out the delegates. For my basic app on Windows my CefApp subclass is basically empty and it seems to be working perfectly so I assume this would be the same for mac/linux.
*In the main function of this helper app I simply call CefExecuteProcess the same way as the main method in process_helper_mac.cpp.
*This helper links against the libcef_dll_wrapper.a that I create as part of my overall project as well as libcef.dylib
*I need to mimic the various post build script calls that are used in the cefclient xcode project for the helper target

If that is all correct then I can simply mimic the various parts and build phases of the main CefClient itself in my main app.

Re: Using CEF in a QT application

PostPosted: Wed Nov 28, 2012 3:13 pm
by magreenblatt
Mayhew wrote:Okay thanks again for the help. I see the comments about how the various helpers are created by that script.

Are the following assumptions correct?
*For my new mac projcect I need to add a new target consisting of a Cocoa application (with no UI) for my helper.
*This helper, at its most basic, would simply contain a subclass for CefClient and CefApp and have a main() entry point.
*I don't currently need to override or modify the browser or renderer processes sp my CefApp subclass can leave out the delegates. For my basic app on Windows my CefApp subclass is basically empty and it seems to be working perfectly so I assume this would be the same for mac/linux.
*In the main function of this helper app I simply call CefExecuteProcess the same way as the main method in process_helper_mac.cpp.
*This helper links against the libcef_dll_wrapper.a that I create as part of my overall project as well as libcef.dylib
*I need to mimic the various post build script calls that are used in the cefclient xcode project for the helper target

If that is all correct then I can simply mimic the various parts and build phases of the main CefClient itself in my main app.

On Windows and Linux there is no requirement to have a separate helper app. All correct otherwise.

Re: Using CEF in a QT application

PostPosted: Mon Dec 03, 2012 3:56 pm
by Mayhew
Okay, I'm getting closer. I have the bundle built and am mimicking all various xcode post processing steps via a shell script. Currently I can launch my Qt app and the CEF browser window appears but I'm seeing the helper apps icons in the system tray. My helper app has its own bundle and info.plist. Am I missing something to keep them from showing in the tray?

Re: Using CEF in a QT application

PostPosted: Mon Dec 03, 2012 5:34 pm
by Mayhew
Okay, got it. I needed the "Application is Agent" entry in the plist.

Re: Using CEF in a QT application

PostPosted: Tue Dec 11, 2012 2:09 pm
by Mayhew
After several weeks I'm admitting defeat on the effort to get a Qt app working with CEF. I thought I was pretty close but am blocked getting it to run outside the debugger. For some unknown reason, when launching outside the debugger the helper processes crash and the browser window never shows up. Running in the debugger seems to work fine. The logs do not seem to provide any useful info either. Short of any new ideas I think the Qt solution is just not feasible.

Re: Using CEF in a QT application

PostPosted: Fri Aug 09, 2013 4:14 pm
by robs
Just came across this post:

After several weeks I'm admitting defeat on the effort to get a Qt app working with CEF. I thought I was pretty close but am blocked getting it to run outside the debugger. For some unknown reason, when launching outside the debugger the helper processes crash and the browser window never shows up. Running in the debugger seems to work fine. The logs do not seem to provide any useful info either. Short of any new ideas I think the Qt solution is just not feasible.


I just hit a similar problem where the helper was crashing on launch when outside the debugger. I found the problem was that I was building the helper app without the -pie flag being passed to the linker. This is set by adding "-Wl,-pie" to xcode's other linker flags setting.

Hope that helps someone, although maybe a bit late for the original poster. :)

Rob

Re: Using CEF in a QT application

PostPosted: Fri Sep 13, 2013 12:11 pm
by orng
robs wrote:Just came across this post:

After several weeks I'm admitting defeat on the effort to get a Qt app working with CEF. I thought I was pretty close but am blocked getting it to run outside the debugger. For some unknown reason, when launching outside the debugger the helper processes crash and the browser window never shows up. Running in the debugger seems to work fine. The logs do not seem to provide any useful info either. Short of any new ideas I think the Qt solution is just not feasible.


I just hit a similar problem where the helper was crashing on launch when outside the debugger. I found the problem was that I was building the helper app without the -pie flag being passed to the linker. This is set by adding "-Wl,-pie" to xcode's other linker flags setting.

Hope that helps someone, although maybe a bit late for the original poster. :)

Rob


I just signed up to this forum just to say this:

THANK YOU VERY VERY MUCH!

I've been wrestling all day with trying to figure out why my EH helper process kept crashing and this seems to have fixed it.

Again; Thank You <3

Re: Using CEF in a QT application

PostPosted: Fri Sep 27, 2013 10:57 am
by Derek
Hello,

Do you have any code or guidelines for running CEF3 with Qt (Windows)?

Thanks,

Derek