Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [Solved]What is the data type of list<string> on c++ site?

[Solved]What is the data type of list<string> on c++ site?

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 2 Posters 1.6k Views
  • 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.
  • S Offline
    S Offline
    stereomatching
    wrote on last edited by
    #1

    Want to do some postprocessing on the FileUrls of the FileDialog
    @
    FileDialog{
    id: fileDialog

        selectMultiple: true
        nameFilters: [ "Image files (*.bmp *.jpg *.JPEG *.png *.ppm *.tiff *.xbm *.xpm)" ]
        onAccepted: {            
                fileProcess.print_strs(fileDialog.fileUrls)               
        }
    }
    

    @

    The signature of cpp site
    @
    void fileProcess::print_strs(QList<QString> const &strs)
    {
    qDebug()<<"print strs";
    for(auto const &str: strs){
    qDebug()<<"print strs : "<<str;
    }
    }
    @

    QList do not map to the type of list in qml
    which type should I use?

    1 Reply Last reply
    0
    • R Offline
      R Offline
      raf924
      wrote on last edited by
      #2

      I'd say, fom the name of the variable that maybe it is not the QList that is the problem but maybe the QString. Have you tried QUrl?

      1 Reply Last reply
      0
      • S Offline
        S Offline
        stereomatching
        wrote on last edited by
        #3

        Thanks, looks like QUrl is the correct answer

        1 Reply Last reply
        0
        • S Offline
          S Offline
          stereomatching
          wrote on last edited by
          #4

          Whatever, the document of the FileDialog and FileDialog itself are mismatch.

          document
          @
          filePath : string
          filePaths : list<string>
          @

          But in Qt5.1RC, I have to use fileUrl or fileUrls to access the address of the files.Maybe this is because this is RC but not a formal release

          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