Alter virtual keyboard styles without editing Qt source
-
wrote on 22 Jul 2019, 19:26 last edited by
How might I go about altering the Qt virtualKeyboard styles without directly altering the source code? Is there an established method for doing this?
-
Hi,
What kind of alterations do you have in mind ?
-
wrote on 22 Jul 2019, 19:38 last edited by 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...
-
@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...
wrote on 23 Jul 2019, 14:09 last edited by CircuitsPerhaps 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"
-
The tild character won't work as it is expanded by the shell. Use the full path to the folder you want to use.
1/5