[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] Can't QLineEdit.isModified with QCompleter?
From: Ryan Hanson <crossrocker () gmail ! com>
Date: 2013-03-25 20:24:05
Message-ID: CAGHrRC7aKhkz_rptbCTAMEpb365a18a6qGr2JwvSMRHRtSvkHA () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
On Mon, Mar 25, 2013 at 3:05 PM, Baz Walter <bazwal@ftml.net> wrote:
> On 25/03/13 13:41, Ryan Hanson wrote:
>
> > I am writing a program to interact with a database and one of my pages I
> > allow the users to modify the values using QlineEdits. They when the user
> > saves I check isModified so I know which values to save. It works as
> > expected on most of the lines but a have one that uses a QCompleter and
> > isModified returns false if the user picks off the list.
> >
> > Is there a way around this? If not any suggestions on how I should check
> > if
> > the item has been modified?
> >
>
> The completer calls setText(), which will always reset the modification
> state to False.
>
> You could disable the save button by default, and then connect the
> textChanged signal of all the line-edits to a handler which re-enables the
> save button as appropriate.
>
> But it's also worth asking whether you *really* need to check whether each
> individual value has changed. Why not just save them all whenever the user
> chooses to save?
>
> --
> Regards
> Baz Walter
>
> ______________________________**_________________
> PyQt mailing list PyQt@riverbankcomputing.com
> http://www.riverbankcomputing.**com/mailman/listinfo/py<http://www.riverbankcomputing.com/mailman/listinfo/pyqt>
>
I enable saving after a line is modified but I have 5 lines that can be
modified, that is originally why I did the isModified check. I suppose I
don't really need to save individuals values. I will switch to saving the
whole record.
Thanks for clearing it up what it was doing for me.
[Attachment #5 (text/html)]
<div dir="ltr">On Mon, Mar 25, 2013 at 3:05 PM, Baz Walter <span dir="ltr"><<a \
href="mailto:bazwal@ftml.net" target="_blank">bazwal@ftml.net</a>></span> \
wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">
<div class="im">On 25/03/13 13:41, Ryan Hanson wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"> I am writing a program to interact with a database and one \
of my pages I<br> allow the users to modify the values using QlineEdits. They when \
the user<br> saves I check isModified so I know which values to save. It works as<br>
expected on most of the lines but a have one that uses a QCompleter and<br>
isModified returns false if the user picks off the list.<br>
<br>
Is there a way around this? If not any suggestions on how I should check if<br>
the item has been modified?<br>
</blockquote>
<br></div>
The completer calls setText(), which will always reset the modification state to \
False.<br> <br>
You could disable the save button by default, and then connect the textChanged signal \
of all the line-edits to a handler which re-enables the save button as \
appropriate.<br> <br>
But it's also worth asking whether you *really* need to check whether each \
individual value has changed. Why not just save them all whenever the user chooses to \
save?<span class="HOEnZb"><font color="#888888"><br> <br>
-- <br>
Regards<br>
Baz Walter<br>
<br>
______________________________<u></u>_________________<br>
PyQt mailing list <a href="mailto:PyQt@riverbankcomputing.com" \
target="_blank">PyQt@riverbankcomputing.com</a><br> <a \
href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" \
target="_blank">http://www.riverbankcomputing.<u></u>com/mailman/listinfo/py</a></font></span></blockquote><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">
</blockquote><div><br></div><div style>I enable saving after a line is modified but \
I have 5 lines that can be modified, that is originally why I did the isModified \
check. I suppose I don't really need to save individuals values. I will switch to \
saving the whole record. </div>
<div style><br></div><div style>Thanks for clearing it up what it was doing for \
me.</div></div><br></div></div>
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic