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.
  • stackprogramerS Offline
    stackprogramerS Offline
    stackprogramer
    wrote on 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
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on 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

      stackprogramerS 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

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

        Hope it helps

        stackprogramerS Offline
        stackprogramerS Offline
        stackprogramer
        wrote on last edited by stackprogramer
        #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
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on 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

          stackprogramerS 1 Reply Last reply
          1
          • SGaistS SGaist

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

            stackprogramerS Offline
            stackprogramerS Offline
            stackprogramer
            wrote on last edited by stackprogramer
            #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

            • Login

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