Results 1 to 3 of 3

Thread: Some QSetting Questions and some more...

  1. #1
    Join Date
    Jan 2012
    Location
    Canary Islands, Spain
    Posts
    86
    Thanks
    4
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Some QSetting Questions and some more...

    hi, i have a question:
    there is any problem if i use QSettigns to write settings "on the fly"?
    i'd like to save a setting value whe the user change the text of a QLineEdit
    is this a bad practice or something?

    Question 2:
    What is better FOR PERFOMANCE, a lot of QWidget->setValue("Secction/Sub").toInt(); ( for example )
    or an "intelligent coded based/dynamic engine" like:
    ( with pseudocode )
    for (int x=0; x<MaxWidgets; x++) {
    QWidget->setValue( "Function that assigns section name using Widget name" ).toInt();
    }
    (same question for saving settings)

    another question, so i have not to open another thread:
    there is any way of making make a checkbox uncheckable, via QT Designer, if a radiobutton is not checked? ( its easy to do with code, but maybe there is a fastest way with QT Designer )

    Thanks for your time
    Last edited by aguayro; 13th March 2012 at 15:04.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Some QSetting Questions and some more...

    there is any problem if i use QSettigns to write settings "on the fly"?
    i'd like to save a setting value whe the user change the text of a QLineEdit
    is this a bad practice or something?
    In general QSettings is there to save persistent data - so its not a bad practice.
    However, if you need to save it very often, you might want to cache it first, and save only the last change before closing.

    Question 2:
    What is better FOR PERFOMANCE, a lot of QWidget->setValue("Secction/Sub").toInt(); ( for example )
    or an "intelligent coded based/dynamic engine" like:
    ( with pseudocode )
    for (int x=0; x<MaxWidgets; x++) {
    QWidget->setValue( "Function that assigns section name using Widget name" ).toInt();
    }
    (same question for saving settings)
    There is no measurable difference between the two approaches in terms of performance.
    Specially since you wont have thousands of lines setting the value.
    And if you need many such lines you can't avoid using a loop.

    another question, so i have not to open another thread:
    there is any way of making make a checkbox uncheckable, via QT Designer, if a radiobutton is not checked? ( its easy to do with code, but maybe there is a fastest way with QT Designer )
    You can connected the toggled() signal of the radio button to the setEnabled() slot of the check box in designer.
    For me personally however, in this case writing the code would be faster then doing it in designer.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Jan 2012
    Location
    Canary Islands, Spain
    Posts
    86
    Thanks
    4
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Some QSetting Questions and some more...

    thanks for the answers!!!, very helpful

Similar Threads

  1. Qwt 6.0.1 three times slower than 5.2.0
    By Spitfire in forum Qwt
    Replies: 13
    Last Post: 26th September 2011, 10:05
  2. Replies: 1
    Last Post: 14th January 2011, 11:57
  3. Replies: 3
    Last Post: 26th October 2009, 19:11
  4. how to calculate difference b/w two times
    By dummystories in forum Newbie
    Replies: 1
    Last Post: 9th March 2009, 13:58
  5. filterAcceptRows() is being called many times for same souceRow.
    By kaushal_gaurav in forum Qt Programming
    Replies: 2
    Last Post: 19th February 2009, 03:49

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.