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

OpenCV libQtCore.so.4 DSO missing
Interfacing SystemC events and Qt events
Correctly resize QImage in QPdfWriter after setting the resolution
How to add QSerialPort library in QT4.8.7
Memory Leak in libfontconfig.so.1.4.4 with Qt 4.7.3
How can I specify user customized variables in a QT project?
Drawer overlapping button QML
How to make a PySide Window pop up above all other windows
Embedding QCustomPlot In ScrollArea
Alignment of nested QFormLayout
How to recover QNetworkAccessManager
QSqlRecords inserted into model are empty/blank in QTableView
Event Filter for QCustomPlot
Qt using parametre of the signal [duplicate]
Dynamic font size in QTextEdit
Yocto / Qt 5.6 - QSqlDatabase: QSQLITE driver not loaded

Categories

HOME
class
mpdf
yaml
openxml
livecode
systemd
informatica
google-webmaster-tools
liferay-7
tweepy
responsive-design
fasm
match
watch-os-3
nsstring
erd
jquery-select2-4
sonata
tomcat8
scala-ide
home
bsd
kamailio
stackexchange.redis
sybase-ase
django-import-export
mdns
credit-card
delayed-job
series
om-next
kendo-listview
autoencoder
busboy
cups
des
netstat
ftp-server
django-crispy-forms
django-smart-selects
cheat-engine
latexml
apache-toree
oracle-bmcs
linq-to-excel
roracle
md5-file
openstack-glance
maven-jaxb2-plugin
skip-lists
mifos
google-identity-toolkit
p6spy
gcloud-node
groovyfx
static-methods
yii2-model
apple-configurator
okta-api
teensy
chicagoboss
auto-generate
featuretoggle
fantom
physicsjs
findersync
image-rotation
object-code
quantify
aho-corasick
full-text-indexing
iirf
virtual-channel
libxml-js
google-code-prettify
ax
sunstudio
web-frameworks
oscilloscope
user-forums
gwt-celltable
background-repeat
digiflow
pyjamas
git-log
gaelyk
ninject-interception
uninstaller
reliability
raw-data
.net-services
autobench
objectinstantiation

Resources

Encrypt Message