Skip to content
  • 0 Votes
    8 Posts
    4k Views
    Stefan Monov76S

    @Roumed: Thanks, the childItems suggestion sounds good, I'll implement it as it's more semantically correct. But for now I'll combine it with the isFoo workaround described here, because I'm not sure if Qt won't decide to insert visual children in my item if I change something in the future. Just like I didn't expect it would insert nonvisual children.

  • 0 Votes
    8 Posts
    6k Views
    JKSHJ

    @Bart_Vandewoestyne said:

    Could my educated guess be correct?

    Your guess sounds reasonable to me.

    Does anybody have any idea why the original author of this code decided to make a difference between linux and non-linux? If I remove the ifdef and simply use close() in all situations, things seem to work, although it seems that in this case the ClientSslSocket destructor is no longer called (and I'm not sure if this is a good thing...).

    Nope, sorry. Are there any comments in the code, or in the commit history? Could you ask the author directly?

    What would be the clean solution here? How should FooBar's destructor look like?

    It's hard to say without knowing how the rest of the program is designed. Maybe you can manually disconnect the socket before deleting it?

  • 0 Votes
    4 Posts
    18k Views
    B

    In the meanwhile, I have code for #3 too, see https://github.com/BartVandewoestyne/Qt/tree/master/tests/qobject_cast_test I'm sure it can be improved and made more elegant (see e.g. the TODO in the file). Comments, suggestions or pull requests are definitely still welcome!

    When I run this program on my computer, it shows me that qobject_cast is about 6 to 13 times faster than dynamic_cast.

  • 0 Votes
    1 Posts
    680 Views
    No one has replied