Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Bug free programming with Qt:
Forum Updated to NodeBB v4.3 + New Features

Bug free programming with Qt:

Scheduled Pinned Locked Moved General and Desktop
21 Posts 8 Posters 11.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    ivan
    wrote on last edited by
    #7

    While Qt is an excellent piece of software, and one of the most pleasant frameworks I've ever fell in love with, it has a fair share of bugs.

    Ivan Čukić | ivan.cukic(at)kde.org | KDE e.V.
    Qt Ambassador (from the old Nokia days)

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #8

      I agree: Qt is good, but it not perfect and not nearly bug-free. It does however in most parts provide two IMHO very basic ingredients for making low-bug code:

      It has a clear API (in part thanks to the guidelines Volker linked to) that makes it easy to use right, and hard to use wrong. That may sound trivial, but it is not. A good API encourages using it in such a way that it is hard to go wrong.

      It has generally very good documentation. Good API documentation helps a lot. I frequently stumble on interesting looking libs or code, only to find the majority of the methods and classes are not or hardly documented. That makes using them a PITA.

      1 Reply Last reply
      0
      • C Offline
        C Offline
        CreMindES
        wrote on last edited by
        #9

        Yes, it's a big help, I've read the gitorious version, and I will the trolltech too later.

        I'm teaching simple C at the University for newbies in this year (I'm an electrical engineer student) and it's very important and quite hard sometimes to teach them how to correctly indentation and style their code. But I'm getting much nicer codes now from them :) So it's worth to tell it a hundred times :)

        1 Reply Last reply
        0
        • L Offline
          L Offline
          laurent bauer
          wrote on last edited by
          #10

          Let's forget the "bug free" and rather talk about "robust" programming instead

          • So, good coding style and conventions contribute to "robust" programming. And we have several links.

          Other possible Qt's contributors to "robust" programming may be:

          • signals & slots : for strong independency of components (+ impossible to crash even if bad coded ?)
          • Implicit sharing and associated objects with reference counting
          • Thread safe objects

          Anything else ?

          1 Reply Last reply
          0
          • P Offline
            P Offline
            Panke
            wrote on last edited by
            #11

            bq. (+ impossible to crash even if bad coded ?)

            That your program does not crash, does not mean it has no bugs :-)

            I agree to the other points though and think that the memory management things are most useful.

            1 Reply Last reply
            0
            • L Offline
              L Offline
              laurent bauer
              wrote on last edited by
              #12

              What do you mean with "memory management things" ? The shared classes ?

              1 Reply Last reply
              0
              • P Offline
                P Offline
                Panke
                wrote on last edited by
                #13

                [quote author="laurent bauer" date="1293645469"]

                • Implicit sharing and associated objects with reference counting
                  [/quote]

                yes

                1 Reply Last reply
                0
                • L Offline
                  L Offline
                  laurent bauer
                  wrote on last edited by
                  #14

                  In the first post, i wrote: "You create an orphan widget, you attach it later to a parent widget. The parent takes ownership and you don’t need to worry anymore about the child life cycle"

                  I like this idea : you transfer the management of an object to an object owner. And you don't have to manage it yourself .

                  Do you know if this is a concept, a design pattern or anything which has a name?
                  Do you know if this coding way is described somewhere?

                  1 Reply Last reply
                  0
                  • G Offline
                    G Offline
                    giesbert
                    wrote on last edited by
                    #15

                    The parent - child relationship, that includes lifetime coupling?

                    I would say it's a normal Komposition (UML :-) ).

                    Nokia Certified Qt Specialist.
                    Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                    1 Reply Last reply
                    0
                    • L Offline
                      L Offline
                      laurent bauer
                      wrote on last edited by
                      #16

                      So simple? Well, I feel a bit ridiculous...

                      1 Reply Last reply
                      0
                      • G Offline
                        G Offline
                        giesbert
                        wrote on last edited by
                        #17

                        Must everything be complicated?

                        Nokia Certified Qt Specialist.
                        Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                        1 Reply Last reply
                        0
                        • I Offline
                          I Offline
                          ivan
                          wrote on last edited by
                          #18

                          In a sense, it is just an extension to the standard C++ behaviour to work with pointers (free on destruction) so it is not really a new concept.

                          Ivan Čukić | ivan.cukic(at)kde.org | KDE e.V.
                          Qt Ambassador (from the old Nokia days)

                          1 Reply Last reply
                          0
                          • L Offline
                            L Offline
                            laurent bauer
                            wrote on last edited by
                            #19

                            OK, I guess a widget has a container of children widgets which are destroyed by the parent destructor.
                            However, it must be a little bit more tricky because the ownership can be transfered to another parent widget.

                            1 Reply Last reply
                            0
                            • G Offline
                              G Offline
                              goetz
                              wrote on last edited by
                              #20

                              It's only a QObjectList (which is just a typedef for QList<QObject *>). It is only little more than removing from one and inserting into the other list (and handling layout issues in case of widgets).

                              http://www.catb.org/~esr/faqs/smart-questions.html

                              1 Reply Last reply
                              0
                              • C Offline
                                C Offline
                                CreMindES
                                wrote on last edited by
                                #21

                                Yes, it's that simple :) The best things are so simple :)

                                1 Reply Last reply
                                0

                                • Login

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • Users
                                • Groups
                                • Search
                                • Get Qt Extensions
                                • Unsolved