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. Difference between QML and UI
Forum Updated to NodeBB v4.3 + New Features

Difference between QML and UI

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 10.4k 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.
  • A Offline
    A Offline
    Adrian.Aioanei
    wrote on 1 Dec 2016, 19:58 last edited by
    #1

    Hey everyone,

    Please excuse my stupid questions but i am new with Qt and i don't understand how to use qml. It is possible to use qml and a file .ui in the same time? For example is possible to make a button in qml and after that to add the button to your .ui file?
    In exemple from the internet is used qml or .ui file. I have not find an example with both.

    Thank you in advice,
    Adrian

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 1 Dec 2016, 20:12 last edited by mrjj 12 Jan 2016, 20:27
      #2

      Hi
      No , you cannot insert a QML button directly.
      It must be shown in its own view
      http://doc.qt.io/qt-5/qquickview.html#details
      So you can have QML in an area inside your UI.
      You could make area as small as the button and somewhat get the effect..

      Note, that normally, you write all user interface in QML.
      Then for calculations or other heavy stuff , c++ is used as backbone.

      Can I ask why you want to use QML in UI.
      If you use the Qt Quick controls, then you also have full Designer etc so
      Im not sure why you want to do it the other way?

      You could use this book to get a overview
      https://qmlbook.github.io/

      1 Reply Last reply
      2
      • A Offline
        A Offline
        Adrian.Aioanei
        wrote on 2 Dec 2016, 07:17 last edited by
        #3

        Hi @mrjj

        I want to use QML because i can create nice controls. I have try to use Qt Quick controls but it can not customize very well my widgets. If i drag and drop a control from Qt Quick controls doesn't look very well. I don't have experience in creating UI so i thought it will be better to use QML.
        Thanks for the replay @mrjj .

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 2 Dec 2016, 08:13 last edited by
          #4

          Hi
          You are welcome.
          Well Qt Quick Controls 2 offer
          delegates to change the look of them.
          I think Qt Quick 1 Controls also offer styling too.
          QWidgets offer styling too.

          So there are many options. But it all depends on what you do
          when you "customize" them and what was lacking with Qt Quick for you.

          1 Reply Last reply
          2
          • A Offline
            A Offline
            Adrian.Aioanei
            wrote on 2 Dec 2016, 08:38 last edited by
            #5

            I don't think i will use delegates. I am trying to make a simple application and to customize same buttons, labels, tabs. I want something more then just change the background color and border. i have search on the internet after same example i didn't find nothing useful.
            For example i would like to make a tab and same buttons like here : link text

            M 1 Reply Last reply 2 Dec 2016, 08:47
            0
            • A Adrian.Aioanei
              2 Dec 2016, 08:38

              I don't think i will use delegates. I am trying to make a simple application and to customize same buttons, labels, tabs. I want something more then just change the background color and border. i have search on the internet after same example i didn't find nothing useful.
              For example i would like to make a tab and same buttons like here : link text

              M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 2 Dec 2016, 08:47 last edited by
              #6

              @Adrian.Aioanei
              Ok, well yes I guess using plain QML is the fastest way.

              QWidgets and stylesheets does go a long way though
              ![alt text](0_1480668376916_upload-a063862e-9e6c-49f3-bbc8-7cec8a193ebf image url)

              1 Reply Last reply
              1

              1/6

              1 Dec 2016, 19:58

              • Login

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