Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Differences between qputenv() and specifying env variables in kit
QtWS25 Last Chance

Differences between qputenv() and specifying env variables in kit

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 3 Posters 1.9k Views
  • 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.
  • C Offline
    C Offline
    Circuits
    wrote on last edited by aha_1980
    #1

    So in order to get the QTVK and my custom style for it working I had to put these two lines into main.cpp:

    qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard"));
    qputenv("QT_VIRTUALKEYBOARD_STYLE", "KeyboardStyle");
    

    now I want to pull them out of main.cpp and specify them in my kit so I set the base enviorment to "System Enviorment" and added:

    QT_IM_MODULE with a value of qtvirtualkeyboard
    and
    QT_VIRTUALKEYBOARD_STYLE with a value of KeyboardStyle

    however, this is not working; the keyboard still loads but my custom style is gone. What have I done incorrectly?

    Pablo J. RoginaP 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Did you do that in the Run part of the project panel ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      C 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Did you do that in the Run part of the project panel ?

        C Offline
        C Offline
        Circuits
        wrote on last edited by
        #3

        @sgaist Yeah I went too Run and under Run Environment I switched the base environment to System Environment, was that incorrect?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          I would have just added the two environment variables needed.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          C 1 Reply Last reply
          0
          • SGaistS SGaist

            I would have just added the two environment variables needed.

            C Offline
            C Offline
            Circuits
            wrote on last edited by
            #5

            @sgaist Isn't that what I did?

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              I may have misunderstood what you meant by "switched between the base environment to System Environment".

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              C 1 Reply Last reply
              0
              • SGaistS SGaist

                I may have misunderstood what you meant by "switched between the base environment to System Environment".

                C Offline
                C Offline
                Circuits
                wrote on last edited by
                #7

                @sgaist Oh well under Run Environment there is a drop down box that has these options:

                System Environment
                Build Environment
                Clean Environment

                Of the three I chose System Environment.

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Which version of Qt Creator are you using ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  C 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    Which version of Qt Creator are you using ?

                    C Offline
                    C Offline
                    Circuits
                    wrote on last edited by
                    #9

                    @sgaist I am not sure what I did... I am pretty darn sure I had already tried rebuilding the application but apparently not because I ran a full build and now it works fine... sorry for wasting your time.

                    1 Reply Last reply
                    0
                    • C Circuits

                      So in order to get the QTVK and my custom style for it working I had to put these two lines into main.cpp:

                      qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard"));
                      qputenv("QT_VIRTUALKEYBOARD_STYLE", "KeyboardStyle");
                      

                      now I want to pull them out of main.cpp and specify them in my kit so I set the base enviorment to "System Enviorment" and added:

                      QT_IM_MODULE with a value of qtvirtualkeyboard
                      and
                      QT_VIRTUALKEYBOARD_STYLE with a value of KeyboardStyle

                      however, this is not working; the keyboard still loads but my custom style is gone. What have I done incorrectly?

                      Pablo J. RoginaP Offline
                      Pablo J. RoginaP Offline
                      Pablo J. Rogina
                      wrote on last edited by
                      #10

                      @circuits said in Differences between qputenv() and specifying env variables in kit:

                      now I want to pull them out of main.cpp and specify them in my kit so I set the base enviorment to "System Enviorment"

                      Are you aware that by removing the code from main.cpp you'll need to setup such environment variables yourself if when running your application on its own

                      Upvote the answer(s) that helped you solve the issue
                      Use "Topic Tools" button to mark your post as Solved
                      Add screenshots via postimage.org
                      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                      1 Reply Last reply
                      1

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved