Could not find the Qt platform plugin “xcb” in “”

Full error code:

Library searching paths:
- /home/dev/dev/SharedLibraries/qt/plugins
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: linuxfb, minimal, offscreen, vnc.

The reason is that libqxcb.so really missing in the plugins directory. It’s because Qt compilation issue.

It’s necessary to install:

sudo apt-get install libclang-dev

#XCB
sudo apt-get -y install "^libxcb.*" libx11-xcb-dev libglu1-mesa-dev libxrender-dev 
sudo apt-get -y install libxkbcommon-dev libxkbcommon-x11-dev
sudo apt-get -y install libfontconfig1-dev libfreetype6-dev libx11-dev libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev libx11-xcb-dev libxcb-glx0-dev  
sudo apt-get -y install libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync0-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev  
sudo apt-get install libxcb-devel libxkbcommon-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-renderutil-devel xcb-util-wm-devel mesa-libGL-devel

#D-Bus
sudo apt-get install libdbus-1-dev libdbus-glib-1-dev libx11-dev 

Google breakpad 2020

Get breakpad

git clone https://chromium.googlesource.com/breakpad/breakpad
git clone https://chromium.googlesource.com/external/gyp

Prepare windows

gyp\gyp.bat --no-circular-check breakpad\src\tools\windows\tools_windows.gyp
gyp\gyp.bat --no-circular-check src\client\windows\breakpad_client.gyp

Prepare linux

  • add src/third_party/lss/linux_syscall_support.h

Fix few things in VS studio in tools_windows

– library output from $(OutDir)lib\$(ProjectName).lib to $(OutDir)\$(ProjectName).lib
– add missing dependency lib Pathcch.lib
– unload gtest, gmock and dump_syms_unittest

Fix few things in VS studio in breakpad_client

– library output from $(OutDir)lib\$(ProjectName).lib to $(OutDir)\$(ProjectName).lib
– unload all unittests projects
– for crash_Generation_client, crash_generation_server, exception_handler, common, crash_generation_app
– c++ -> language -> enable RTTI YES
– c++ -> codegeneration ->runtime library -> MD/MDd

How to extract symbols

The simplest way is to use

dump_syms.exe APP_PATH\APP.exe > app.sym

but this doesn’t prepare correct structure for automatic dmp file evaluation, so we need to use symbolstore.py

Other links

 

Microsoft defender false positive

Scan library/executable against several AVs:

Report false-positive to Microsoft AV:

Report false positive & other info

Online scanners

Refresh AV definitions

cd %ProgramFiles%\Windows Defender
MpCmdRun.exe -removedefinitions -dynamicsignatures
MpCmdRun.exe -SignatureUpdate

Notarized Qt binaries for OSX

Notarization sh script for automate whole process. Script is created based on several examples found on the web. Links to these examples can be found bellow (mostly thanks to Logcg.com blog).

Notarize DMG file

#!/bin/sh

APPLICATION_PATH=$1
UNDLE_ID="___BUNDLE_ID____"
APPLE_USER="___APPLE_USER____"
APPLE_PASSWORD="___APLE_APPSPECIFIC_PASSWORD___"

 
echo "Running notarize-app command for file $APPLICATION_PATH"
xcrun altool --notarize-app -t osx -f "$APPLICATION_PATH" --primary-bundle-id=$BUNDLE_ID -u $APPLE_USER -p $APPLE_PASSWORD &> notarize-status.txt

echo "Notarize-app complete. Result: "
cat notarize-status.txt

uuid=`cat notarize-status.txt | grep -Eo '\w{8}-(\w{4}-){3}\w{12}$'`
echo "Request UUID is $uuid"

