December 21, 2010

xeroblast xeroblast
Lab Rat
91 posts

[SOLVED] QMap as a parameter

 

how do i pass a qmap variable? i get an error —- error: ‘QMap’ is not a type

  1. window::window()
  2. {
  3.  QMap<QString, QString> data;
  4.  window::callFunc(data);
  5. }
  6.  
  7. window::callFunc(QMap data) // i get the error in this line
  8. {
  9.   // process QMap here
  10. }

or there is another way to pass an array that needs keys & values (data[‘string’] = ‘string’)

thanx..

2 replies

December 21, 2010

xeroblast xeroblast
Lab Rat
91 posts

my bad…

  1. window::callFunc(QMap<QString, QString> data) {
  2.  
  3. }

im so stupid…

December 21, 2010

Andreas B. Andreas B.
Lab Rat
6 posts

Even Qmap and QString are implicit shared pass it by const reference:

  1. window::callFunc(const QMap<QString, QString> &data) {
  2.  
  3. }

 Signature 


Andreas

 
  ‹‹ Deploying Phonon on Windows XP      QXmlSchemaValidator trouble with size of xml input. ››

You must log in to post a reply. Not a member yet? Register here!