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 create a colorful window border ?
Forum Updated to NodeBB v4.3 + New Features

how to create a colorful window border ?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 1.3k Views 1 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.
  • S Offline
    S Offline
    signalK
    wrote on last edited by
    #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 in Window to create:
    1)a window border of a certain thickness ?
    2)a colorful window border ?

    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 in Window to create:
      1)a window border of a certain thickness ?
      2)a colorful window border ?

      thanks

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

      @signalK said in how to create a colorful window border ?:

      1)a window border of a certain thickness ?
      2)a colorful window border ?

      Both these aspects are controlled by your window manager (your Operating System) and Qt has no influence over it. So, in short, it cannot be done (easily).

      There are, however, some ways to achieve this:

      • use windowFlags to disable the window border completely
      • then paint your own using a simple Rectangle QML element

      (Z(:^

      1 Reply Last reply
      2

      • Login

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