Results 1 to 9 of 9

Thread: Cursor not visible

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Cursor not visible

    Quote Originally Posted by jpujolf View Post
    While user enters the date, this validate method tests & corrects user input. But when he presses ENTER or TAB key, even if the date is a valid one, Business Logic may decide it's not a valid date ( i.e a day before today for a payment )
    Not really. You can fetch the "possible valid" state from the logic and cache it somehow and use an intermediate state when you suspect the input to be incomplete.

    And here becomes the problem. I cannot assume a call to Business Logic EVERY time a date is Acceptable, because that call could be very time-expensive.
    I think I just answered that as well


    OK, I accept perhaps is an "strange approach", but is working. And it's quick and efficient. Sometimes we must break "programming-guidelines" to obtain a better performance...
    What happens if you just keep pressing tab (possibly inside an invalid field)?

    And I repeat that the problem is not in the validation style but in the fact that everything is working OK, but the cursor dissapears when between the focusout and the focusin I show a message on an external StatusBar. But when i show a modal message, all is running OK
    As I said in the previous post, you're manipulating with the focus too much. Remember that focusOut causes a focusIn elsewhere and then you force the focus back which again causes a focusOut and focusIn. What does your focusOutEvent look like anyway?


    But you will agree with me that I will have the same problem. When I emit the signal, I receive a "invalid" response and move the focus, "I'm fuc***"
    Sure, but this is easily overcomable. Check if calling selectAll() on the line edit helps.

    I agree with you that StatusBar is stealing the focus, But I don't understand why...

    I'm calling a method like this in the focusout event ( pseudo-code )
    I think you should just reject the focus out event.

    Yes, a QlineEdit. But not a QComboBox, or QRadioButton... And I do need to control that kind of widgets too
    Maybe you should just use a QDataWidgetMapper? Most of the things you require are already there, I think... Anyway, you can repair the tab order with a simple function, as I mentioned before.

  2. #2
    Join Date
    Jul 2006
    Location
    Catalunya - Spain
    Posts
    117
    Thanks
    16
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Cursor not visible

    Quote Originally Posted by wysota View Post
    As I said in the previous post, you're manipulating with the focus too much. Remember that focusOut causes a focusIn elsewhere and then you force the focus back which again causes a focusOut and focusIn. What does your focusOutEvent look like anyway?
    Just calls my form's FieldExit method...

    Sure, but this is easily overcomable. Check if calling selectAll() on the line edit helps.
    I'm doing it... And it doesn't helps me...

    I think you should just reject the focus out event.
    You mean calling QEvent::ignore () ? Is the only test I've not done...

    Maybe you should just use a QDataWidgetMapper? Most of the things you require are already there, I think...
    QDataWidgetMapper could be a solution if I was using it against a model. Is not the case...

    Anyway, thanks for wasting your time answering me. You helped me a lot !!

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

    Default Re: Cursor not visible

    Quote Originally Posted by jpujolf View Post
    Just calls my form's FieldExit method...
    I don't think that's enough.

    I'm doing it... And it doesn't helps me...
    Then probably the widget doesn't have focus after all...


    You mean calling QEvent::ignore () ? Is the only test I've not done...
    Yes.

    QDataWidgetMapper could be a solution if I was using it against a model. Is not the case...
    So it's only a matter of implementing a model It has all you need including the validation inside QAbstractItemModel::setData()
    Anyway, thanks for wasting your time answering me. You helped me a lot !!
    If I felt like wasting my time, I wouldn't be here.

  4. The following user says thank you to wysota for this useful post:

    jpujolf (14th May 2007)

Similar Threads

  1. Make the cursor visible in textEdit (Qt3.3.5)
    By vermarajeev in forum Qt Programming
    Replies: 9
    Last Post: 24th January 2007, 22:50
  2. VS Integration plugins not visible
    By kemp in forum Qt Tools
    Replies: 1
    Last Post: 11th August 2006, 22:22
  3. visible text of textedit
    By regix in forum Qt Programming
    Replies: 3
    Last Post: 26th June 2006, 09:02
  4. hidden QListView column suddenly visible
    By edb in forum Qt Programming
    Replies: 10
    Last Post: 27th January 2006, 08:00
  5. How do I find out which widgets/canvas items are visible?
    By Tommytrojan in forum Qt Programming
    Replies: 11
    Last Post: 6th January 2006, 13:22

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
  •  
Qt is a trademark of The Qt Company.