Results 1 to 11 of 11

Thread: how to specify variable file name?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2011
    Posts
    160
    Thanks
    31
    Qt products
    Qt4
    Platforms
    Windows

    Default how to specify variable file name?

    hello everyone....
    i'm opening a file as shown below....
    how can I specify variable file name......different time, user may give different file name.....
    When i'm trying to change the following format, i got error....
    Please help me

    Qt Code:
    1. QFile file(":/input.txt");
    2.  
    3. if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
    4. return;
    5. ui->label_4->setText("FILE NAME:"+filename);
    6. while (!file.atEnd())
    7. {
    8.  
    9. //DOING REST OPERATION...
    10. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by wysota; 11th October 2011 at 10:00. Reason: missing [code] tags

Similar Threads

  1. Updating variable
    By felo188 in forum Qt Programming
    Replies: 3
    Last Post: 16th August 2011, 16:55
  2. A variable in setTable()
    By thefatladysingsopera in forum Newbie
    Replies: 6
    Last Post: 2nd August 2011, 08:37
  3. variable
    By Atuti2009 in forum Qt Programming
    Replies: 8
    Last Post: 18th November 2009, 09:04
  4. Entering variable in db
    By subratatamal in forum Qt Programming
    Replies: 1
    Last Post: 13th December 2008, 17:50
  5. pro-file's INSTALLS variable and make uninstall
    By roxton in forum Qt Programming
    Replies: 1
    Last Post: 4th July 2008, 09:16

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.