pass two arguments into the c++ api from qml site
when I add & on the api, the app can not recognize the signature
of the function.

.hpp
Qt Code:
  1. #ifndef TESTPARAM_HPP
  2. #define TESTPARAM_HPP
  3.  
  4. #include <QList>
  5. #include <QObject>
  6. #include <QUrl>
  7.  
  8. class testParam : public QObject
  9. {
  10. Q_OBJECT
  11. public:
  12. explicit testParam(QObject *parent = 0);
  13.  
  14. signals:
  15.  
  16. public slots:
  17. void test(QList<QUrl> &first, QList<QUrl> &second)
  18. {
  19.  
  20. }
  21.  
  22. };
  23.  
  24. #endif // TESTPARAM_HPP
To copy to clipboard, switch view to plain text mode 


.cpp
Qt Code:
  1. #include "testParam.hpp"
  2.  
  3. testParam::testParam(QObject *parent) :
  4. QObject(parent)
  5. {
  6. }
To copy to clipboard, switch view to plain text mode 

main.qml

Qt Code:
  1. import QtQuick 2.1
  2. import QtQuick.Dialogs 1.0
  3.  
  4. import Test 1.0
  5.  
  6. Rectangle {
  7. width: 100
  8. height: 62
  9.  
  10. TestParam{
  11. id: testParam
  12. }
  13.  
  14. FileDialog{
  15. id: fileDialog
  16. //selectFolder: param.selectFolder
  17. selectMultiple: true
  18. nameFilters: [ "Image files (*.bmp *.jpg *.JPEG *.png *.ppm *.tiff *.xbm *.xpm)" ]
  19. onAccepted: {
  20. testParam.test(fileDialog.fileUrls, fileDialog.fileUrls);
  21. }
  22. }
  23.  
  24. MouseArea{
  25. anchors.fill: parent
  26.  
  27. onClicked: {
  28. fileDialog.open();
  29. }
  30. }
  31. }
To copy to clipboard, switch view to plain text mode 

error message

Error: Unknown method parameter type: QList<QUrl>&

They are fine if
1 : strip the &
2 : reduce the parameters of “test” to a single parameter, that way you can preserve the &

Anyway to pass the parameters as reference into the “test” with two parameters?