How to use offline mapbox for my specific qml application? - qt

I cloned mapboxgl from Github. I followed the steps.
https://github.com/mapbox/mapbox-gl-native/tree/master/platform/qt
The map running when I enter the make run-qt-app command on mapbox-gl-native directory. But I would like to include the offline map on my qml application to implement via qt creator.
How can I do it? Could you help me?

That repository contains code for the Qt bindings and should not be used directly.
Use the "mapboxgl" plugin available since Qt 5.9. There you can specify the path for the offline database:
https://doc-snapshots.qt.io/qt5-5.9/location-plugin-mapboxgl.html#optional-plugin-parameters

Related

Is there a programmatic way to install Qt components?

I see users sharing images of their qt components (example below) so that others can copy their toolchain.
Is there any alternative to sending a photo of these selected components? Eg a manifest file, or an install script?

How use Point Cloud Library (PCL) in Qt creator?

As part as a master project, I need to create a post-processing app for a 3D scan.
I discovered PCL and I managed to use it on MSVC 2015 and performed few operations with sucess without any GUI.
Now I would like to use PCL with Qt creator.
(like in http://pointclouds.org/documentation/tutorials/qt_visualizer.php).
I am a noob with Qt and I don't know how to include PCL in a project.
If anybody can help me by giving me an orientation on setting up that kind of project, or a property sheet, It'll be great,
I'm working on Windows 7 , 64 bits.
To import a libary (dll) into your Qt project, simply right-click on your Qt solution, choose "Add libary", then extern libary and add the libary path and the include path. This will make the header files accessable for the IDE.
Now you can code!

Is it possible to set icon for a custom file used by my app

I would like to create and app using Qt which will use custom files. The app will be available on Windows, OS X and Linux.
The idea is to have a custom icon for my file type (e.g. when you install Adobe's Master Collection, .as, .fla, .ps, etc. files have they own icons).
As far as I know Qt only helps you with app icon. I did not find any kind of support for this kind of problem.
This seems to be an OS problem. Do I need to create scripts to run on app install? (I will be using Bitrock's install builder to provide installers)
How can I achive this behaviour on all OSs?

QT multilanguage app

I am new in Qt framework and now, I want to create an app which supports multi-language display. I known there is a way to do: Qt Linguist. I searched, and archieved some information about lupdate, lrelease ... But I just have Qt Creator IDE, how can I run or compile lupdate, lrelease ???
How can I create *.ts file ?
Please give me some code example or guide to do. (I often use Qt Designer to create GUI)
As far as i know, there is no option in QtCreator to use QtLinguist - you have to do it manually. Here you have an excellent documentation about how to do it. I have learned from there also.

Compiled distribution of Qt application for windows

I was successfully able to compile and run my Qt application. However, when I move the .exe file outside its original path, I found out that I have to manually copy the Qt DLLs (e.g. mingw10.dll, qtcore4.dll). Is there any dynamic way to link these libraries with my application?
I think you mean you want to "statically" link these libraries with your application.
Basically this means that everything will be rolled inside your exe, and you will have no need of those dlls anymore.
There are advantages to to static linking, but there are also disadvantages as well. You should be absolutely sure that this is what you want to do before you go this way.
Check out this link which explains the difference in depth Dynamic Linking vs Static Linking
As for your specific issue, if you are sure you want to use static linking you will have to change your Qt setup to be built statically. By default the Qt distribution is setup to use dynamic linking. There is a handy guide for that here.
Basically when you setup the build you have to run "configure -static" to change all the project settings to use static linking instead of dynamic linking. And then build Qt over again.
You should also verify your Qt license. If you are using the Qt LGPL license and you want to to link statically you will have to include all your object files (.o and .obj) as Mihai Limbășan wisely explained in his comment. If you have bought and paid for Qt, then you have no problem.
If the DLLs are on the PATH for the application, then they will be found and work. So, you could add where your Qt binaries/dlls are into the %PATH% environment variable. If you're going to create an installer for your application, you'll need to either package these libraries in so they're in the bin directory - or you'll have to expect every user to install and possibly compile Qt themselves (hint: go with the first option. :) )

Resources