matinzk
Posts: 35
Joined: Fri Sep 28, 2012 4:26 pm
Location: UK

QT Quick the right tool for GUI designs?

Fri Nov 21, 2014 9:09 pm

Hi everyone. I am very new to the QT stuff.

I would like to install QT on Linux (Ubuntu) do a graphical design and run on Raspberry Pi.

My questions:

Is QT Quick the right tool to do this with? I'd like to program using QML.

Or do I need QT creator or something?

Thanks for all the Help.

M.

riklaunim
Posts: 265
Joined: Tue Apr 22, 2014 7:34 pm

Re: QT Quick the right tool for GUI designs?

Fri Nov 21, 2014 9:21 pm

Qt Creator is an IDE in which you can do Qt app - with or without Qt quick. You can also look at PyQt4/PyQt5 which allows you to use Python instead of C++ to make the nice GUI work :) And it's cross-platform. If you don't use platform-specific dependencies then your app ought to work on Linux (various CPU arch), Windows or OSX and with some luck on some mobile platforms more or less :)

matinzk
Posts: 35
Joined: Fri Sep 28, 2012 4:26 pm
Location: UK

Re: QT Quick the right tool for GUI designs?

Fri Nov 21, 2014 9:25 pm

Thanks for the reply.

I will be using QML so no C++.

If I program on Ubuntu then will it be easy to deploy for RPi?

M.

riklaunim
Posts: 265
Joined: Tue Apr 22, 2014 7:34 pm

Re: QT Quick the right tool for GUI designs?

Fri Nov 21, 2014 9:29 pm

If you can avoid any C++ code for the backend then it would be very cool (for QML). In general you write once, run anywhere. In my case I just had to freeze into a standalone binary for Windows and OSX (PyQt4) without any code changes. Linux just run the sources without any distro/arch problems.

zebox
Posts: 16
Joined: Wed Jul 09, 2014 4:19 am

Re: QT Quick the right tool for GUI designs?

Sat Mar 21, 2015 8:08 am

Hi All!!!
Please, help!
I try compile simple Qt\QML app on Pi. Compile complete without any error, but when I try start app I get error message :(

Code: Select all

 pi@raspberrypi ~/dev/QML1Test/build $ ./QML1Test -platfrom eglfs
EGLFS: Unable to query physical screen size, defaulting to 100 dpi.
EGLFS: To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
EGLFS: Unable to query screen depth, defaulting to 32.
EGLFS: To override, set QT_QPA_EGLFS_DEPTH.
QQmlApplicationEngine failed to load component 
qrc:/main.qml:4 module "QtQuick.Dialogs" is not installed
qrc:/main.qml:1 module "QtQuick" is not installed
qrc:/main.qml:3 module "QtQuick.Window" is not installed
qrc:/main.qml:4 module "QtQuick.Dialogs" is not installed
qrc:/main.qml:1 module "QtQuick" is not installed
qrc:/main.qml:3 module "QtQuick.Window" is not installed
qrc:/main.qml:4 module "QtQuick.Dialogs" is not installed
qrc:/main.qml:1 module "QtQuick" is not installed
qrc:/main.qml:3 module "QtQuick.Window" is not installed
sources:
main.cpp

Code: Select all

#include <QApplication>
#include <QQmlApplicationEngine>

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    QQmlApplicationEngine engine;
    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));

    return app.exec();
}
main.qml

Code: Select all

import QtQuick 2.4
import QtQuick.Controls 1.0
import QtQuick.Window 2.2
import QtQuick.Dialogs 1.2

