Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void MainWindow::button_clicked(Qstring a, Qstring b, Qstring c, Qstring d)
- class MainWindow : public QMainWindow {
- Q_OBJECT
- public:
- ...
- Q_INVOKABLE void buttonClicked( const QString& a, const QString& b, const QString& c, const QString& d );
- ....
- };
- void MainWindow::buttonClicked( const QString& a, const QString& b, const QString& c, const QString& d ) {
- ...do stuff
- update(); //example
- }
- QDeclarativeView* view = ...your view
- view->rootContext()->setContextProperty( "_mainWindow", mainWindow );
- _mainWindow.buttonClicked("foo", "bar", "c", "d")
Add Comment
Please, Sign In to add comment