Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Wave example as splashscreen
Qt 6.11 is out! See what's new in the release blog

Wave example as splashscreen

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
8 Posts 3 Posters 1.6k Views 2 Watching
  • 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.
  • A Offline
    A Offline
    addebito
    wrote on last edited by
    #1

    Hi to all,
    I'd like to use the Wave example (https://doc.qt.io/qt-5.9/qt3d-wave-example.html) as splascreen of my application.

    Can someone give me some advice how to add a logo (png or svg file) over the wave window?

    It could be a stupid question but I'm a newbie in QML, usually I use Qt C++.
    Thank you.

    M 1 Reply Last reply
    0
    • A addebito

      Hi to all,
      I'd like to use the Wave example (https://doc.qt.io/qt-5.9/qt3d-wave-example.html) as splascreen of my application.

      Can someone give me some advice how to add a logo (png or svg file) over the wave window?

      It could be a stupid question but I'm a newbie in QML, usually I use Qt C++.
      Thank you.

      M Offline
      M Offline
      MEMekaniske
      wrote on last edited by MEMekaniske
      #2

      @addebito Hey,

      Just add a Rectangle {} with a Image{} that contains your logo, you can just adjust the z property of the rectangle to make it "On top"

      Note that if you are using the example as a splash screen you must abide by the copyright notice inside and that everyone using qt will know you cheated :p..

      MarkkyboyM 1 Reply Last reply
      0
      • M MEMekaniske

        @addebito Hey,

        Just add a Rectangle {} with a Image{} that contains your logo, you can just adjust the z property of the rectangle to make it "On top"

        Note that if you are using the example as a splash screen you must abide by the copyright notice inside and that everyone using qt will know you cheated :p..

        MarkkyboyM Offline
        MarkkyboyM Offline
        Markkyboy
        wrote on last edited by
        #3

        @MEMekaniske said in Wave example as splashscreen:

        @addebito Hey,

        Just add a Rectangle {} with a Image{} that contains your logo, you can just adjust the z property of the rectangle to make it "On top". . .

        This was the first thing I tried, I could not make my image show. An interesting problem.

        Don't just sit there standing around, pick up a shovel and sweep up!

        I live by the sea, not in it.

        M 2 Replies Last reply
        0
        • MarkkyboyM Markkyboy

          @MEMekaniske said in Wave example as splashscreen:

          @addebito Hey,

          Just add a Rectangle {} with a Image{} that contains your logo, you can just adjust the z property of the rectangle to make it "On top". . .

          This was the first thing I tried, I could not make my image show. An interesting problem.

          M Offline
          M Offline
          MEMekaniske
          wrote on last edited by
          #4

          I'm just about to catch a train, so have to run, but if no one answers by the time I'm back I'll check what I did for my HUD interface, though I'm pretty sure I just added a rect and my qml items inside that rect.

          1 Reply Last reply
          0
          • MarkkyboyM Markkyboy

            @MEMekaniske said in Wave example as splashscreen:

            @addebito Hey,

            Just add a Rectangle {} with a Image{} that contains your logo, you can just adjust the z property of the rectangle to make it "On top". . .

            This was the first thing I tried, I could not make my image show. An interesting problem.

            M Offline
            M Offline
            MEMekaniske
            wrote on last edited by
            #5

            @Markkyboy I'm back and just checked the project I made for testing QML 3D..

            I'm not using Enteties as in the wave example but should be sort of the same solution there as in mine I guess.

            View3D {
                  renderMode: View3D.Underlay
            }
            
            

            If the enteties renderer does not have any settings that achieve the same thing, then you could just use a free software and create a model with the logo as a texture :)

            1 Reply Last reply
            0
            • M Offline
              M Offline
              MEMekaniske
              wrote on last edited by
              #6

              For Scene3D as used in wave, you can set

              compositingMode : Scene3D.Underlay
              
              A 1 Reply Last reply
              0
              • M MEMekaniske

                For Scene3D as used in wave, you can set

                compositingMode : Scene3D.Underlay
                
                A Offline
                A Offline
                addebito
                wrote on last edited by
                #7

                Hi @MEMekaniske,
                thank you for your suggestions but as I wrote I'm really a newbie in QML...
                Where I've to write a Rectangle with the Image?
                Where I've to set the "compositingMode : Scene3D.Underlay"?

                I've added the "compositingMode : Scene3D.Underlay" in the main.qml but the compiler say :
                "Invalid property name "compositingMode ". (M16)"

                Google in this case doesn't help me a lot...
                Thank you.

                M 1 Reply Last reply
                0
                • A addebito

                  Hi @MEMekaniske,
                  thank you for your suggestions but as I wrote I'm really a newbie in QML...
                  Where I've to write a Rectangle with the Image?
                  Where I've to set the "compositingMode : Scene3D.Underlay"?

                  I've added the "compositingMode : Scene3D.Underlay" in the main.qml but the compiler say :
                  "Invalid property name "compositingMode ". (M16)"

                  Google in this case doesn't help me a lot...
                  Thank you.

                  M Offline
                  M Offline
                  MEMekaniske
                  wrote on last edited by
                  #8

                  @addebito I would have thought that this would work..

                  //Changed and added some import statements and added Scene3D{} and Rectangle{Text{}} to main.qml
                  //Text should be Image for your purpose.. 
                  
                  import QtQuick 2.14 as QQ2
                  import Qt3D.Core 2.14
                  import Qt3D.Render 2.14
                  import Qt3D.Input 2.14
                  import Qt3D.Extras 2.14
                  import QtQuick.Scene3D 2.14
                  
                  Entity {
                      id: root
                      KeyboardDevice { id: keyboard1 }
                  
                      Scene3D {
                          id: scene3d
                          anchors.fill: parent
                          anchors.margins: 10
                          focus: true
                          cameraAspectRatioMode: Scene3D.AutomaticAspectRatio;
                          entity: wave;
                          compositingMode:Scene3D.Underlay;
                      }
                      QQ2.Rectangle {
                          width:100;
                          height:20;
                          anchors.centerIn:parent;
                          QQ2.Text {
                              id: name
                              text: qsTr("Hello Sir")
                          }
                      }
                  
                  //--- the rest of the code left untouched 
                  

                  But I just tested it, seems that it won't work because of the example's structure..
                  Scene3D and compositingMode is ok, but can't add rectangle/text to it.

                  qrc:/main.qml:71:9: Cannot assign object of type "QQ2.Rectangle" to property of type "Qt3DCore::QEntity*" as the former is neither the same as the latter nor a sub-class of it. 
                  

                  If you write a standard window application, then implement the Qt3D example into that, then you should be able to use the normal Qt Quick items (rectangle/image/text etc) by adding them outside of the Entity/Scene3D blocks.. Probably not the easiest thing to start with being new to Qt/QML but when done you should have learned a alot :)

                  Basicly you need a application with a standard application type window, then add the root entity, containing camera, wave, background etc to Scene3D with entity: root, so it would be more like:

                  Window {
                      id:window;
                      height:480;
                      width:640;
                      QQ2.Rectangle {
                          width:100;
                          height:20;
                          anchors.centerIn:parent;
                          QQ2.Text {
                              id: name
                              text: qsTr("Hello Sir")
                          }
                      }
                      Scene3D {
                          id: scene3d
                          anchors.fill: window
                          anchors.margins: 10
                          focus: true
                          cameraAspectRatioMode: Scene3D.AutomaticAspectRatio;
                          entity: root;
                          compositingMode:Scene3D.Underlay;
                      }
                      Entity {
                          id: root
                          KeyboardDevice { id: keyboard1 }
                      
                       //the rest of the code... 
                      }
                  }
                  
                  

                  Also, main.cpp is now set to load the entity as the window, so you must also modify main.cpp correctly so it can load the standard application window and not 3DQuickQindow as it does now..

                  Maybe someone else knows an easier and/or better way, but that's how I would go about trying to solve it..
                  Hope you manage to get this running.. Would not be any learning for you if I wrote everything so just try and fail and try again! :)

                  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 Extensions
                  • Unsolved