Build and run problems with qtquick



  • Hallo there.
    I'm new to qt and qml. My intention is to approach Plasmoids of Plasma 5 Desktop Environment. My aim is to write simple Plasmoids / applets for this great Desktop.
    So, I read some basics about qt and installed qtcreator from my distro's repo. I'm using Sabayon, a Gentoo based OS with precompiled binary packages built from Gentoo base. My Kernel is 4.13 and my Plasma 5 is of version 5.12.1.
    I found a simple qt 'project' to display a minimal window on the screen, I started a qt quick project and copied a simple main.qml text which just contents:

    import QtQuick 2.
    import org.kde.plasma.components 2.0 as PlasmaComponents
    
    PlasmaComponents.Label {
    text: "Hello world in Plasma 5 ";
    } 
    

    But when I run this file in qt edit window, I receive building errors (here):
    qt error messages

    On the other hand, when I simply run the same main.qml in a Konsole with:
    qmlscene main.qml
    then I receive the window with the text:Hello world in Plasma 5
    Honestly, I don't understand the messages of qt creator. As I said, I installed qtcreator from my Sabayon repo, but it seems, not every necessary library and / or other packages are added to provide the necessary build / compile qt environment.

    What I need is a detailed list of necessary libs and packages for a proper use of qtcreator. And: I do NOT have a debian based system, I use Sabayon.
    Anybody here, who can lead me through the first steps?
    Thank you for joining.

    -Linuxfluesterer


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    The error itself is unrelated to QtQuick.

    Can you post the build log ?



  • Thanks for reply and for welcome!
    Could this help?!
    http://i1359.photobucket.com/albums/q785/aleconte/errors_of_qtcreator_20180311_02_zpshiuixqmv.jpeg[/IMG][/URL])

    Maybe build can only be executed, when a successful run was done before.
    I don't know this about qtcreator, but from earlier language tools (environment tools) I remember something like that.
    But there's another general output:

      (Parent is QGuiApplication(0x5576ed3806a0), parent's thread is QThread(0x5576ed380870), current thread is QThread(0x5576ed388bc0)
    QObject: Cannot create children for a parent that is in a different thread.(Parent is QGuiApplication(0x5576ed3806a0), parent's thread is QThread(0x5576ed380870), current thread is QThread(0x5576ed388bc0)
    QObject: Cannot create children for a parent that is in a different thread.
    (Parent is QGuiApplication(0x5576ed3806a0), parent's thread is 
     QThread(0x5576ed380870), current thread is QThread(0x5576ed388bc0)
    QObject::installEventFilter(): Cannot filter events for objects in a different thread.
    
    QObject: Cannot create children for a parent that is in a different thread.
    (Parent is QGuiApplication(0x5576ed3806a0), parent's thread is 
    QThread(0x5576ed380870), current thread is QThread(0x5576ed388bc0)
    Could not find any platform plugin
    QObject: Cannot create children for a parent that is in a different thread.
    (Parent is QGuiApplication(0x5576ed3806a0), parent's thread is 
    QThread(0x5576ed380870), current thread is QThread(0x5576ed388bc0)
    QObject::installEventFilter(): Cannot filter events for objects in a different thread.
    Error: SEGV
    While processing the property 'QQuickDialog::contentItem', which probably has uninitialized data.
    

    -Linuxfluesterer


  • Lifetime Qt Champion

    No, with C++ you can only run your application once you successfully built it.

    There are several strange things here...

    The error in your picture means that you are likely mixing 32bit and 64bit on your system. Is that the case ?


  • Moderators

    @Linuxfluesterer If you could share the project file that would help too. Your build is quite messed up from the looks of it. -lgcc implies linking a library called gcc, but gcc is the compiler not a lib that should be linked.

    From the build log it looks like you have a lot of other issues in regards to threading and passing QObjects across threads.

    For such a simple thing as a plasmoid, especially a hello world type one, this is a lot to go wrong. Perhaps share how you created it and got to the point of building in a step by step?



  • @SGaist My system (Sabayon is told to be a 64bit system only).
    Though my /lib an my /usr/lib directories are linked to /lib64 and /usr/lib64 there are still /lib32 and /usr/lib32 directories (for compatibilities I assume).
    Anyway, I should be able to determine, that I use 64bit only, right?

    -Linuxfluesterer



  • @ambershark I just wanted to have an easy usable qt environment to save time to qml files to create qt projects. This 'Hello world' is predefined in qtcreator itself as beginning text of main.qml.
    I begun a qtquick project and haven't added anything else than I changed the greeting message inside. Then I just started 'run' and received the error messages. I am only confused what everything is missed or mismatching.

    -Linuxfluesterer


  • Moderators

    @Linuxfluesterer Ok so that leads me to believe your kits are messed up. I'm not a Qt Creator user but check your settings and make sure there are no errors in your kits. They will usually have a red exclamation if there's an issue.

    Then try a build and post the full build log here and we can help further.



  • After trying to install the pure qtcreator from qt website on a new installed Linux virtual box, I was not able to run and build the simple example qtquick man.qml.
    So, I don't know, what it's lacking of, I assume, the settings, but how should I know?
    So then, thank you for your suggestions, I'm sorry to say, for this time I give it up to try, to use qtcreator.

    -Linuxfluesterer


  • Moderators

    @Linuxfluesterer QtCreator is just an IDE. If you want to use Qt/QML/QtQuick you need to install Qt itself. Simply use the online installer and select a Qt version during installation.



  • @jsulm said in Build and run problems with qtquick:

    @Linuxfluesterer QtCreator is just an IDE. If you want to use Qt/QML/QtQuick you need to install Qt itself. Simply use the online installer and select a Qt version during installation.

    That was my idea also. I installed a new blank OS (Sabayon 64bit with Plasma 5.12.2 and Kernel 4.14) into a VirtualBox machine. Then I installed a browser (Vivaldi) and went to the qt.io website to download the online installer for my Linux system.

    So far so good. After downloading I started the installer and begun to choose components, the qt-creator is checked already. So I checked the qt engine (qt 5.10) but then I received an error message:
    Not enough disk space to store temporary files! 983,15 MiB are available while 1.30 GB are at least required.
    Hmmm I chose a 26 GByte System partition to install my Sabayon into, And at least I had 17 GBytes of free space. But qt installer insists on only 983 MBytes that were free. Strange and less helpful.

    -Linuxfluesterer


  • Moderators

    @Linuxfluesterer Are you sure your partition uses all available space? Is there enough free space on the root partition (for /tmp)?



  • @jsulm said in Build and run problems with qtquick:

    @Linuxfluesterer Are you sure your partition uses all available space? Is there enough free space on the root partition (for /tmp)?

    yes, when I leave a df -h command, then I receive 17 GB available space.


  • Moderators

    @Linuxfluesterer This error is because it uses /tmp to extract and install. Chances are your /tmp filesystem is set low.

    In most linux systems (especially cutting edge ones like gentoo, arch, etc) they use RAM for /tmp. So you just don't have enough space on your /tmp. It could have been something else was using tmp (reboot would fix, or clean it yourself), or it could be it just is only allocated 1GB.

    Temporarily you can just reassign /tmp to a physical HD location for your install.

    That's not a Qt issue but one with your setup of linux. Probably because it's a vm and people set low RAM values on their vms. :)


  • Moderators

    @Linuxfluesterer Do you have an extra partition for /tmp or is it a ramdisk?


  • Moderators

    @jsulm I don't know 100% sure for his install, but most will use tmpfs which will essentially be a ram disk. Not stored on actually HD anywhere.

    I.e. this excerpt from one of my linux systems:

    tmpfs                7.8G  472K  7.8G   1% /tmp
    

    I can't imagine that a cutting edge distro like Sabayon isn't using tmpfs, so again I'm not 100% sure but like 97%. ;)



  • @ambershark said in Build and run problems with qtquick:

    @jsulm I don't know 100% sure for his install, but most will use tmpfs which will essentially be a ram disk. Not stored on actually HD anywhere.

    I.e. this excerpt from one of my linux systems:

    tmpfs                7.8G  472K  7.8G   1% /tmp
    

    I can't imagine that a cutting edge distro like Sabayon isn't using tmpfs, so again I'm not 100% sure but like 97%. ;)

    Hmmm. I told you, that I created a VirtualBox machine with size of 26 GBytes for installing a fresh Sabayon. After installing the Sabayon OS there was a free space of 17 GBytes.
    Or do you suggest, I should create a RAM-Disk for tmpfs within a virtual machine, which has only 2 GBytes of dedicated RAM?

    -Linuxfluesterer

    p.s. of course Sabayon (it is a derivate of Gentoo) can handle tmpfs and RAM disks.


  • Moderators

    @Linuxfluesterer No it's not the size of your hard drive, it's the size of the RAM allocated to that machine and how much it uses for /tmp.

    So do a df -h and you can post the output or at least see how much space you have on tmp. If it is less than the 1.4gb needed for the install, up it. Or as I suggested temporarily point /tmp to a hard disk if you don't have the ram for a bigger /tmp.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.