Deploying Qt QML-based application on OSX (with WebKit) - webkit

We wrote an application that makes heavy use of QML, and now that it's time to try to deploy it I'm running into really irritating issues because of the reliance on QtWebKit
I compile the application and everything works fine on my computer. Then I run the macdeployqt script on the .app, and for whatever reason the WebView QML component is saying: "Module QtWebKit is not installed"
What is the proper way to deploy a QML-based application on OSX that relies on QtWebKit/WebView?

macdeployqt doesn't handle the QML import plugins yet:
http://bugreports.qt-project.org/browse/QTBUG-14342
You can do it manually (e.g. for QMLViewer):
1) Copy the plugins you're interested in from the $QTDIR/imports directory into $QTDIR/bin/QMLViewer.app/Contents/MacOS, so that there's e.g.
QMLViewer.app/Contents/MacOS/QtWebKit/qmldir
2) Fix the references of the import plugin to the Qt frameworks using install_name_tool:
install_name_tool -change /path/to/qt/*lib/QtCore.framework/Versions/4/QtCore #executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore QMLViewer.app/Contents/MacOS/QtWebKit/libqmlwebkitplugin.dylib
Do the same for the other Qt libraries that the plugin depends on (at least QtGui).
More info on fixing references can be found in http://doc.trolltech.com/4.7/deployment-mac.html

MartinJ's answer gave me a hard time.
For those who use Qt Quick 2 - use QtWebkit from folder $QTDIR/qml instead, or you're going to have a lot of messages that plugin qtwebkit does not implement qqmltypesextensioninterface.

Related

Do I need to download javafx12?

I have been having trouble utilizing Javafx within Intellij. I run into the error "JavaFX runtime components are missing, and are required to run this application" that I see a lot of other people have.
My main question is do I need to download Javafx12 sdk. I am able to use Dr.Java to run some of my old javafx projects just fine after adding an extra class path and I haven't needed to downloaded anything. It doesn't seem like I need to download anything as another much more basic IDE is able to run javafx. So why does it seem like intellij requires an extra download?
If you moved to Java 12, then yes, you need to download the JavaFX 12 from their new website https://openjfx.io. Luckily installing it is pretty straightforward and well-explained.
It worked before because JavaFX was shipped inside the JDK distribution, which is no longer the case. Swing however is still there and will work as before. (I am not saying you go back to Swing, just that it is still shipped along the JDK)

Mule - Updating third party library in runtime

I'm using Mule Server 3.8 EE which brings commons-lang 2.4 with it. A third-party library in my project needs commons-lang 2.6, because it uses a method that was introduced in this version.
So when I just start my application, I get a java.lang.NoSuchMethodError
Is there a way to update the dependency in the runtime? What I tried so far:
including commons-lang 2.6 in my app -> no effect, the one from the runtime is picked up first
replacing the jar directly in the runtime -> errors in studio, that the 2.4 jar is missing
so maybe i am late BUT -- this is your answer. Add the libraries that are newer in the jar distribution to the Build Path. Under Java Build Path screen you should see the libraries listed. I needed to use Apache http-client 4.5.6 and that's very interesting because it brings with it a lot of other dependencies, so your question was VERY relevant. The solution is to rely on JAVA (and not mule -- oops Anypoint or whatever) conventions and make sure the JVM loads my class files first. Then, it won't load the old ones from mule's jar. And so I went to the tab Order and Export, and moved Mule to the bottom. This simple, trivial change makes it work. I think if we would work with command line and vim, we would all know this. But all the IDE gui and everything else makes us forget the simplest things. Please use it in good health. :)

Cinnamon and QxtGlobalShortcut

I have a Qt5 Application, in which I have defined a QxtGlobalShortcut object. This program works as expected in KDE4 or Plasma5. However, when I run this application in Cinnamon, the global keybindings do not work.
Another application written in Qt4 which contains QxtGlobalShortcut object works properly in both KDE/Plasma and Cinnamon.
Any ideas as to what the problem could be?
I'm using debian testing.
Qt4 Version: 4.8.7
Qt5 Version: 5.6.1
QxtGlobalShortcut class is compiled from source. The same source is being used in both Qt4 and Qt5.
I had same issues. Sometimes global shortcut events are not caught if the application has no windows. Workaround is to create invisible dummy window.
Since Qxt in no longer maintained, I've created repository with some additional fixes (pull requests are welcome). This can be built as separate library.

How to make JOGL OSGI bundles with native libraries loaded correctly?

I've been trying for days: http://forum.jogamp.org/JOGL-with-OSGi-td3773888.html#a4029139
This library has native dependencies embedded in jars.
http://search.maven.org/#artifactdetails|org.jogamp.jogl|jogl-all|2.0-rc11|jar
http://search.maven.org/#artifactdetails|org.jogamp.gluegen|gluegen-rt|2.0-rc11|jar
Can you provide detailed instructions to make osgified versions of this?
It would be nice if you can use bnd http://www.aqute.biz/Bnd/Bnd or bndtools http://bndtools.org/ in the process.
I've tried to make a gigantic bundle with everything embedded, but I cannot make karaf to find native libraries: I keep getting the error "no gluegen-rt in java.library.path"
I tried to make a fragment bundle but cannot make the pieces to match... Tried with bnd, tried with eclipse. Need help from more experienced people.
I have been trying to use that with Apache Karaf, so it would be excellent if you can make that work with Karaf 2.3.1
If you know how to do it with Eclipse RCP 4.2 then please help!
First of all this isn't a Karaf specific issue, you might want to start with a unit test first, using pax exam. For your issue you need to make sure the native libs don't have dependencies to each other.
You might be interested in the following links.
http://robertvarttinen.blogspot.de/2008/12/bundle-nativecode-in-osgi-manifest.html
http://holistictendencies.wordpress.com/2011/03/28/bundle-nativecode-using-platform-specific-dlls-from-osgi/
Load DLL (using JNA) inside an OSGi bundle

PlayFramework2 required Jar files and recognising compiled sources

Finding hard to know why am I unable to get this thing :
... I can run my application from command prompt, But when I do idea and Import the existing project using IntelliJ unable to trace out what Libraries or Jar files I need to get going.
In one Play1.2.3 I used to just Import Play and Play1.2.3 jar files and everything works..
Update
Have tried Creating a new project and Open Project(Instead of Import) from IntelliJ,But no luck.It has attached all the Libraries but still the error doesnt go screenshot attached:
IDE :IntelliJ 11.0.2 &
Play : 2.0.2
Since Play 2.0.2 you don't need to create Idea's project from the scratch and import modules into it.
Just choose Open project from the menu, and find the folder where you performed play idea action, whole project will be ready to use in the IDE without any additional steps.
Edit:
Most important: to reflect changes in managed sources your application need to compile it first, so it needs to work in the background while developing or you need to compile it manually if app is stopped. Otherwise Idea will not be able to compile (and find) managed sources. That's exactly job of the Play's DEV mode which differs from others Java frameworks, which requires to compile app manually and/or configuring your IDE to do that from time to time. Play's dev mode allows to do it in background.
Idea will start recognizing your managed sources after first run the app in the browser (as it will compile it, and idea will catch it just few seconds later). Of course the app must be running in dev mode, to compile views, assets etc.
play run
Of course if you're in production mode, you also need to restart the app.
alternatively after idealizing the project, or if your app is not working you can manually compile managed sources with:
play compile
Also if you'll start in tilde-dev mode, it will be compiling changed resources right after the changes' saving
play ~run