Installing Qt Components for Windows - c++

I am able to compile the source of qt-components just fine using the following steps:
Downloaded the tar.gz from http://qt.gitorious.org/qt-components/desktop/trees/master
Unpacked the components
Added path variable value to the environment variables for mingw and qmake
Ran the following command: qmake && make install
I can see that the above command exits successfully and copies the qml files and a few other folders to C:\Qt_2.8.0\Qt4.8.4\imports\QtDesktop
I then open up qtcreator and inside of my qml file, I type import QtDesktop 0.1, but it returns an error of module "QtDesktop" is not installed. If I hover over the QtDesktop import statement, it reads Library at C:\Qt_2.8.0\Qt4.8.4\imports\QtDesktop - Dumped plugins succesfully.
...so what I am doing wrong here?
Please note that I am constricted in using Qt4

Related

Single executable file created by py2exe not working

I've created a Python app using Pyqt4 to open up a dialog and do some image processing using opencv2. The app is working fine when executing the script as:
python script.py
To create a single executable file for the script, I'm using py2exe with bundle_files = 1 option. It is creating a single exe file but when clicking the file, a console appears stays for few seconds and a pop-up appears saying program has stopped responding.
I'm working on Windows with anaconda. Please help me with this.
Py2exe generates a logfile.txt in the same folder you first-time execute the generated .exe.
Check this logfile to debug.
Most of the time you need to exclude some dll`s and include at least sip-module;
In your setup.py file:
from distutils.core import setup
import shutil, py2exe
opts = {'py2exe': {'compressed': True, "dll_excludes": ["MSVCP90.dll"], "includes" : ["sip"]}}
setup(console=[{"script" : "main.py"}], options=opts)
shutil.rmtree('build', ignore_errors=True) #Remove the build folder
Personally I did not encounter the need to include PyQt4 modules for compilation..
And btw be glad that python is an interpreted language, otherwise you`ll have to worry about linking to libraries on every build (like in cpp.., which is annoying)
Greets Dr Cobra

Why TestExplorer in VS2015 failed to load Pester module?

I installed the Powershell Tools for Visual Studio 2015 then I created a tests.ps1 files inside my Powershell project in VS2015. the test explorer recognizes the declared test, but when I try to run the test I get this: "Result Message: Failed to load Pester module. The specified module 'Pester' was not loaded because no valid module file was found in any module directory."
I discover that I did not have the Pester in my Pc, I download it from GitHub, then I add the folder to the $env:PSModulePath. Powershell identifies the module, but was not able to import it, so I move the folder from its original location to:
c:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\
Now any console of powershell is able to import the module: ISE, Powershell console, Powershell interactive window in VS2015.
Then I try to run the test again, I keep getting the same message.
As I stated in my question: I added the folder with the Pester to the environment variable called PSModulePath, but I added to the end of it.
For some reason the adaptor looks for the path of module only under the first folder in that environment variable.
I changed the order and moved the path to the beginning of the string. Voila!! it works.

Setting up ROS package in CLion

I am using CLion (C++ IDE) for editing a ROS package. I was able to open a package by opening the CMakeLists.txt file. But, I get an error,
"FATAL_ERROR "find_package(catkin) failed. catkin was neither found in the workspace nor in the CMAKE_PREFIX_PATH. One reason may be that
no ROS setup.sh was sourced before"
How do I solve this problem? Will I be able to make the project in CLion (If so, how do I) after I make changes to the code or do I have to catkin_make in a separate terminal?
Try this (for Linux):
Open a command line
Run catkin_make on your package.
source your catkin_workspace/devel/setup.bash file e.g. source ~/my_dev_folder/catkin_ws/devel/setup.bash
Start CLion from [CLion install dir]/bin/clion.sh e.g. cd ~/Downloads/clion-1.2.4/bin && ./clion.sh
CLion should then start with knowledge about the packages in your catkin workspace, through the local environment variables set up by the setup.bash file.
To add on to what WillC suggested, you can also modify the desktop entry to start the application from bash instead of manually doing so.
To do this, edit the desktop file located at
~/.local/share/applications/jetbrains-clion.desktop
by modifying the line containing Exec= to
Exec=bash -i -c "/INSTALL_LOCATION/clion-2016.3.2/bin/clion.sh" %f
To add on to what WillC suggested,CLion reload the last cmake compiling result by default.
However, if you failed to find catkin.cmake during the last attempt even though you source the devel/setup.bash and open CLion, you also cannot find catkin.cmake.
You should click File --> Reload Cmake Project and you should get the right result.

Trouble getting a Qt Reference Document program to work(Minehunt)... its just blank when run... no errors though?

http://docs.huihoo.com/qt/4.7/demos-declarative-minehunt.html
When I build and run... I just get a blank white rectangle... game is MineHunt.
The source code is in the URL. I created files and copied and pasted into Qt Creator 4.7.
Running in Linux.
No need to downvote. Deploying qml apps does not seem to be easy for beginners. jdl, I don't know if I can help you. Currently I am only on Linux. But what I did:
I copied the whole folder minehunt in my destination folder (/tmp/mine). When I ran qmake I got:
WARNING: Include file
/tmp/mine/helper/qmlapplicationviewer/qmlapplicationviewer.pri not
found
So I also copied the examples/declarative/helper folder into /tmp/mine.
Looked like this:
/tmp
/mine
/minehunt
/helper
Then I changed into minhunt, did 'qmake' and 'make'. A few seconds later I had a working minehunt binary in /tmp/mine/minehunt/.
I'll try tomorrow the Windows build.
Edit: Ok, tried now under Windows 7. Qt4.
QtCreator opened.
Project ...qt\demos\declarative\minehunt\minehunt.pro
loaded. Normally in release mode compiled. No problem. A file minehunt.exe was created in ....qt\demos\declarative\minehunt\release. Started: White screen. Exactly as you described it. In ...qt\demos\declarative\minehunt I found a folder 'qml'. I moved this folder and the minehunt.exe into another folder (myMineFolder). Simulating a simple deployment this way. Clicked on minehunt.exe -> worked like a charm.
So my folder layout:
myMineFolder
qml
minehunt.exe
But of course, I have set my PATH variable correctly to my Qt installation.

How to statically link Qt image formats plugins for WebKit?

I need a QWebView to display images, instead of the question marks it currently displays.
I have found that i need to link some image plugins to my application to do so. I have researched this problem for a while now, and I haven't found a satisfying solution.
I followed these steps:
1) I have added in my project folder and the folder in which the application is compiled a folder named: imageformats/ in which i have put these folowing plugins: libqgif.so and libqjpeg.so
2) I have added to my project configuration file (.pro) this:
QTPLUGIN += qjpeg \
qgif
3) And I have added to the .cpp containg the main function of my project this:
#include <QtPlugin>
Q_IMPORT_PLUGIN(qjpeg)
Q_IMPORT_PLUGIN(qgif)
And i get the following errors:
main.cpp:(.text.startup+0xce): undefined reference to `qt_plugin_instance_qjpeg()'
main.cpp:(.text.startup+0xda): undefined reference to `qt_plugin_instance_qgif()'
I also tried changing the directory to plugins/imageformats/, but it made no difference whatsoever.
For me (on Ubuntu 12.04), I didn't have libjpeg and dev headers installed.
$ sudo apt-get install libjpeg62-dev
(which will also install libjpeg62 if you don't have it).
After this, my QTWebView showed jpeg images without any extra modifications.