How can I display my OSM tiles in Qt client application? - c++

I am working on a map project and I have an OSM tile server which is built on Linux Debian Jessie and it uses Mapnik and mod_tiles to render tiles.
URL for a tile: http://domain/mod_tiles/Z/X/Y.png
I would like to build a client application too in C++ with Qt framework, but I really don't know how I should start it.
I found an example in Qt, but I don't know how I could change the tile server from default to my tile server.
If you know the answer or have some helps or if you know another way to solve my problem, please inform me.

According to http://doc.qt.io/qt-5/location-plugin-osm.html, there are two ways of doing this.
The simplest is to set osm.mapping.custom.host to http://domain/mod_tiles/, then you use the last of the Map.supportedMapTypes.

Related

Displaying a SDL window in Qt

Looking around at some SDL games and emulators I notice that each time there's an android version of it, same base code is used as the desktop versions.
For example in an atari 7800 emulator I've found on github, I don't really understand java and I'm trying to see how it's done there. I suppose that based on the line 991 it captures the display from the sdl2 process maybe by running it headless and rendering the sdlwindow in android?
No idea, trying to understand the code but I'm like looking at it like a cat looking at a calendar (a saying in my country).
What I'm trying to do is to somehow archive the same thing in QT5 since the platform I'm using uses it for the interface and anything app related to communicate with their APIs.

ios photo/video capture/usage using c++

hi there i need some help.
i already made an android app that take a pic/video, send it to a server which do some stuff and return a string . on the android app taking the photo/video was done using the java code, the path is sent to a C++ code which with help of NDK send the data to the server and get the string back. then pass the string to java for display and delete the photo/video.
now i need to do the same on ios.
is there a way to get a photo/video from camera, and then pass the path to my c++ code that will be the same as in my android app?
thanks
(Edit)
Let me describe the question better.
i need an objective c code, that will take an image/video from the camera (i could find the tutorial camera apps of apple and many other sites) what i need now to add is a code that will get me the absolute path to the media file so that i can pass it to the C++ code)
I found this artical how to access C/C++ Lib in iOS Objective-C++
https://www.sitepoint.com/using-c-and-c-in-an-ios-app-with-objective-c/

Set playbook native application orientation

I've been looking for a long time and I can't seem to figure out how to set the preferred orientation of an application for Playbook/BB10 using the native SDK.
My application is targeting playbook and BB10 handsets. The application needs to be in landscape for both devices. I'm using Native SDK Version 10.0.4.
I've looked into bps/orientation.h and it seems like it only has functions to retrieve this information, and there's a lot of areas inside screen that seem like they might have something to do with the orientation but I'm not sure.
Anybody else run into this?
I am not sure if you are still looking for this information but to specify the initial orientation of your application, you use the initialWindow tag in your application descriptor file (also called a bar-description.xml file). The following code shows what tags to add to make the orientation of your app initially be in landscape (aspectRatio), and not allow users to change the orientation (autoOrients)
<initialWindow>
<aspectRatio>landscape</aspectRatio>
<autoOrients>false</autoOrients>
</initialWindow>
There is more information on the autoOrients tag at the official blackberry site: https://developer.blackberry.com/native/documentation/com.qnx.doc.native_sdk.devguide/com.qnx.doc.native_sdk.devguide/topic/r_barfile_dtd_ref_autoorients.html
The entire DTD can be found here: developer.blackbery.come/native
See if this helps:
Playbook Orientation
The orientation is determined by the accelerometer and the OS "lock orientation" setting.
Your application is not required to rotate itself to match the orientation, although this is recommended. If you don't the system bezel swipes won't match the orientation used by your application, probably resulting in a confused user.

Pixel-based graphics in linux terminal application

I'm developing a C++ application which will run on a headless server and keep track of some statistics. The application will run in a terminal in a screen session so that I can login over SSH and check those statistics.
Now, what I want to do, is display plots of various data. For that I need pixel-per-pixel access of course, which is not possible with ncurses or S-Lang. I found out about DirectFB (and it's C++ wrappers DFB++ & ++DFB), but can't seem to find conclusive evidence if it is possible to draw graphics with it inside a terminal.
Is DirectFB the way to go? Will it work fine inside a screen session without creating extra windows? If not, is there any library out there that can achieve what I want?
Edit: Ideally, I would of course prefer a library that has some kind of widget support as well, so that I don't have to create tons of classes to emulate text fields/scrollbars/...
You could make your application have a web interface. You could use e.g. Wt or Onion to make your application an HTTP server (or you could make it a FastCgi application), and use SVG (perhaps with Javascript and Ajax tricks) to display vector graphics (or generate a pixel-based PNG or JPEG or GIF image; there are several libraries for that).
I don't think that DirectFB works with SSH, and I believe it is becoming deprecated (for example GTK3 don't support it anymore).
You might also generate Gnu Plot graphics (by generating the appropriate commands), but that is not very interactive.
I don't think that making graphics thru ssh without X make sense, unless you want only ASCII art (which I believe is not the right way for your needs).

How to start Xcode4 opengl project for mac

Good Day
I want to start a opengl project, mainly to follow the Nehe tutorials.
My problem is that I only see templates for opengl es for iphone, and when I click build on those, I only have the choice between iphone or ipad simulator.
So How can I get started with a simple opengl template to follow the tutorial series, without using a simulator, but executing it natively on my mac osx lion?
Please give me a step by step instruction if possible :)
I looked around everywhere but all I found were instructions for Xcode 3 and below etc.
Any help would be appreciated
Create a normal Cocoa project, add the OpenGL framework. In your main window add a NSOpenGLView.
http://developer.apple.com/devcenter/mac/resources/opengl/
I am currently in the process of writing an intuitive Xcode 4 Template for an OpenGL Mac application, which I think is exactly what you were wanting.
In the mean time, you can look at this, a Pong clone I made in OpenGL on the Mac, done the proper way.
EDIT: The template isn't completely finished, but it's definately usable. I didn't implemenet the 3D option, so picking that in the dropdown will result in blank files.
Donwload it from here and then move it into the ~/Library/Developer/Xcode/Templates/Project Templates/Applications folder in your user director.