Hi everyone,
I have a qml file that is loaded using a QDeclarativeView in a small main application.
The qml file uses a C++ class (call it MyClass) and in case of a click event calls a method from that class (say Q_INVOKABLE void MyClass::handleClick()).
From that method I would now like to access elements of the qml Gui. How is this possible? Is there something equivalent to what QObject::sender() does in Qt slots?
I know that I could emit a signal at the end of MyClass::handleClick() and connect that with a slot in the qml file to solve this but I'd rather have access to the qml file directly (at least to know how it's done).




 
					
					 
							
						 Access caller qml-Object from C++ Object
 Access caller qml-Object from C++ Object
		 
				
				
				
					 Reply With Quote
  Reply With Quote 
							
								
 
    
    
       
    
    
       
    
    
    
    
   
    
    
       
    
    
    
       
    
    
       
    
   Originally Posted by xdn
 Originally Posted by xdn
					

Bookmarks