Skip to content

fix: lesson part-1-qml/objects in section, missing id in code #6

Description

@GenarLoya

Hi, i want to say that this is a very useful guide to learn qml.

I found a little missing in lesson part-1-qml/objects in section Let's Improve It, missing id in code

import QtQuick
import QtQuick.Window

Window {
  width: 400
  height: 300
  visible: true
  title: "Interactive Objects"

  Rectangle {
    id: box
    x: 100; y: 80
    width: 200; height: 140
    color: "#4ecdc4"
    radius: 12

    Text {
      id: label
      text: "Click me!"
      anchors.centerIn: parent
      color: "white"
      font.pixelSize: 20
      font.bold: true
    }

    MouseArea {
      anchors.fill: parent
      onClicked: {
        box.color = "#ff6b6b"
        label.text = "Clicked!"
        clickTimer.start()
      }
    }

    Timer {
      id: clickTimer
      interval: 1000
      running: false
      onTriggered: {
        box.color = "#4ecdc4"
        label.text = "Click me!"
      }
    }
  }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions