Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] QMap as a parameter
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] QMap as a parameter

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 6.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X Offline
    X Offline
    xeroblast
    wrote on last edited by
    #1

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

    @
    window::window()
    {
    QMap<QString, QString> data;
    window::callFunc(data);
    }

    window::callFunc(QMap data) // i get the error in this line
    {
    // process QMap here
    }
    @

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

    thanx..

    1 Reply Last reply
    0
    • X Offline
      X Offline
      xeroblast
      wrote on last edited by
      #2

      my bad...

      @
      window::callFunc(QMap<QString, QString> data) {

      }
      @

      im so stupid...

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Andreas
        wrote on last edited by
        #3

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

        @window::callFunc(const QMap<QString, QString> &data) {

        }@

        --
        Andreas

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved