Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Qt Academy Launch in California!

    Qt4 dialog style set to default after UWP conversion

    General and Desktop
    2
    13
    2987
    Loading More Posts
    • 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.
    • S
      Stak1945 last edited by

      Hi mrjj,
      Thanks for your reply.

      I tried the qDebug() and here is the result:
      Win32:
      Win32
      UWP:
      UWP
      Does it mean Win10 UWP Environment is a specialized unsupported version?

      The custom style works fine in our application in UWP environment, like this:
      Custom Style
      I didn't try the "qtwidgets-painting-affine-example" cause we are using Qt4 and don't have a Qt5 environment at hand. Thought the application screen short might be suffice to clear the point. So the Qt style is still working.

      What can I infer from the debug message? What further investigation can I take?
      Thank you.

      mrjj 1 Reply Last reply Reply Quote 0
      • mrjj
        mrjj Lifetime Qt Champion @Stak1945 last edited by

        @Stak1945
        HI
        Sadly the forum eats the pictures so i cannot see them. ( you can )
        Could you please upload to say postimage.org and post the links here.

        1 Reply Last reply Reply Quote 0
        • S
          Stak1945 last edited by

          Hi mrjj,

          Here are the pictures.
          Win32 Debug:
          Win32Debug
          UWP Debug:
          UWP Debug
          Custom Style of Our Application in UWP Environment:
          Custom Style of Our Application in UWP Environment

          Thank you:)

          mrjj 1 Reply Last reply Reply Quote 0
          • mrjj
            mrjj Lifetime Qt Champion @Stak1945 last edited by

            @Stak1945
            Thank you.
            Are they ment to be so small? ( even when clicked)

            1 Reply Last reply Reply Quote 0
            • mrjj
              mrjj Lifetime Qt Champion last edited by

              Hi
              I don't know enough about modern apps and UWP to guess at this
              but it seems to me that Qt4 seems to think its run in good old win32 and as far as
              I understand what the converter does
              then its running inside a legacy "wrapper"
              So I would go and play with QStyle
              http://doc.qt.io/qt-4.8/qstyle.html
              and see if it changes anything.

              Did you try a normal application ? does it also change look when converted ?

              1 Reply Last reply Reply Quote 0
              • S
                Stak1945 last edited by

                Strange. Didn't mean to be small. Sorry for that.
                The debug message in Win32 is

                "Windows WindowsXP WindowsVista Motif CDE Plastique Cleanlooks".
                

                The debug message in UWP is

                Qt: Untested Windows version 10.0 detected!
                "Windows Motif CDE Plastique Cleanlooks"
                

                What do you mean by normal application?
                Our application is kind of big with probably hundred of dialogs in it, it there a way to fix them all in one place?

                Thank you.

                mrjj 1 Reply Last reply Reply Quote 0
                • mrjj
                  mrjj Lifetime Qt Champion @Stak1945 last edited by

                  @Stak1945
                  Hi, np.

                  Ok so it seems related to Qt4 not knowing win 8+ and never seen the UWP
                  runtime environment.

                  • What do you mean by normal application?
                    As far as I understand, you can convert a desktop app to run in the modern runtime.
                    So I was wondering if you took a non Qt app and converted it and ran it , if it
                    would change the look too.

                  • Our application is kind of big with probably hundred of dialogs in it, it there a way to fix them all in one place?

                  if you set the QStyle then it will apply to all.
                  QApplication::setStyle();

                  Also, you can do
                  ./myapplication -style motif
                  but not sure its possible in UWP

                  So it seems that Qt4 is too old for the "modern" runtime and only style available
                  is "Windows" which might look like what u see.

                  I dont know what the fix is. :(

                  1 Reply Last reply Reply Quote 0
                  • S
                    Stak1945 last edited by Stak1945

                    @mrjj
                    Hi mrjj,

                    My colleague has figured out how to fix this:D
                    As it concerns with not recognizing Windows Version, adding corresponding windows version number to corelib/global/qglobal.h and .cpp fixed this issue.

                    Add Win10 support in enum WinVersion, enum MacVersion of qglobal.h and QSysInfo::windowsVersion() of qglobal.cpp.

                    Thanks for your help:)

                    mrjj 1 Reply Last reply Reply Quote 2
                    • mrjj
                      mrjj Lifetime Qt Champion @Stak1945 last edited by

                      @Stak1945
                      Super.
                      So app was confused what windows a modern universal app wrapper was actually running in :)
                      Thank you for reporting back. It will come up again :)

                      Oh, can I ask why Q4.8 ?
                      You already tons of code and porting it to Qt5.X is simply not
                      an option ? :)

                      1 Reply Last reply Reply Quote 0
                      • S
                        Stak1945 last edited by

                        @mrjj
                        Why Qt4? :)
                        It's because our application is 28 years old and during the latest refactoring about 5 or 4 years ago we introduced Qt4, really tons of code intertwined with customized Qt4 library. Porting to Qt5 may concern so much code to change and features to test so the plan has been postponed.
                        Guess a change to Qt5 will have to wait for another refactoring :D

                        1 Reply Last reply Reply Quote 1
                        • mrjj
                          mrjj Lifetime Qt Champion last edited by

                          Ah, yes. in 28 years, one can get quite the amount of code. :)
                          Well Qt4.8 should be good for years and besides you just ran it
                          in something really new and it worked. \o/

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post