[Qt-interest] declaring QString globally

Hong Jiang kmldqj at gmail.com
Tue Nov 3 04:34:24 CET 2009


This is a general design problem about the relationship between UI and
data, and doesn't really have much to do with Qt.
There is a fine introduction about model-view in the Qt documentation:
http://qt.nokia.com/doc/4.5/model-view-programming.html.
The Wikipedia article might help you too:
http://en.wikipedia.org/wiki/Model-view-controller

On Mon, Nov 2, 2009 at 3:49 PM, Mystical Groovy <mysticalgr at gmail.com> wrote:
> Im really sorry about the one after another replies of mine.
>
> I didnt actually understood the approach  Hong Jiang suggested,
> i tried to do something like a slot thing but didnt make it..
>
> I would like to explain to me the different approach you purpose the one
> that ill need to change my code because I realized that my little project,
> well.. its not that little anymore and i want the code to be easily readable
> and with a good order.
>
> Thank you for help and im deeply sorry about this little confusion ive
> created.
>
> 2009/11/3 Mystical Groovy <mysticalgr at gmail.com>
>>
>> Thank you very much for your replies.
>> jjDaNiMoTh the thing is that i want to check the string before storing it
>> into a setting value.
>>
>> Ill try the approce that Hong Jiang proposed.
>>
>> Thank you :)
>>
>> 2009/11/3 jjDaNiMoTh <jjdanimoth at gmail.com>
>>>
>>> 2009/11/2 Hong Jiang <kmldqj at gmail.com>:
>>> > You could create a repoTextChanged(const QString&) signal and connect
>>> > that to any object that needs to use the string. (I would change the
>>> > design. But it's a simple way to do what you want without much change
>>> > to your existing code.)
>>>
>>> Or, if the preferences needs to be stored and re-used every time that
>>> your user start the app, use QSettings ( prefDialog write values,
>>> other read).
>>>
>>> HTH
>>
>
>




More information about the Qt-interest-old mailing list