Review Request 118744: Unselecting text in kexidbtextedit when focus is out

Jarosław Staniek staniek at kde.org
Sun Jun 15 00:13:48 BST 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/118744/#review60112
-----------------------------------------------------------


Thanks for wrestling with this more complex code. Proposed simplified solution.

Just a note: Related and remaining thing is that ultimately, for longer multiline texts, we'll want to have text cursor set at start whenever we reset selection or setting initial position to avoid scrolling to the bottom of large texts that potentially cannot fit in the box. In contrast, for single-line kexidblineedit it's not needed. However such improvement will require changes in the Form API itself so data widgets can get extra flag deciding how the cursor should be positioned on certain events (initial, focus-in).



kexi/plugins/forms/widgets/kexidbtextedit.h
<https://git.reviewboard.kde.org/r/118744/#comment41849>

    - use virtual explicitly to indicate polymorphism is used
    - *Event methods are typically protected so let's continue to use protected



kexi/plugins/forms/widgets/kexidbtextedit.cpp
<https://git.reviewboard.kde.org/r/118744/#comment41844>

    Coding style for '{' ?
    And we don't use "this->".



kexi/plugins/forms/widgets/kexidbtextedit.cpp
<https://git.reviewboard.kde.org/r/118744/#comment41847>

    It's enough to call moveCursorToEnd() here instead of changing text cursor. The text will be auto-unselected.



kexi/plugins/forms/widgets/kexidbtextedit.cpp
<https://git.reviewboard.kde.org/r/118744/#comment41845>

    setCursorWidth() not needed - only affects visual presence of cursor



kexi/plugins/forms/widgets/kexidbtextedit.cpp
<https://git.reviewboard.kde.org/r/118744/#comment41848>

    given the above changes, this method is not needed; moveCursorToEnd() will be called on focus-in, e.g. this is done KexiDBForm::eventFilter().



kexi/plugins/forms/widgets/kexidbtextedit.cpp
<https://git.reviewboard.kde.org/r/118744/#comment41846>

    not needed, note like above


- Jarosław Staniek


On June 14, 2014, 3:33 p.m., Wojciech Kosowicz wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/118744/
> -----------------------------------------------------------
> 
> (Updated June 14, 2014, 3:33 p.m.)
> 
> 
> Review request for Calligra, Adam Pigg and Jarosław Staniek.
> 
> 
> Bugs: 336054
>     http://bugs.kde.org/show_bug.cgi?id=336054
> 
> 
> Repository: calligra
> 
> 
> Description
> -------
> 
> QTextEdit does not provide deselect method therefore it had to be implemented by operating with the cursor. It required reimplementing focusOutEvent and focusInEvent in order to hide/show cursor.
> 
> 
> Diffs
> -----
> 
>   kexi/plugins/forms/widgets/kexidbtextedit.h b8e30df 
>   kexi/plugins/forms/widgets/kexidbtextedit.cpp eb0bb4e 
> 
> Diff: https://git.reviewboard.kde.org/r/118744/diff/
> 
> 
> Testing
> -------
> 
> In Kexi form multiple text editor elements can be added and when focus changes to another element, text in not used anymore text editor is not selected
> 
> 
> Thanks,
> 
> Wojciech Kosowicz
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20140614/2d3fc25e/attachment.htm>


More information about the calligra-devel mailing list