QLineEdit CPU usage

  • Hi

    Any thoughts on QLineEdit causing higher CPU usage while user inputs?

    Also when it's read only, I am seeing paintEvent is getting called repeatedly..It should happen in case of NOT read only to show the cursor right? Any thoughts on optimizing QLineEdit for CPU would help...

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Without more information about how you are using your QLineEdit it will be difficult to tell. Are you using a mask ? a validator ? Got it connected to a slot that does some heavy processing etc. ?

  • Hi,

    There's no input mask/ validator set.
    Use case is while dialing digits in dialer input to dial phone no/Extn .

    Yes,its connected to slots which updates UI elements like softkeys etc. but doesn't seem to be time taking at least from logs...

  • One more info..on Phone (Linux) I've tried with built in QLineEdit (we'are using custom derived one) on phone..
    Rapid input causes 40% CPU usage ensuring only QLineEdit Rect is getting painted.. I tested this with QT_ FLUSH_PAINT

  • is it justifiable? Question for earlier post

  • Lifetime Qt Champion

    I find it surprising but since you are on a phone, what Qt version are you using ? What's the phone distribution ?

Log in to reply