Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. for create style for qmlobject like Rectangle is possible we define css class?
Forum Updated to NodeBB v4.3 + New Features

for create style for qmlobject like Rectangle is possible we define css class?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
5 Posts 2 Posters 1.0k Views 2 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.
  • S Offline
    S Offline
    stackprogramer
    wrote on 10 Jan 2016, 21:17 last edited by
    #1

    hi,you have a idea that we define css class like :

    .info-rect{
    color:blue;
    
    font-point:12;
    }
    .warn-rect{
    color:red;
    font-point:8;
    }
    

    i want to define class in css and i use it in qml type;
    i.e.
    we want to have:

    Rectangle{id:myrect;
    class:info-rect;
    
    
    }
    

    do you have a solution?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 10 Jan 2016, 22:09 last edited by
      #2

      Hi,

      Styling of QML is not done through CSS, you have several possibilities explained here

      Hope it helps

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

      S 1 Reply Last reply 10 Jan 2016, 22:15
      0
      • S SGaist
        10 Jan 2016, 22:09

        Hi,

        Styling of QML is not done through CSS, you have several possibilities explained here

        Hope it helps

        S Offline
        S Offline
        stackprogramer
        wrote on 10 Jan 2016, 22:15 last edited by stackprogramer 1 Oct 2016, 22:19
        #3

        @SGaist said:

        Hi,

        Styling of QML is not done through CSS, you have several possibilities explained here

        Hope it helps

        thanks,i know this method,i wanted to finding a way for using power css in our qml apps.i liked using class in our style.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 10 Jan 2016, 22:20 last edited by
          #4

          One way would be to implement a styling C++ class that parses your style sheet and that you would use to style your app.

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

          S 1 Reply Last reply 10 Jan 2016, 22:23
          1
          • S SGaist
            10 Jan 2016, 22:20

            One way would be to implement a styling C++ class that parses your style sheet and that you would use to style your app.

            S Offline
            S Offline
            stackprogramer
            wrote on 10 Jan 2016, 22:23 last edited by stackprogramer 1 Oct 2016, 22:24
            #5

            @SGaist said:

            One way would be to implement a styling C++ class that parses your style sheet and that you would use to style your app.

            i will examine it,thanks

            1 Reply Last reply
            0

            1/5

            10 Jan 2016, 21:17

            • Login

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