Results 1 to 2 of 2

Thread: PyQt - QRegExp help

  1. #1
    Join Date
    Jun 2013
    Posts
    1
    Qt products
    Platforms
    Windows

    Default PyQt - QRegExp help

    Hi there,

    Very new to PyQt (and python) programming and trying to get an app going for my workplace. I keep trying to develop functionality that I don't yet have the skill/understanding to achieve yet. My program at the moment, is basically a notepad clone that will have some advanced features to common automate tasks for work built in. The gui has been constructed in QtDesigner if that means anything. Currently what I'd like to be able to do is parse what my user is entering into my QPlainTextEdit widget even while they are typing. It will need to constantly look for something in the format of A###### (alphabetic char followed by 6 numerals). Originally I was thinking of writing it so it will look up the current cursor position in the widget, then if the previous char was an alphabetic and the one before that a whitespace/none check if current char is numeral and so on so forth until it fits the format and has a whitespace typed at the end. But now that seems like a clumsy fix and I'm thinking there has to be a better way, will QRegExp help me out here? If so help please .

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: PyQt - QRegExp help

    yes, regex and qsyntaxhighlighter is probably a good place to start
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

Similar Threads

  1. Help on QRegExp
    By dmr in forum Qt Programming
    Replies: 2
    Last Post: 20th December 2012, 15:03
  2. Please help on QRegExp
    By lni in forum Qt Programming
    Replies: 6
    Last Post: 25th September 2011, 07:42
  3. Upgrading from PyQt 4.5 to PyQt 4.7
    By RogerCon in forum Installation and Deployment
    Replies: 0
    Last Post: 14th July 2010, 18:52
  4. QRegExp
    By szczav in forum Qt Programming
    Replies: 4
    Last Post: 19th June 2007, 20:07
  5. QRegExp Help
    By Ahmad in forum Qt Programming
    Replies: 2
    Last Post: 28th May 2007, 00: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.