Results 1 to 20 of 37

Thread: Is there a widget for this?

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: Is there a widget for this?

    QSettings allow you to store some data and load it back next time the application is started. I don't know what you should write in QLineEdit subclass (I don't know if you even need to subclass QLineEdit), it depends what you want to do. Programming is something more than just taking ready components and connecting them together.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #2
    Join Date
    Jan 2011
    Posts
    128
    Thanks
    2

    Default Re: Is there a widget for this?

    I just need a method to make the lineedit save that text for every start up.
    You tell me how to do this.

  3. #3
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Is there a widget for this?

    You tell me how to do this.
    Read the QSettings documentation, everything is explained there (pay attention to setValue() / value() methods).

  4. #4
    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: Is there a widget for this?

    Quote Originally Posted by "BumbleBee" View Post
    I just need a method to make the lineedit save that text for every start up.
    You tell me how to do this.
    As far as I remember we've done that using QCompleter and QSettings and a bit of smart code that looked for all line edits in the form and tried to retrieve previous values for them from settings.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Jan 2011
    Posts
    128
    Thanks
    2

    Default Re: Is there a widget for this?

    Nah..completer doesn't help me with this.
    And although I read the qsetting doc. I can't really understand how I attach it to the lineedit..:/

    Any example code for my problem?
    Thanks

  6. #6
    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: Is there a widget for this?

    You don't attach QSettings to a line edit. I already told you, it's not always as easy as calling one method on an object passing it the other object. You need to implement everything you need on your own. I don't even know what you want to do since you said completer is not what you want.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Is there a widget for this?

    EDIT:- late

    you dont have to attach anything. Its just a simple transfer of data (QString) to and fro (QSettings to LineEdit).
    something like
    settings->setValue(lineEdit.text())
    lineEdit.setText(settings.value()).

  8. #8
    Join Date
    Jan 2011
    Posts
    128
    Thanks
    2

    Default Re: Is there a widget for this?

    Quote Originally Posted by nish View Post
    EDIT:- late

    you dont have to attach anything. Its just a simple transfer of data (QString) to and fro (QSettings to LineEdit).
    something like
    settings->setValue(lineEdit.text())
    lineEdit.setText(settings.value()).
    Added you on skype.Please approve me.

  9. #9
    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: Is there a widget for this?

    Quote Originally Posted by "BumbleBee" View Post
    Added you on skype.Please approve me.
    I wouldn't count on him doing that
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  10. #10
    Join Date
    Jan 2011
    Posts
    128
    Thanks
    2

    Default Re: Is there a widget for this?

    Why?
    Someone help me please....

  11. #11
    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: Is there a widget for this?

    Because you'll start bombarding him with requests to fix things for you. Currently it looks like you have totally no idea how to solve your problem. Moreover it looks like you are not willing to do any thinking yourself, you just want a ready solution.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 8
    Last Post: 28th June 2011, 14:57
  2. Replies: 1
    Last Post: 23rd June 2011, 23:09
  3. Replies: 1
    Last Post: 11th March 2011, 19:34
  4. Replies: 7
    Last Post: 14th January 2010, 08:47
  5. Replies: 4
    Last Post: 3rd March 2008, 22:15

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.