Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QT 5.12.1 Error Expanding Materials Colors
Qt 6.12 LTS is out! See what's new in the release blog

QT 5.12.1 Error Expanding Materials Colors

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 892 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kerwon
    wrote on last edited by
    #1

    QT 5.12.1 Expanding Materials Colors

    I'm trying to add a new color to default material, in order to do that I modify all the files: plugins.qmltypes, qquickmaterialstyle_p.h and qquickmaterialstyle.cpp., located in the folder : 5.12.1/Src/qtquickcontrols2/src/imports/controls/material/.
    After that I compile Qt to apply the changes, but when I try to use the new color Qt cant find it.

    error: java.lang.UnsatisfiedLinkError: dlopen failed: library "libqtquickcontrols2plugin.so" not found

    I add on .pro
    LIBS += -L/usr/local/Qt-5.12.1/qml/QtQuick/Controls.2/ -lqtquickcontrols2plugin
    ANDROID_EXTRA_LIBS += /usr/local/Qt-5.12.1/qml/QtQuick/Controls.2/libqtquickcontrols2plugin.so

    My steps:

    1º Download Qt 5.12.1

    export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

    export PATH=$PATH:$JAVA_HOME/bin

    git clone https://github.com/qt/qt5.git

    cd qt5

    perl init-repository

    git checkout 5.12.1

    git submodule update --recursive

    2ºAdd to plugins.qmltypes the new colors in the enum. ("ResolutionBlue": 19 )
    Dir:/home/pedrojimenez/Qt/5.12.1/Src/qtquickcontrols2/src/imports/controls/material/plugins.qmltypes

    ----------------------------plugins.qmltypes---------------------------------

        Enum {
            name: "Color"
            values: {
                "Red": 0,
                "Pink": 1,
                "Purple": 2,
                "DeepPurple": 3,
                "Indigo": 4,
                "Blue": 5,
                "LightBlue": 6,
                "Cyan": 7,
                "Teal": 8,
                "Green": 9,
                "LightGreen": 10,
                "Lime": 11,
                "Yellow": 12,
                "Amber": 13,
                "Orange": 14,
                "DeepOrange": 15,
                "Brown": 16,
                "Grey": 17,
                "BlueGrey": 18,
                "ResolutionBlue": 19
            }
        }
    

    3º Add to qquickmaterialstyle_p.h the new colors in the enum Color “ResolutionBlue”
    Dir:/home/pedrojimenez/Qt/5.12.1/Src/qtquickcontrols2/src/imports/controls/material/qquickmaterialstyle_p.h

    ----------------------qquickmaterialstyle_p.h--------------------------------

    enum Color {
        Red,
        Pink,
        Purple,
        DeepPurple,
        Indigo,
        Blue,
        LightBlue,
        Cyan,
        Teal,
        Green,
        LightGreen,
        Lime,
        Yellow,
        Amber,
        Orange,
        DeepOrange,
        Brown,
        Grey,
        BlueGrey,
        ResolutionBlue
    };
    

    4º Add to qquickmaterialstyle.cpp the new colors Color “ResolutionBlue”

    Dir:/home/pedrojimenez/Qt/5.12.1/Src/qtquickcontrols2/src/imports/controls/material/qquickmaterialstyle.cpp
    -----------------------------qquickmaterialstyle.cpp-------------------
    // ResolutionBlue
    {
    0xFF0040FF, // Shade50
    0xFF0039E5, // Shade100
    0xFF0033CC, // Shade200
    0xFF002CB3, // Shade300
    0xFF002699, // Shade400
    0xFF002080, // Shade500
    0xFF001966, // Shade600
    0xFF00134D, // Shade700
    0xFF000C33, // Shade800
    0xFF00061A, // Shade900
    0xFF0039E5, // ShadeA100
    0xFF0033CC, // ShadeA200
    0xFF002699, // ShadeA400
    0xFF00134D // ShadeA700
    }


    -Last step : Compile QT for android

    OPENSSL_LIBS='-lcrypto -lssl' ./configure -confirm-license -opensource -xplatform android-clang --disable-rpath -nomake tests -nomake examples -android-ndk /home/pedrojimenez/QtDeveloper/android-ndk-r17c/ -android-sdk /home/pedrojimenez/QtDeveloper/android-sdk-linux/ -android-ndk-host linux-x86_64 -android-toolchain-version 4.9 -skip qttranslations -skip qtserialport -no-warnings-are-errors -qt-zlib -qt-freetype -android-arch armeabi-v7a -android-ndk-platform android-21 -openssl-linked -I /home/pedrojimenez/QtDeveloper/libs/openssl-1.0.2g/armv7/include -L /home/pedrojimenez/QtDeveloper/libs/openssl-1.0.2g/armv7/lib -v

    make -j 4

    make install

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt
    • Unsolved