Results 1 to 6 of 6

Thread: Using vector's with QProcess

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2016
    Posts
    61
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Using vector's with QProcess

    Hi i am using QProces but everyone know that the path never is recorded. And like i'm learning about vector's i am trying to do one example with this.

    I was thinking to use this:
    First i put the path so with this new_path.cd(path); i change the path and with the follow code i return back with
    auto const path = paths.back();
    paths.pop_back();

    Or i change the path with cd Path so what do you think good idea?

    Code:

    Qt Code:
    1. //store the paths you iterate
    2. std::vector<QString> paths;
    3. paths.emplace_back("first path");
    4. paths.emplace_back("second path");
    5. if(input_path == "cd"){
    6. QDir new_path(paths.back());
    7. new_path.cd();
    8. paths.emplace_back(new_path.absolutePath());
    9. }
    10.  
    11. //back to previous path, stl split back and pop_back to two actions for the sake of exception safe
    12. auto const path = paths.back();
    13. paths.pop_back();
    To copy to clipboard, switch view to plain text mode 
    It's for learning more about vector's
    Last edited by SirJonas; 23rd October 2016 at 20:06.

Similar Threads

  1. Replies: 1
    Last Post: 3rd June 2013, 14:11
  2. Copying vector of pointers to another vector
    By Momergil in forum Newbie
    Replies: 12
    Last Post: 24th September 2011, 23:09
  3. vector of vector and computes
    By mickey in forum General Programming
    Replies: 1
    Last Post: 15th May 2008, 13:47
  4. insert in a vector of vector
    By mickey in forum General Programming
    Replies: 3
    Last Post: 6th March 2007, 09:45
  5. vector of vector size
    By mickey in forum General Programming
    Replies: 5
    Last Post: 13th February 2007, 16:59

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
  •  
Qt is a trademark of The Qt Company.