Gui Event Handler Exception : Illegal Escape Sequence

  • Hi,
    My application is on Red Hat Linux using QT4.6.3.
    I am using a QTreeView with thousands of rows(some times millions of rows are retrieved) with 10 columns of data. One of the columns use RegExps to convert the data from other column. I get the data from internal database.

    When i scroll the view up and down fast, I get below exception
    * Gui Event Handler
    Caught exception: 'Illegal escape sequence'*

    and cannot use the GUI anymore, as i repeatedly get the exception. If i press ok button of exception dialog another exception dialog with the same exception opens up as if in an infinite loop.
    I have to kill the application from shell.

    Please help me solve this problem
    Waiting for reply.

    Thanks & Regards,

  • Moderators

    please post the reg exp you use...

  • I am converting from one string to another using Regexp
    {a[([0-9]*)]} to {b[\1]}

  • Moderators

    use double-backslashes

  • The user can enter the regular expressions so wrong expressions can also be entered, in such cases i get the exceptions and then there is no way to ue the gui except to kill.
    So how to handle such illegal exceptions

  • Moderators

    Do you use QRegExp?
    you can try QRegExp::isValid() ... but doubt it will work.
    Since the user can enter the reg exp it's hardly possible, since when do you know that the user escaped a character on purpose or if you have to escape them for the user...

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.