ApplicationWindow {
    title: qsTr("Hello World")
    width: 640
    height: 480
    visible: true

    menuBar: MenuBar {
        Menu {
            title: qsTr("&File")
            MenuItem {
                text: qsTr("&Open")
                onTriggered: messageDialog.show(qsTr("Open action triggered"));
            }
            MenuItem {
                text: qsTr("E&xit")
                onTriggered: Qt.quit();
            }
        }
    }

    MainForm {
        anchors.fill: parent
        button1.onClicked: messageDialog.show(qsTr("Button 1 pressed"))
        button2.onClicked: messageDialog.show(qsTr("Button 2 pressed"))
        button3.onClicked: messageDialog.show(qsTr("Button 3 pressed"))
    }

    MessageDialog {
        id: messageDialog
        title: qsTr("May I have your attention, please?")

        function show(caption) {
            messageDialog.text = caption;
            messageDialog.open();
        }
    }
}
I need create and start GUI (Qt\QML) without X.
what's do I wrong?

zebox
Posts: 16
Joined: Wed Jul 09, 2014 4:19 am

Re: QT Quick the right tool for GUI designs?

Sat Mar 21, 2015 8:59 am

Now I following there http://www.qtcentre.org/threads/60907-H ... -installed

copy qml folder (for android_armv7 from my Qt 5.4 installation folder on my Desktop) to build dir and get one error:

Code: Select all

 ./QML1Test -platfrom eglfs
EGLFS: Unable to query physical screen size, defaulting to 100 dpi.
EGLFS: To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
EGLFS: Unable to query screen depth, defaulting to 32.
EGLFS: To override, set QT_QPA_EGLFS_DEPTH.
QQmlApplicationEngine failed to load component 
qrc:/main.qml:1 a component declaration requires two or three arguments, but 1 were provided
main.qml line 1 is the import import QtQuick 2.4 and it include two parametrs.

My brain will broken soon ;(((

zebox
Posts: 16
Joined: Wed Jul 09, 2014 4:19 am

Re: QT Quick the right tool for GUI designs?

Sun Mar 22, 2015 12:28 pm

Wow! Now I can build Qt Enviroment as this http://qt-project.org/wiki/RaspberryPi_Beginners_guide
and can start simple qt\qml\c++ app. But I can't find info about using QtQuick.Controls for Pi. It's component is missing in my qt5pi->qml folder. This is possible for Pi?

User avatar
topguy
Posts: 6892
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: QT Quick the right tool for GUI designs?

Sun Mar 22, 2015 8:00 pm

In the part of that guide that says "Compiling other modules." you should at least add "qtxmlpatterns" and "qtquickcontrols" to the build if you plan to use QML much.

I'm using a different guide to build Qt5 directly on the Pi2 and QtQuickControls work.

zebox
Posts: 16
Joined: Wed Jul 09, 2014 4:19 am

Re: QT Quick the right tool for GUI designs?

Wed Mar 25, 2015 10:23 am

Could You explain how can I do QT\QML for Video output. Read about qtmultimedia which don't work on Pi. Read about PiOTextures, but I think this some difficult way. Try using Show and Hide QML View and run omxplayer directly (via system("omxplayer -o hdmi myvideo.mp4"), but can't do it too.

Please advise how can coding GUI with QT\QML and video output on Pi?

User avatar
topguy
Posts: 6892
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: QT Quick the right tool for GUI designs?

Wed Mar 25, 2015 2:48 pm


zebox
Posts: 16
Joined: Wed Jul 09, 2014 4:19 am

Re: QT Quick the right tool for GUI designs?

Tue Apr 21, 2015 9:50 am

And Hi again! )

I try learning QML\Qt for GUI and faced with problem.
I can't register c++ class for QML.

I do this

Code: Select all

qmlRegisterType<MyTestClassName>("MyClass",1,0,"MyClassMod");
where MyTestClassName is my custom class
project compile normaly, but when start, I get error:

Undefined symbol _Zn8re ..... etc.
When I comment qmlRegisterType string, all start is OK!

I get same error when try output debug message:

Code: Select all

QString qstr1="test1";
qDebug()<<qstr1
and fix it that:

Code: Select all

qDebug()<<qstr1.toUtf8().data()
How can I fix above error on RPi ?
P.S. (I'm using cross-compile build as this http://wiki.qt.io/RaspberryPI_Beginners_guide)

User avatar
topguy
Posts: 6892
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: QT Quick the right tool for GUI designs?

Tue Apr 21, 2015 12:39 pm

zebox wrote: Undefined symbol _Zn8re ..... etc.
Exact error messages is important when trying to help pin down problems.

User avatar
eriktheitalian
Posts: 358
Joined: Thu Feb 19, 2015 1:03 pm

Re: QT Quick the right tool for GUI designs?

Tue Apr 21, 2015 4:34 pm

Qt's 4.8 supported apps gui realy slow with raspbian. Speed is good with archlinux.
( i'm tried qupzilla-at4 on both. Arch better. )

I'm tried qupzilla qt5 and otter browser on archlinux. Not worked.
No one working for fix qt compatibility bugs or speed optimize. U cant find answers about qt. No one care.

There is good web browsers maded by qt but no one care. No one talk about them.
I cant using enough English language. My writings can be wrong grammer.$
"in micro$oft we not trust"

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 27949
Joined: Sat Jul 30, 2011 7:41 pm

Re: QT Quick the right tool for GUI designs?

Tue Apr 21, 2015 5:09 pm

eriktheitalian wrote:Qt's 4.8 supported apps gui realy slow with raspbian. Speed is good with archlinux.
( i'm tried qupzilla-at4 on both. Arch better. )

I'm tried qupzilla qt5 and otter browser on archlinux. Not worked.
No one working for fix qt compatibility bugs or speed optimize. U cant find answers about qt. No one care.

There is good web browsers maded by qt but no one care. No one talk about them.
Lots of people care, but lots of people are very busy...don't attribute to not-caring that which can be attributed to lack of resource.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

zebox
Posts: 16
Joined: Wed Jul 09, 2014 4:19 am

Re: QT Quick the right tool for GUI designs?

Tue Apr 21, 2015 9:48 pm

this error I get

Code: Select all

undefined symbol: _ZN9QMetaType22registerNormalizedTypeERK10QByteArrayPFvPvEPFS3_S3_PKvEi6QFlagsINS_8TypeFlagEEPK11QMetaObject

User avatar
topguy
Posts: 6892
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: QT Quick the right tool for GUI designs?

Wed Apr 22, 2015 12:00 pm

zebox wrote:this error I get

Code: Select all

undefined symbol: _ZN9QMetaType22registerNormalizedTypeERK10QByteArrayPFvPvEPFS3_S3_PKvEi6QFlagsINS_8TypeFlagEEPK11QMetaObject
C++ mangled class/method names like this can be "demangled" with for example http://demangler.com so this is the real name of the missing function:

Code: Select all

QMetaType::registerNormalizedType(QByteArray const&, void (*)(void*), void* (*)(void*, void const*), int, QFlags<QMetaType::TypeFlag>, QMetaObject const*)

zebox
Posts: 16
Joined: Wed Jul 09, 2014 4:19 am

Re: QT Quick the right tool for GUI designs?

Thu Apr 23, 2015 9:02 pm

Oh! Thank's for this, but could you explain what's does it mind?

I must to initialize some class for QByteArray?

User avatar
topguy
Posts: 6892
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: QT Quick the right tool for GUI designs?

Thu Apr 23, 2015 11:36 pm

I would start looking in the Qt docs to see where QMetaType is. And make sure that the library containing that class is included.

I think its related to the .moc files that Qt sometimes generates. Read about QMetaObjects in the docs.
Also make sure that any of these .moc files are compiled and linkted.

zebox
Posts: 16
Joined: Wed Jul 09, 2014 4:19 am

Re: QT Quick the right tool for GUI designs?

Fri Apr 24, 2015 4:21 am

Thank you very much!!! Will Try resolve as you advice..

Return to “Graphics programming”