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. help in setting stylesheet for Links
QtWS25 Last Chance

help in setting stylesheet for Links

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 332 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.
  • M Offline
    M Offline
    mahd96
    wrote on last edited by mahd96
    #1

    i need to set theme in my app and i need a way to set "links" color in runtime.
    i am not allowed to use setPallete.

    1 Reply Last reply
    0
    • DiackneD Offline
      DiackneD Offline
      Diackne
      wrote on last edited by Diackne
      #2

      You can create a javascript file to import your themes in qml but this approach goes against logic of qml...

      import "myThemes.js" as Themes
      ...
      Item  {
      Component.onComplete: Themes.loadThemeFromNet("http://myServer.com/theme.x");
      
      Rectangle {
      color : Themes[Themes.theme].color
      

      myThemes.js

      var theme = "themeDefault"
      var themes =  { "themeDefault" : { "color": "red" }}
      
      function loadThemeFromNet( url) {
       ... 
      .. get file from net ..
      .. parce file .. 
      .. set object of theme from net in var themes ..
      apply ..
      theme = "newTheme" 
      
      }
      
      

      but this way is very bad ....

      if you want get to stylesheet from internet you need first get the file from internet and parce the file and transform in some logic to apply the style ... is one idea ..
      qml is more to local files and pre-compiled files ...

      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