Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9078935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:44:22+00:00 2026-06-16T19:44:22+00:00

I have a window containing multiple QRowWidget s, which are custom widgets defined by

  • 0

I have a window containing multiple QRowWidgets, which are custom widgets defined by me. These QRowWidgets contain QLineEdits and other standard widgets. To show or hide certain parts of a QRowWidget, I overdefined the focusInEvent() methodes of all the widgets within it. It works perfectly, when I click on the QRowWidget, the hidden elements appear.

The weird thing is that the blinking cursor line hovewer doesn’t appear in the QLineEdits within the custom widgets. I can select them both by a mouse click or with Tab, and a glow effect indicates that the QLineEdit is selected in it, I can select a text in it, or start typing at any location wherever I clicked, but the cursor never appears and it’s quite annoying.

My 1st thought was that it is a bug on Mac, but I have the same experience on SuSe Linux.

I’m using python 2.7 and PyQt4.

This is in the __init__() of the QRowWidget:

   for i in self.findChildren(QWidget):
        i.focusInEvent = self.focusInEvent

And then this is the own focusInEvent():

def focusInEvent(self, event):
    if self.pself.focusedLine:
        self.pself.focusedLine.setStyleSheet("color: #666;")
        self.pself.focusedLine.desc.hide()
        self.pself.focusedLine.closebutton.hide()
    self.setStyleSheet("color: #000;")
    self.desc.show()
    self.closebutton.show()
    self.pself.focusedLine = self
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T19:44:22+00:00Added an answer on June 16, 2026 at 7:44 pm

    I suspect you do not make a call to the original focusInEvent() when you override it. Your function should look something like:

     def focusInEvent(self,...):
         QParent.focusInEvent(self,...)
         # the rest of your code
    

    where QParent is the nearest base class for your widgets is.

    Either that, or make sure you call focusInEvent() on your QLineEdit widgets as part of your function.

    Given the comments, it sounds like you are dynamically reassigning the focusInEvent function on the insantiatations in your custom widget. I would either make a derived class for each of the widgets you use that just overrides focusInEvent as above, or include a line like

    type(self).focusInEvent(self,..)
    

    in you function.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a widget containing multiple child objects, which the user can select by
I have a php page, which launches a popup window containing a form with
I have a function which opens a new window containing the results of a
I have window containing multiple panels. I don't have access to window code. (I
I have a window containing three NSTextField s, like this: +------------------------+ | +--------------------+ |
I have a general question. I would like to have a window containing some
I have a ListView in a WPF window containing a number of GridViewColumns. The
I have main window which has inner grid components. When I press a button
I have a window containing an iframe (same origin), so scripts from this iframe
I have a (parent) window containing JQuery tabs: <div id=tabs> <ul class=tabHeader> <li><a href=?ctrl=doSomething

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.