How to install a plugin for QtWebKit - c++

I am running a Qt 4.5 commercial snapshot and want to use a plugin that I downloaded (it's a .so file) in my QWebView. Is there a specific location where I need to place this file? Can I grab it using the QWebPluginFactory?

I am assuming the plugin here is the NPAPI plugin (e.g. Flash). Under X11, QtWebKit search several common directories for the plugin. For the complete list, see the documentation on Netscape plugin support.
In addition to that, you must enable plugin support via QWebSettings::. See the documentation for WebAttribute::::PluginsEnabled, either globally or for your particular QWebView only.

If you're a commercial client you should be demanding your money earned support directly from the trolltech(nokia) guys.

Have you tried putting in the standard library directories? It should be picked up by the linker if it's in one of those directories.
For example:
/lib/
/usr/lib/
/usr/share/lib/
/usr/local/lib/

Have you tried looking around in /usr/lib/qt4/plugins/ or somewhere similar yet? I suppose that path will probably be where you have your 4.5 snapshot stuff compiled, but it should have options for putting in plugins for various things.

Related

Install Qt without admin rights

I'd like to download Qt. I tried to download it from Qt's website but this gives me an exe file and since I've got a limited account when I try to run it it asks for an admin password. I've searched the web for a way for a limited account to install Qt but I haven't found anything. Could someone please help me find a solution?
In case it matters, I'm using Code::Blocks and Windows 7.
You could download the free software source code and compile and build it on your machine (that takes about a whole night, or maybe more). Don't forget to configure the build appropriately (I don't know Windows, but on Linux I'll suggest explicitly setting the -prefix to some writable directory ...). Before starting, ask explicitly your boss for permission (if you violate your company policies, you can be fired at once), and ask for guidance from someone knowing your operating system better than you do. You might need to change your PATH too.
Alternatively, ask permission to install and use a Linux distribution.
PS. Be sure to get permission to do something (even if technically you can do it alone).
You can download this ZIP file with Qt. All you have to do is unzip the ZIP file (which will take time) and place the files it contains in the right folder, nothing that requires administrator privileges. I recommend you put the contents of the ZIP file in C:\Qt, otherwise it might not work correctly (if this folder doesn't already exist, you can create it without administrator privileges and if it does exist, Qt is probably already installed on your computer in which case you don't need to do anything). I've also posted Qt's license agreement as it is in the installer program here since Qt wants you to read it before you use Qt.
Furthermore, I recommend using Qt Creator to make your Qt projects instead of Code::Blocks, because it's difficult to get Qt5 to work with Code::Blocks and Qt5 is the version of Qt used on both this website and Qt's installer (see this question) (if you find a way to get Qt5 to work with Code::Blocks, all the better, maybe you could even answer the question for which I posted a link). Qt Creator is included in the ZIP files on my website and to use Qt with Qt creator, all you have to do is include the right header files, no linking is needed. The path of Qt Creator is in the table on the bottom of the website.
You can download an archived distribution of MSYS2. After you extract and run it, you can use its packet manager to download numerous packages, including Qt. The only downside is you will have to settle for the version it provides, which is a little old, currently 5.5.1. You can install by typing:
pacman -S mingw-w64-i686-qt5 // for 32bit build or
pacman -S mingw-w64-x86_64-qt5 // for 64bit
This will install Qt and all dependencies automatically. Make sure your antivirus is not running in the final stage, because it can mess with the binary patcher that patches Qt to run from its current installation folder (because advanced software like Qt apparently cannot work without hard-coded paths).
You can even get a static build of Qt, which is quite useful, just add a -static to the package name.
Just in case you were wondering - MSYS2 is a build environment, it can come quite in handy, for getting ready to use libraries, or for building libraries which require a build environment. You can build Qt without it, however, it is a very slow process that may fail, and even though it is not complex to do, I would not recommend it as a first option.
If you still decide to build it from source, there is a detailed guide which will get you through the process.

Do Applications written with MFC classes require external Frameworks to be installed

If I write an application using MFC libraries in C++, in deployment stage do I require to install some sort of frameworks or stuff like that?
My intent is to have a standalone exe without complicated installation scripts.
If you're developping a local application for your own organisation, you could go for static linking, as suggested by Danny.
But static linking is not the method recommended by Microsoft: every time there's an MFC related patch (example here) or z patch for another library, you'll have to recompile your code and redistribute or reinstall it in order to avoid PC's being exposed to security vulnerabilities.
This is why Microsoft recommends to use dynamic libraries: these are easier to update/replace (eventually latest versions are already installed; or automatic windows update; or if necessary manual download of the latest version).
If you go for dynamic approach:
there are a couple of mfc*.dll to distribute with your application, together with other standard libraries, such as Msvcr100.dll. It's all explained in the article. Installing such files in your app's directory has the advantage of a leaner installation process. But you have to take responsibility for their update in case of necessity.
or you choose to use Microsoft's redistribuable packages. These can be downloded directly from Microsoft's and are contained in a selff-installable file: vc_redist*.exe. Here some explanations on how to use them in installation process. It might install more dlls than required, but vc_redist is an installed Microsoft product that is kept up-to-date with Windows Update.
If you link MFC statically, there is no need for external files.
Project Settings / General:
Use of MFC: Use MFC in a Static Library
But, as Christophe mentions, it is not recommended by Microsoft.

Macdeployqt is not working

I've installed the latest version of Qt (5.1) and when I try to deploy my app on Mac using the macdeployqt tool, the app is still not working on other macs. It's completely working on my Mac and it doesn't not indicate any errors. After researches I found this and I think it's my problem : Qt 5.1 and Mac: Bug making macdeployqt not working properly and https://bugreports.qt-project.org/browse/QTBUG-14699
But the explanation is too technical for me (+ english not my native language), I'm a complete beginner, can you explain what do I have to do to simply make my app work on Mac ? Step by step ? It is perfectly functional on Windows (with the standard dlls).
Thank you so much, I think it will help a lot of beginners that are going through the same issue.
There are 3 tools at your disposal to sort out deployment of Qt for OS X (MacOS).
macdeployqt: This tool gathers all the Qt libraries that your application declares it needs in its project, adds them to the app bundle and updates their paths so that your application knows where to find them.
otool: A complex tool for examining the contents of binaries, but in this case, used with the -L argument, will display the paths to all the libraries that your application will reference. These are the paths that it will be looking to find those libraries.
install_name_tool: Since macdeployqt only handles Qt libraries that are required by your application, you can use install_name_tool to update paths to any other libraries that your app requires. For example, if you have a separate non-Qt framework that your application relies upon, you need to have a post compilation step to copy the framework into the application bundle and then use install_name_tool to update the paths to the framework.
If you're having problems, check that the libraries / frameworks have been copied to the correct location in the application bundle and then use otool -L to check the paths. If any are incorrect, use name_install tool to fix them.
If you still can't get it to work, please edit your question and add the output from using otool -L.
Note, historically, various versions of Qt have suffered bugs with the macdeployqt utility, so if it is not working properly, you may also want to check the qt bug tracker.

Cross-platform C++ Directory Managing

Are there any cross platform libraries that will help me place certain file in different directories. For example in windows a config file will probably go in app data, yet in Linux it will go in /etc/ or /use/etc/ depending on where it was installed. Is there any way to do this transparently?
boost::filesystem will should soon provide such functionalities (but not yet). I would be you, I'd use boost::filesystem and provide different addresses of user folders by platforms, then when boost::filesystem provide the feature, replace the implementations.
Did you try with Qt libraries?
Both QFileInfo( qApp->argv()[0] )::absFilePath ()
and QApplication::applicationDirPath() can work.

cross compiling c++ to iphone arm

I've scanned over the (outdated) article that is the first hit on google about ARM cross-compiling. I've also seen the article about compiling OpenCV to the iPhone and the general cross compiling instructions there. My question is can I call the apparently already configured gcc/g++ in the iPhone developer package (which I already have installed) like in the latter article? A lot of the OpenCV stuff seems superfluous to my needs.
If I can, what would the calls look like? Should I create a Makefile to make things easier?
Also, I need -lncurses library. Can I call them like normal, or do I need to specify it's path because I'm not calling the default gcc/g++?
If you're using the official SDK, compiling C++ for the iPhone is as simple as including cpp files in your project and hitting "build". Of course you can still go in and tweak the compiler switches - well, most of them.
As for ncurses, I'm not sure why you'd want to use that - but the only limitation you should have is that you can't link against dynamic libraries - so you'd have to linked the object code in.
A script that you can use as a basis for crosscompiling your libraries for iOs development.
Unfortunately the [n]curses package is not going to do you any good for the iPhone.
[n]curses is designed to be used with a terminal window. This is just not available for the iPhone you will need to learn how to use Coco to develop a GUI interface.