Results 1 to 2 of 2

Thread: Sprintf in QT ?

  1. #1
    Join Date
    Apr 2012
    Posts
    7
    Qt products
    Qt/Embedded
    Platforms
    MacOS X Unix/X11

    Default Sprintf in QT ?

    i need to port some code to qt but i dont find the way to use sprinft yet ... my idea is open a specific .jpg file using a readed str value

    this ...

    FILE *openingjpg;

    char jpgname[256];
    sprintf ( jpgname, "/mytempfolder/%s/%s.jpg",str,str);

    printf("EL NOMBRE DEL JPG PARA ABRIR ES : %s \n\n",jpgname);

    openingjpg=fopen(jpgname,"ab");


    anyone give me a help ?
    thanks in advance

  2. #2
    Join Date
    Apr 2012
    Posts
    14
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Sprintf in QT ?

    Qt Code:
    1. QString jpgname(QString("/mytempfolder/%1/%1.jpg").arg(str));
    To copy to clipboard, switch view to plain text mode 
    Last edited by AlekseyOk; 28th April 2012 at 12:41.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.