Results 1 to 20 of 20

Thread: Assert problem in line edit

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Assert problem in line edit

    btw, I think you reg exp is not exaclty correct, try to use this one: \d+.
    Last edited by spirit; 27th July 2009 at 09:47. Reason: updated contents
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  2. #2
    Join Date
    Jul 2009
    Location
    Bangalore
    Posts
    68
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Assert problem in line edit

    I used QRegExp rx ( "(\\d+)" );

    even after that also i m get the message as

    Key Press EventATUM
    0: 0:123.000:456.000:789.000
    1: 1:321.000:654.000:987.000
    2: 2:963.000:852.000:741.000
    3: 3:357.000:214.000:698.000
    resulttemp=::::


    Please help me how to proceed further
    Thanks & Regards
    Sandeep G.R.

  3. #3
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Assert problem in line edit

    did you look at Qt Assistant, there is an example in QRegExp::search?
    Qt Code:
    1. QString str = "offsets: 1.23 .50 71.00 6.00";
    2. QRegExp rx( "\\d*\\.\\d+" ); // primitive floating point matching
    3. int count = 0;
    4. int pos = 0;
    5. while ( (pos = rx.search(str, pos)) != -1 ) {
    6. count++;
    7. pos += rx.matchedLength();
    8. }
    9. // pos will be 9, 14, 18 and finally 24; count will end up as 4
    To copy to clipboard, switch view to plain text mode 
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  4. #4
    Join Date
    Jul 2009
    Location
    Bangalore
    Posts
    68
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Assert problem in line edit

    Here i am not using fixed string,, even i went through the examples also.
    The format of the file is as below and user will be writing some more values into the file maximum is 99 points and simultaneously user need to read the values.

    Datum X Y Z
    0 123 456 789
    1 321 654 987
    2 345 243 809
    ......
    .....
    ...... and so on

    now i need to search for Datum number i.e., first column only then i need to read the corresponding line split the Datum, X, Y, Z values and store in 3 different variables.

    QRegExp rx ( "(\\d+)" );
    rx.search ( "Datumno_Val" );

    is my code is correct or not.
    Thanks & Regards
    Sandeep G.R.

  5. #5
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Assert problem in line edit

    if it doesn't work then it is not correct.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  6. #6
    Join Date
    Jul 2009
    Location
    Bangalore
    Posts
    68
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Assert problem in line edit

    Then how to proceed further is there any other method to perform this operation.
    Thanks & Regards
    Sandeep G.R.

Similar Threads

  1. Problem updating Line edit from a thread
    By raghvendramisra in forum Qt Programming
    Replies: 5
    Last Post: 3rd December 2007, 05:05
  2. Line Edit Controll problem
    By mansoorulhaq in forum Qt Programming
    Replies: 5
    Last Post: 31st October 2007, 08:33
  3. Replies: 8
    Last Post: 15th May 2007, 09:21
  4. QTableView paints too much
    By Jimmy2775 in forum Qt Programming
    Replies: 2
    Last Post: 26th July 2006, 18:42
  5. Signal problem in Qline Edit
    By awalesminfo in forum Newbie
    Replies: 1
    Last Post: 3rd April 2006, 09:13

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.