Results 1 to 6 of 6

Thread: Creating variable name in Qt by a for loop and finding numbers in a QString object

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2015
    Posts
    128
    Thanks
    70
    Qt products
    Qt5
    Platforms
    Windows

    Default Creating variable name in Qt by a for loop and finding numbers in a QString object

    Hi
    I have some questions about QString.

    1- I want to create a variable name (QString type) in a for loop. how can i do this. like this:
    Qt Code:
    1. QString name[15];
    2. for(int i=0; i<10; ++i)
    3. name(i) = "name i" //I need "i" in the "name i" be effected
    To copy to clipboard, switch view to plain text mode 

    2- In a QString like str (str is a type of QString), I want to find numbers. is there any function that search number in a QString? for example:

    Qt Code:
    1. QString str;
    2. str="Hi4Hello78good5"
    3. str.isThereSearchNumberFunction(); // I need this returns 4,7,8,5
    To copy to clipboard, switch view to plain text mode 

    Thanks for any help.
    Last edited by Alex22; 4th December 2015 at 20:41.

Similar Threads

  1. Variable variable names
    By KeineAhnung in forum Newbie
    Replies: 2
    Last Post: 22nd June 2014, 19:00
  2. For loop and While loop handling.
    By kiboi in forum Newbie
    Replies: 7
    Last Post: 2nd January 2013, 13:43
  3. Replies: 4
    Last Post: 6th August 2011, 01:40
  4. Main loop thread loop communication
    By mcsahin in forum Qt Programming
    Replies: 7
    Last Post: 25th January 2011, 16:31
  5. Creating QFile Objects in a loop
    By sky in forum Newbie
    Replies: 1
    Last Post: 3rd December 2010, 08:27

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.