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. how to insert windows in a window ?

how to insert windows in a window ?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 405 Views
  • 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
    signalK
    wrote on last edited by signalK
    #1

    Hi,

    In this simple qml code creating and placing a window:

    mport QtQuick 2.9
    import QtQuick.Window 2.2

    Window {
    visible: true
    x:1200
    y:600
    color:"blue"
    width: 60
    height: 60
    title: qsTr("Hello World")
    }

    what should I add to create:
    1)inside, a new rectangular window?
    2)a colored circular button placed at a precise location (x, y) in this window ?
    3)a colored rectangular button placed at a precise place (x, y) in this window ?
    4)of text in this button or rectangular window ?

    thanks

    sierdzioS 1 Reply Last reply
    0
    • S signalK

      Hi,

      In this simple qml code creating and placing a window:

      mport QtQuick 2.9
      import QtQuick.Window 2.2

      Window {
      visible: true
      x:1200
      y:600
      color:"blue"
      width: 60
      height: 60
      title: qsTr("Hello World")
      }

      what should I add to create:
      1)inside, a new rectangular window?
      2)a colored circular button placed at a precise location (x, y) in this window ?
      3)a colored rectangular button placed at a precise place (x, y) in this window ?
      4)of text in this button or rectangular window ?

      thanks

      sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      @signalK said in how to insert windows in a window ?:

      1)inside, a new rectangular window?

      Please read the docs.

      2)a colored circular button placed at a precise location (x, y) in this window ?

      Either use RoundButton or Rectangle with radius and a MouseArea.

      3)a colored rectangular button placed at a precise place (x, y) in this window ?

      Either use Button or Rectangle and a MouseArea.

      4)of text in this button or rectangular window ?

      I don't understand this sentence.

      By the way, setting the UI up using hardcoded x, y coordinates is in most cases a bad idea. It is way better to use anchors or layouts.

      (Z(:^

      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