Python Forum
[PyQt] QLineEdit Caret (Text Cursor) Transparency
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] QLineEdit Caret (Text Cursor) Transparency
#4
Okaay... I've been reading (yesterday's troubleshooting involved glossing over) and it looks like in versions of Qt since at least 5.8 the text cursor is related to the background color (which my experience finds). It seems Qt inverts the cursor based on background color. So, a white background will give you a black cursor, black gives white, red gives blue, etc. setTextColor() is said not to change cursor color being it's tied to the background. The solution I found is a QPaintEvent. So, that's my findings.
Reply


Messages In This Thread
RE: QLineEdit Caret (Text Cursor) Transparency - by malonn - Nov-03-2022, 01:29 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to accept only float number in QLineEdit input ism 5 29,144 Jul-06-2021, 05:23 PM
Last Post: deanhystad
  Simple printing the text for a QLineEdit thewolf 16 8,454 Mar-06-2021, 11:37 PM
Last Post: deanhystad
  PyQt5: How to retrieve a QLineEdit by its name ? arbiel 4 8,220 Oct-21-2020, 02:35 PM
Last Post: arbiel
  Two QlineEdit box, which interrelated GMCobraz 1 2,520 Aug-14-2020, 07:15 PM
Last Post: deanhystad
  [PyQt] Dynamically add and remove QLineEdit's GMCobraz 3 7,355 Jun-23-2020, 07:01 PM
Last Post: Yoriz
  prompt for input in qlineedit GMCobraz 3 3,329 Jun-22-2020, 01:51 PM
Last Post: GMCobraz
  [PyQt] display content from left to right in QComboBox or QLineEdit mart79 2 2,419 May-30-2020, 04:38 PM
Last Post: Axel_Erfurt
  How to loop through all QLineEdit widgets on a form JayCee 6 6,920 Apr-03-2020, 12:15 AM
Last Post: JayCee
  [Tkinter] Finding out what's under the cursor sabresong 3 2,917 Mar-28-2020, 02:52 PM
Last Post: sabresong
  [PyQt] How to clear multiple Qlineedit in a loop mart79 6 8,015 Aug-15-2019, 02:37 PM
Last Post: Denni

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020