Results 1 to 20 of 25

Thread: Color a row - QSqlRelationalTableModel or QSqlQueryModel

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: Color a row - QSqlRelationalTableModel or QSqlQueryModel

    Quote Originally Posted by AKG View Post
    When the compiler sees == on a string, at the same time that we are evaluating the other values, what is all that happens ? and how expensive is that compared to for example the other suggestion where it is using the .isEmpty() ?? What is happening inside isEmpty() ?? is it more expensive or is there something to gain ?
    isEmpty() is almost certainly faster since the expected value is either a null string or a non-empty string.
    But that was one of my original points, wasn't it?

    In any case it really doesn't matter, only actually measured timing data does.

    The only thing that is always true is that things that are not executed are "faster" than things that are executed, so doing things that aren't necessary is always going to be more time consuming than not doing it in the first place.
    Which of course is also one of the initially pointed out issues.

    Cheers,
    _

  2. #2
    Join Date
    Sep 2016
    Posts
    12
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Color a row - QSqlRelationalTableModel or QSqlQueryModel

    The reason I was repeating this question, was to explain to the other poster jefftee what my question were actually about.

    I'm sorry that it sounded like i did not already get it, because you did point it out very well already, and I really appreciate your comment i previous posts. You already explained it very well, and I really appreciate your previous answers. Sorry for the repeated question. That was intended for the other poster to make him understand what my question was before. But it is already answered, you are absolutely correct about that.

    Thank you /

Similar Threads

  1. Replies: 3
    Last Post: 3rd February 2014, 17:04
  2. Replies: 0
    Last Post: 10th September 2013, 11:05
  3. Replies: 4
    Last Post: 8th September 2011, 08:22
  4. Replies: 3
    Last Post: 22nd January 2010, 16:46
  5. Display Label Color by selecting Color Picker
    By sosanjay in forum Qt Programming
    Replies: 1
    Last Post: 25th September 2009, 06:11

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.