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. [SOLVED] Problems with launching new window
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Problems with launching new window

Scheduled Pinned Locked Moved QML and Qt Quick
8 Posts 2 Posters 3.4k Views 1 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.
  • Z Offline
    Z Offline
    zword
    wrote on last edited by
    #1

    Hello!

    I am trying to launch new window. Here is the code: http://qt-project.org/forums/viewthread/30689

    The problem is new window appears ONLY when i first hide app and then open it.

    When i hide it app outputs:
    W/Qt (14985): eglconvenience\qeglplatformcontext.cpp:319 (virtual void QEGLPlatformContext::swapBuffers(QPlatformSurface*)): QEGLPlatformContext::swapBuffers(): eglError: 12291, this: 0x53977c70 --

    This output from Qt5.3.0.
    Qt5.3.1, 5.3.2, 5.4.0 also gave me warnings linked with EGL.

    Qt5.2.1 didn't open new window at all and said:
    eglMakeCurrent:593 error 3002 (EGL_BAD_ACCESS)

    I'm running it on Android 4.2.2, Philips S308, on Asus Fonepad 7 with the same Android version this situation repeated.

    Maybe you have some examples of creation new window? Or show me how to fix this error.

    Help!

    Thanx.

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Android (and EGLFS) supports only one top-level window.

      (Z(:^

      1 Reply Last reply
      0
      • sierdzioS Offline
        sierdzioS Offline
        sierdzio
        Moderators
        wrote on last edited by
        #3

        You could create - say - a plain gray top-level widget, that has your "windows" as subwidgets. That would require you to do quite a bit of rewriting here.

        (Z(:^

        1 Reply Last reply
        0
        • Z Offline
          Z Offline
          zword
          wrote on last edited by
          #4

          Thank you for reply!

          Sierdzio, tried what you suggest and i succeded, but i have some question on my approach.

          My

          bq. plain gray top-level widget

          is Rectangle.

          I use Loader to load my main "window" qml. Then i click on MouseArea in this window to load second window qml (with the same loader id). Then i want to return to main "window" and click on second window MouseArea to load it (loader id the same), but it state is lost. I understand that.

          My question: do i have to save my main "window" state when i load another "window" or i chose wrong approach (by means of Loader functionality) in the first place?

          1 Reply Last reply
          0
          • sierdzioS Offline
            sierdzioS Offline
            sierdzio
            Moderators
            wrote on last edited by
            #5

            Your use-case now sounds like a nice candidate for "Flipable":http://doc.qt.io/qt-5/qml-qtquick-flipable.html element, or the "StackView":http://doc.qt.io/qt-5/qml-qtquick-controls-stackview.html.

            A minimal change to your current approach would be this: display your first window at application start (you can even replace the Rectangle), then add your second window in this way (add this as the last child of main window, to make it's z value high enough):
            @
            Loader {
            anchors.fill: parent // will fill the main window when set to visible
            source: "path to your file"
            visible: false
            }
            @

            Then, then you click on your mouse area, you can just set visible to true, and the second window will be shown. And to go back - you can send a signal from your secondary window that will be read in main and will set visible back to false. That is a bit more advanced, but I can help you with that later. Let's focus on the basics first :-)

            (Z(:^

            1 Reply Last reply
            0
            • Z Offline
              Z Offline
              zword
              wrote on last edited by
              #6

              Thank you, sierdzio. That relly helped.

              1 Reply Last reply
              0
              • Z Offline
                Z Offline
                zword
                wrote on last edited by
                #7

                bq. Android (and EGLFS) supports only one top-level window.

                Is it only for QML or QT (without QML) also supports only one top-level window?

                1 Reply Last reply
                0
                • sierdzioS Offline
                  sierdzioS Offline
                  sierdzio
                  Moderators
                  wrote on last edited by
                  #8

                  [quote author="zword" date="1422633603"]bq. Android (and EGLFS) supports only one top-level window.

                  Is it only for QML or QT (without QML) also supports only one top-level window?[/quote]

                  Not even that, it is Android platform itself ;-) So yes, both QtWidgets and QtQuick support only one top-level window on Android.

                  (Z(:^

                  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