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. Alter virtual keyboard styles without editing Qt source
Forum Updated to NodeBB v4.3 + New Features

Alter virtual keyboard styles without editing Qt source

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 981 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.
  • C Offline
    C Offline
    Circuits
    wrote on last edited by
    #1

    How might I go about altering the Qt virtualKeyboard styles without directly altering the source code? Is there an established method for doing this?

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

      Hi,

      What kind of alterations do you have in mind ?

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

      1 Reply Last reply
      0
      • C Offline
        C Offline
        Circuits
        wrote on last edited by Circuits
        #3

        @SGaist
        To make the changes easier for you to visualize I have attached two images. One is the current virtual keyboard and the second is an alphanumeric keypad I created. I essentially need to alter the virtual keyboard to look like my alphanumeric keypad. It doesn't have to be exact but as close as I can get it without altering the layouts. For instance I wont need to change the enter symbol of the keyboard from the arrow or anything like that. I mean if I could make them look almost exact that would be great but I don't believe I can. Essentially, I would like to change the panel color and expand it's size s/t I can add in a title and a textbox to display what's being typed. I want to change the button color to a lighter gray and change the font to black. I would also like to alter the dimensions s/t the panel itself is shaped like my alphanumeric keypad panel, changes such as that.

        Essentially I want the QTVK's languages. I dont want to create a custom keyboard with 15 different layouts...

        0_1563824061651_virtualKeyboard.png

        0_1563824076573_keypad.png

        C 1 Reply Last reply
        0
        • C Circuits

          @SGaist
          To make the changes easier for you to visualize I have attached two images. One is the current virtual keyboard and the second is an alphanumeric keypad I created. I essentially need to alter the virtual keyboard to look like my alphanumeric keypad. It doesn't have to be exact but as close as I can get it without altering the layouts. For instance I wont need to change the enter symbol of the keyboard from the arrow or anything like that. I mean if I could make them look almost exact that would be great but I don't believe I can. Essentially, I would like to change the panel color and expand it's size s/t I can add in a title and a textbox to display what's being typed. I want to change the button color to a lighter gray and change the font to black. I would also like to alter the dimensions s/t the panel itself is shaped like my alphanumeric keypad panel, changes such as that.

          Essentially I want the QTVK's languages. I dont want to create a custom keyboard with 15 different layouts...

          0_1563824061651_virtualKeyboard.png

          0_1563824076573_keypad.png

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

          Perhaps there is some way I could pull the styles folder into my project? For instance, could I copy say the retro style and paste it into my project and then reference the folder that's inside the project instead of the one located @ src/virtualkeyboard/content? We don't want to have to alter Qt source code as this GUI application could be used on a different project or on a different platform. Which would mean that the change made here would have to be made there as well and potentially anywhere where Qt is being used.

          This does not seem to be working but I could be doing it wrong. I tried adding the retro style to one of my projects but I renamed it test and made the alterations as shown in the technical guide for adding a custom style. Then in main I tried referencing the new location:

          qputenv("QT_VIRTUALKEYBOARD_STYLE","qrc:/test");
          

          also tried:

          qputenv("QT_VIRTUALKEYBOARD_STYLE",":/test/");
          

          and

          qputenv("QT_VIRTUALKEYBOARD_STYLE","~/home/rob/untitled/test");
          

          however; each time I try it tells me that it cannot find the location:

          WARNING: Cannot find style "~/home/rob/untitled/test" - fallback: "default"
          
          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            The tild character won't work as it is expanded by the shell. Use the full path to the folder you want to use.

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

            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