while true; do
    echo "checking for notarization..."
    xcrun altool --notarization-info "$uuid" --username $APPLE_USER --password $APPLE_PASSWORD &> notarize-response.txt
    
    echo "Response:"
    cat notarize-response.txt
    
    t=`cat notarize-response.txt | grep "success"`
    f=`cat notarize-response.txt | grep "invalid"`
    if [[ "$t" != "" ]]; then
        echo "notarization done! Stampling application $APPLICATION_PATH"
        xcrun stapler staple "$APPLICATION_PATH"
        echo "stapler done!"
        break
    fi
    if [[ "$f" != "" ]]; then
        echo "$r"
        return 1
    fi
    echo "not finish yet, sleep 30sec then check again..."
    sleep 30
done

Notarize .app / .zip

#!/bin/sh

APPLICATION_PATH=$1
ZIP_PATH=./application-to-notarize.zip
BUNDLE_ID="___BUNDLE_ID____"
APPLE_USER="___APPLE_USER____"
APPLE_PASSWORD="___APLE_APPSPECIFIC_PASSWORD___"


echo "Packing app $APPLICATION_PATH to zip file $ZIP_PATH"
ditto -ck --rsrc --sequesterRsrc $APPLICATION_PATH $ZIP_PATH
 
echo "Running notarize-app command for file $ZIP_PATH"
xcrun altool --notarize-app -t osx -f "$ZIP_PATH" --primary-bundle-id=$BUNDLE_ID -u $APPLE_USER -p $APPLE_PASSWORD &> notarize-status.txt

echo "Notarize-app complete. Result: "
cat notarize-status.txt

uuid=`cat notarize-status.txt | grep -Eo '\w{8}-(\w{4}-){3}\w{12}$'`
echo "Request UUID is $uuid"

while true; do
    echo "checking for notarization..."
    xcrun altool --notarization-info "$uuid" --username $APPLE_USER --password $APPLE_PASSWORD &> notarize-response.txt
    
    echo "Response:"
    cat notarize-response.txt
    
    t=`cat notarize-response.txt | grep "success"`
    f=`cat notarize-response.txt | grep "invalid"`
    if [[ "$t" != "" ]]; then
        echo "notarization done! Stampling application $APPLICATION_PATH"
        xcrun stapler staple "$APPLICATION_PATH"
        echo "stapler done!"
        break
    fi
    if [[ "$f" != "" ]]; then
        echo "$r"
        return 1
    fi
    echo "not finish yet, sleep 30sec then check again..."
    sleep 30
done

Useful links:

Docker links

Docker on Ubuntu 2

https://docs.docker.com/engine/installation/linux/ubuntulinux/#/install-the-latest-version

Windows

http://stackoverflow.com/questions/30496116/how-to-disable-hyper-v-in-command-line
http://serverfault.com/questions/767994/can-you-run-docker-natively-on-the-new-windows-10-ubuntu-bash-userspace
http://www.poweronplatforms.com/enable-disable-hyper-v-windows-10-8/

Docker articles

http://stackoverflow.com/questions/17236796/how-to-remove-old-docker-containers
https://techoverflow.net/blog/2013/10/22/docker-remove-all-images-and-containers/
http://severalnines.com/blog/mysql-docker-building-container-image
https://docs.docker.com/engine/tutorials/dockerimages/
http://blog.thoward37.me/articles/where-are-docker-images-stored/
Docker images
http://docker4wordpress.org/

Incredibuild and “cannot create temporary il file”

This is caused by latest MS security update. After applying these two 3126587 and 3126593 previous versions of Incredibuild stopped working.

Command line error D8037 : cannot create temporary il file 

The solution is to uninstall it

https://support.microsoft.com/en-us/kb/3126587
https://support.microsoft.com/en-us/kb/3126593

On Windows 10 the responsible update is KB3135173

Next steps

Also it’s necessary to disable these updates in auto-update!

explorer_2016-04-04_10-02-20

More info:

http://xoreax.helpserve.com/Knowledgebase/Article/View/131/8/command-line-error-d8037–cannot-create-temporary-il-file

QML Notes

Sources

F5 for instant reload,

 

class UltraView : public QQuickView {
 protected:
    void keyPressEvent(QKeyEvent*event) override {
         if(event->key()==Qt::Key_F5){
             auto oldSource=source();
             setSource({});
             engine()->clearComponentCache();
             setSource(oldSource);
         }
    }
};

F10 and F11 for slowing down animations

else if(event->key()==Qt::Key_F10) { 
  QUnifiedTimer::instance()->setSlowModeEnabled(true);
  QUnifiedTimer::instance()->setSlowdownFactor(10);
} else if(event->key()==Qt::Key_F11) {
  QUnifiedTimer::instance()->setSlowModeEnabled(false);
  QUnifiedTimer::instance()->setSlowdownFactor(1);
}

QML Live editing

QML Lint

Qml & QtQuick

Qt documentation

QML Canvas

QML States

QML MouseEvents

QML c++ integration

QtQuick painted items

QML charts

QML Diagrams

QML & QtQuick blogposts

QML Selection, multiselection, rectangle-selection

QML Tools

QML Applications

 

Other topics

Qt 5.5.0 an Qt 5.5.1, QWebEngine, QtWebKit and ICU

Notes about compiling QtWebEngine (instead of QtWebkit) together with Qt 5.5.1

Qt 5.5.0 configure switches for ICU:

configure \
    -icu \
    -I Q:\SharedLibraries\icu4c-51_1\icu\include \
    -L Q:\SharedLibraries\icu4c-51_1\icu\lib64

Starting with 5.5.1 it shouldn’t be necessary to compile and ship ICU libraries because ICU should be included in Qt package itself.

Compile QtWebkit

It’s necessary to compile it as standalone module.

cd Qt/qtwebkit
perl Tools\Scripts\build-webkit

Simpler solution

Much easier solution seem to be to use http://www.awesomium.com/  😉

Notes:

  • When changing configure settings, it’s sometimes necessary to perform complete clean rebuild. The  best way how to do that is download completely new source package.
  • nmake clean or nmake distclean unfortunately didn’t work for 100%
  • It’s necessary to have installed Ruby, Python and Perl

Source links:

Other info:

Crash in QTreeWidget / QTreeView index mapping on Mac OSX 10.10 part III

So, one more attempt. Previous articles (part1, part2) mentioned possible solutions to fix crash insinde the QTreeWidget and QAccessibleTableCell.

Unfortunately, deselecting current item still doesn’t fix all issues. The problem with deselection is that it’s not handled correctly via QAccessibleTableCell:

If current index isn’t valid, QAccessible doesn’t correctly update currect QAccessibleTableCell object which caused all this evil crashes.

So there are two ways how to fix it. One is to manually set QAccessibleTableCell but I didn’t find a way how to do that. The second way is to disable QAccessible for Property editor. Unfortunately it’s not an easy task. In QAccessible exists method setActive:

QAccessible::setActive(false)

But this method works only with AccessibleObserver class but not with QPlatformAcessibility which handles real QAcessible::isActive result. Because of this it’s necessary to update setActive method in file qacessible.cpp inside the Qt.

Original method:

void QAccessible::setActive(bool active)
{
  for (int i = 0; i < qAccessibleActivationObservers()->count() ;++i)
    qAccessibleActivationObservers()->at(i)->accessibilityActiveChanged(active);
}

and updated version:

void QAccessible::setActive(bool active)
{
  #ifndef QT_NO_ACCESSIBILITY
    if ( QPlatformAccessibility *pfAccessibility = platformAccessibility() )
      pfAccessibility->setActive(active);
  #endif

  for (int i = 0; i < qAccessibleActivationObservers()->count() ;++i)
    qAccessibleActivationObservers()->at(i)->accessibilityActiveChanged(active);
}

In case you will find better way how to turn off accessibility, please let me know.

But there is still one more problem. Occasionally OS X decides to switch accessible back on:

And this is probably the reason why everything works ok on older OS X but not on 10.10. Because OS X 10.10 randomly turns accessible on which causes this crash. Accessible is usually turned on when opening some modal dialog.

This explains why opening an empty dialog increased the probability to crash the application. The only solution I have found is to disable QAccessible every time the PropertyEditor is cleared up.