Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-11393

Qt Quick Controls style only shown if inside a component

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Out of scope
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • Qt Creator 3.0.0
    • None
    • Windows 7
      Qt 5.2.0 - MSVC 2010 (x86) - Angle
      Qt Creator 3.0.0

      If you set the style for a Qt Quick Control, say a button for example, this particular style can only be seen in Qt Quick Designer if it is inside another component. If you are viewing the component that directly contains the control it doesn't show correctly, it just shows a regular control without any styles associated to it.

      Example:

      ----- MyComponent.qml ------
      import QtQuick 2.0
      import QtQuick.Controls 1.1
      import QtQuick.Controls.Styles 1.1

      Button {
      x: 10
      y: 10
      width: 100
      height: 100
      style: ButtonStyle {
      background: Image

      {source: "mybutton.png"}

      }
      }

      ----- Main.qml ------
      import QtQuick 2.0

      MyComponent {
      x: 0
      y: 0
      }

      ----- end of example ------

      If you edit Main.qml in Qt Quick Designer you can view the Button with its style. However, if you edit MyComponent.qml you see a regular button without any style.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            bubke Marco Bubke
            theoribeiro Theo Ribeiro
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes