Results 1 to 3 of 3

Thread: QT string Find problem

  1. #1
    Join Date
    Aug 2006
    Location
    Germany
    Posts
    33
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default QT string Find problem

    Hallo,
    I used qstring find member to find a string.

    but it gives error " class QString has no member named :find "

    and I followed the qt documentation too.

    Here is the code.
    I included qstring.h

    Qt Code:
    1. if(line.find(QRegExp("DEF"),0) != -1 && line.find(QRegExp("Shape"),0) != -1)
    2. {
    3. line.remove(0,line.find(QRegExp("DEF"),0)+4);
    4.  
    5. if(line.mid(0,line.find(QRegExp("Shape"),0)-1).find(QRegExp("_"),0) != -1)
    6. {
    7. line.remove(line.find(QRegExp("_"),1);
    8. }
    9. }
    To copy to clipboard, switch view to plain text mode 

    looking forward for ur reply.

    thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT string Find problem

    Quote Originally Posted by kingslee View Post
    but it gives error " class QString has no member named :find "
    Well... your compiler is right --- in Qt4 QString doesn't have any method called "find" (unless you enable the Qt3 support module). Maybe you wanted to use QString::indexOf()?

  3. The following user says thank you to jacek for this useful post:

    kingslee (16th October 2006)

  4. #3
    Join Date
    Aug 2006
    Location
    Germany
    Posts
    33
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QT string Find problem

    thanks !
    its worked.
    I was breaking my head on this for long time ..
    In documentation also, they didnt mention it ..

    thank u

Similar Threads

  1. Replies: 7
    Last Post: 1st August 2006, 22:15
  2. QTimer problem ... it runs but never triggs
    By yellowmat in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 13:54
  3. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 13:45
  4. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 22:36
  5. Replies: 16
    Last Post: 7th March 2006, 16:57

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.