Guest User

Untitled

a guest
Dec 15th, 2017
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. void MainWindow::button_clicked(Qstring a, Qstring b, Qstring c, Qstring d)
  2.  
  3. class MainWindow : public QMainWindow {
  4. Q_OBJECT
  5. public:
  6. ...
  7. Q_INVOKABLE void buttonClicked( const QString& a, const QString& b, const QString& c, const QString& d );
  8. ....
  9. };
  10.  
  11. void MainWindow::buttonClicked( const QString& a, const QString& b, const QString& c, const QString& d ) {
  12. ...do stuff
  13. update(); //example
  14. }
  15.  
  16. QDeclarativeView* view = ...your view
  17. view->rootContext()->setContextProperty( "_mainWindow", mainWindow );
  18.  
  19. _mainWindow.buttonClicked("foo", "bar", "c", "d")
Add Comment
Please, Sign In to add comment