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. Problem with BrightnessContrast QML Type

Problem with BrightnessContrast QML Type

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 1 Posters 659 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.
  • CzarekC Offline
    CzarekC Offline
    Czarek
    wrote on last edited by
    #1

    Hello,
    I would like to implement something which lets user of my program to change brightness and contrast. I tried BrightnessContrast QML Type, but it "covers" places with mouseAreas making them useless. My tree:

    • Item
      • MainScreen (rect)
      • RowLayout
        • Buttons
          • mouseAreas
      • BrightnessContrast

    When I gave RowLayout bigger z coordinate than BrightnessContrast, buttons were visible but mouseAreas were unable. I tried to put mouseAreas outside RowLayout - I made mouseAreas and BrightnessContrast siblings. Then I tried to manipulate with z coordinate, but mouseAreas are still useless. Could you tell me, why mouseAreas are unable to use? Maybe you have better idea how can I reach what I scheduled? Please help.

    1 Reply Last reply
    0
    • CzarekC Offline
      CzarekC Offline
      Czarek
      wrote on last edited by
      #2
      import QtQuick 2.4
      import QtQuick.Controls 1.4
      import QtQuick.Layouts 1.1
      import QtQuick.Extras 1.4
      import QtQuick.Window 2.2
      import QtQuick.Controls.Styles 1.4
      import QtGraphicalEffects 1.0
      
      Item {
          width: 640
          height: 480
          id: item
      
          property alias text1: text1
          property alias mouseArea1: mouseArea1
          property alias mouseArea2: mouseArea2
      
          Rectangle {
              id: okno_glowne
              color: "#bb8a63"
              anchors.fill: parent
      
              Text {
      
                  id: text1
                  x: 499
                  y: 193
                  width: 65
                  height: 42
                  font.pixelSize: 33
                  text: "pampam"
              }
          }
      
          states: [
              State {
                  name: "drugi_ekran"
                  PropertyChanges { target: okno_glowne; visible: false  }
      
                  PropertyChanges {
                      target: drugie_okno
                      x: 163
                      y: 75
                      opacity: 1
                  }
              }
          ]
      
          Rectangle {
              id: drugie_okno
              color: "#bb8a63"
              anchors.fill: parent
              opacity: 0
          }
      
          RowLayout {
              id: rowLayout1
              x: 170
              y: 322
              z:3
              width: 300
              height: 150
      
              Button {
                  id: button1
                  text: qsTr("Button")
                  anchors.rightMargin: 150
                  anchors.fill: parent
                  width: 150
                  height: 150
                  z:3
      
                  MouseArea {
                      id: mouseArea1
                      x: 0
                      y: 0
                      z:3
                      anchors.fill: parent
      
                      width: 150
                      height: 150
                      enabled: true
                      visible: true
      
                  }
      
              }
      
              Button {
                  id: button2
                  text: qsTr("Button")
                  anchors.leftMargin: 150
                  anchors.fill: parent
                  width: 150
                  height: 150
                  z:3
      
                  MouseArea {
                      id: mouseArea2
                      x: 0
                      y: 0
                      z:3
      
                      anchors.fill: parent
                      width: 150
                      height: 150
                      enabled: true
                      visible: true
                  }            
              }        
          }
      
          BrightnessContrast {
              id: asd        
      
              anchors.fill: okno_glowne
              source: okno_glowne
              brightness: -0.6
              contrast: -0.6
              z:0
          }
      }
      

      Do You see any mistakes in the code?

      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