Posts

Get local active IP address

The active IP address would be the one actually used to communicate on the network. In most cases a PC has the ethernet port used as primary and the wifi network used as secondary (or vice versa). If you switch from one to the other you create a situation where both network devices have a valid IP but only one of the two is actually used based on the active connection at that time.

QWebSocket synchronous communication

QWebSocket can send or receive packet with text or binary contents. As all other Qt components everything works asynchronously. However, there may be cases where it is necessary to work asynchronously waiting for the reply to a given message before moving on. Here an example for a synchronous communication that you can use in your project.

QML: Emboss effect

QML have some components allowing to draw a shadow over an item. The InnerShadow draw a shadow only in one side of the item, but for have the emboss effect we need to habe both sides with light/dark color. The solution is very simple, use two InnerShadow combined.

Git on Windows and custom SSL proxy certificate problem

Modern proxies, usually used on a companies, check each downloaded data for malicious code. For allow check of SSL connections the proxy provide a custom SSL certificate to use from inside company PCs. Use this custom certificate in a browser is a very easy operation since all modern browser can manage them by internally install the certificate. However with some other tool like Git the procedure is a bit more complicated.

Qt: Request Android app permissions

Each Android app, based to the "interaction" with system, have to declare what resources need to access through some special info called permissions . Normally these permission are declared inside the AndroidManifest.xml and this was enough. However, from android version 23 (Marshmallow) and above some part of these permissions (classified as more "critical") have to be manually requested to the user who have to accept for authorize the app to use it.