Results 1 to 3 of 3

Thread: How to change the text of QLineEdit while QTableWidget is being updating with data?

  1. #1
    Join Date
    May 2017
    Posts
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default How to change the text of QLineEdit while QTableWidget is being updating with data?

    I'm creating a Qt application in which there is a QTableWidget and a QLineEdit. The QTableWidget is updated by a thread with lots of data and it takes time.While the QTableWidget is being updated QLineEdit becomes disable, unfortunately. Means user cannot change the text in QLineEdit until the QTableWidgit is updated. So, my question is that, is there a way with which user can change the text while the QTableWidget is being updated.

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: How to change the text of QLineEdit while QTableWidget is being updating with dat

    Where is QLineEdit placed ?
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to change the text of QLineEdit while QTableWidget is being updating with dat

    First of all you cannot update QTableWidget with a thread. If you want threading then use QTableView and a custom model that will receive data in the worker thread and pass it to the GUI thread through a signal.

    If QLineEdit becomes "disabled" when the widget is updated then most likely it is not updated from within the thread but rather by the GUI thread.

    You can read this paper to learn about some approaches to do it without threads: https://doc.qt.io/archives/qq/qq27-responsive-guis.html
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 8
    Last Post: 16th July 2015, 20:44
  2. Replies: 2
    Last Post: 5th March 2013, 18:40
  3. QLineedit's text orientation change
    By vivek.panchal in forum Qt Programming
    Replies: 0
    Last Post: 4th March 2013, 14:56
  4. QLineEdit not updating as expected
    By Ishtar in forum Newbie
    Replies: 2
    Last Post: 28th April 2010, 13:09
  5. Change QTableWidget header name or text
    By ricardo in forum Qt Programming
    Replies: 3
    Last Post: 14th May 2009, 12:37

Tags for this Thread

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.