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. Help for QString formatting
Forum Updated to NodeBB v4.3 + New Features

Help for QString formatting

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 332 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.
  • M Offline
    M Offline
    markolino_it
    wrote on last edited by markolino_it
    #1

    Hi to all, i've need help for string formatting.
    I'm writing some code to talk with SIM800C...and all works pretty well. But now i've need to send some sms to a list of people so i've need to change this fixed QString:

    QString comando= "at+cmgs=\"+3933345824\"\r";
    

    to some that can works with a list of users. So for example

    QString comando= "at+cmgs=\"myUsersList->at(myIntIndex)\"\r";
    

    But i've got some errors i think for the escape sequence or for the " and other symbols that i'v need...i am not an expert about this.
    Thanks a lot.

    eyllanescE 1 Reply Last reply
    0
    • M markolino_it

      Hi to all, i've need help for string formatting.
      I'm writing some code to talk with SIM800C...and all works pretty well. But now i've need to send some sms to a list of people so i've need to change this fixed QString:

      QString comando= "at+cmgs=\"+3933345824\"\r";
      

      to some that can works with a list of users. So for example

      QString comando= "at+cmgs=\"myUsersList->at(myIntIndex)\"\r";
      

      But i've got some errors i think for the escape sequence or for the " and other symbols that i'v need...i am not an expert about this.
      Thanks a lot.

      eyllanescE Offline
      eyllanescE Offline
      eyllanesc
      wrote on last edited by
      #2

      @markolino_it Use https://doc.qt.io/qt-5/qstring.html#arg

      If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

      M 1 Reply Last reply
      3
      • eyllanescE eyllanesc

        @markolino_it Use https://doc.qt.io/qt-5/qstring.html#arg

        M Offline
        M Offline
        markolino_it
        wrote on last edited by markolino_it
        #3

        @eyllanesc said in Help for QString formatting:

        @markolino_it Use https://doc.qt.io/qt-5/qstring.html#arg

        Thanks a lot.
        I share the solution :

        QString comando= QString("at+cmgs=\"%1\"\r").arg(myList->at(myIndex));
        

        I am not familiar with c++ thanks a lot !

        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