qt


QML - Capture all UI events of children objects


In my QML project, I need an object to capture all the UI events of its children objects. So, if any of its children register a click or something, the parent object needs to know about it. The issue here is that all of the children objects are pre-defined classes such as MyButton or MyComboBox. These classes all have defined MouseAreas and onClicked() functions that can't be overridden. Therefore, I need the parent object to capture all the events of its children WITHOUT modifying the MouseAreas of the children. Please let me know the best way to accomplish this.
You can try to overlay your items with a MouseArea. In the event handlers you can check the position and call the event handlers of the underlying items.
Item {
MyButton { id: mybutton
/* set the anchors */
}
MyMouseComboBox { id: myMouseComboBox
/* set the anchors */
}
MouseArea {
anchros.fill: parent
onClicked: {
// mouse.accepted = false
// Check whether clicked point is within mybutton
// on true, call mybutton.doSomething()
// or call mybotton.onPressed(mouse)
}
}

Related Links

How to make punch hole in Qt Application
Qt 4.7 QColor constructor: possible bug?
How I can instruct a Qt Creator PRO file to output the *.o files and moc_* files in separate folder?
QTableView added in designer: not showing data
Autocomplete textbox in qt?
Cant Get Touch Inputs ın QPixMap(image) in QView
how to divide QGridLayout into rows and columns at Design Time in QT?
Display Monitors With More Than 256 Shades of Gray
Problem with QTcpSocket and sending binary data
Why does this code make the QImage lose its alpha channel?
Qt qspinbox editingFinished signal on value changed
what does native=“true” stand for in a Qt designer form
Qt Mac binary installs won't run on PowerPC/G5
Writing a cross platform GUI/service
PyQt - How to import .qss file?
How to get rid of wanring with adding qca into qt.

Categories

HOME
python-2.7
entity-framework
blast
selenium-builder
scroll
hid
code-formatting
hdfs
apk
google-sheets-query
openflow
tfs2015
azure-data-lake
jpa-criteria
spring-security-oauth2
amazon-emr
xbap
django-rq
mahout-recommender
uima
android-contacts
bazaar
android-custom-view
error-logging
dragula
uri
openbravo
jsonresult
intune
memory-fences
mongodb-3.4
rspec-rails
quickcheck
jslint
sbjson
suds
coverage.py
git-tfs
destroy
jenkins-slave
sony-future-lab-n
scala-breeze
sonicmq
android-webservice
predicates
nrf51
google-identity-toolkit
libharu
nclam
android-sdcard
sharepoint-apps
taco
univocity
django-validation
teensy
lovefield
search-form
mobilefirst-server
alwayson
whitespace-language
camus
htmltidy
maven-shade-plugin
sql-processor
iplimage
forio-contour
preorder
principalcontext
non-ascii-characters
node.js-stream
flv
unicoins
html-frames
donut-chart
reentrancy
simplecov
live-wallpaper
firebird1.5
type-safety
qtextbrowser
servercontrol
nsrangeexception
digiflow
activestate
icicles
self-tracking-entities
rtti
ning
webclient.uploaddata

Resources

Encrypt Message