Results 1 to 7 of 7

Thread: Is this sentence correct?

  1. #1
    Join Date
    Apr 2011
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Question Is this sentence correct?

    At the end of the following webpage: http://web.mit.edu/qt-dynamic/www/tu...torial-t4.html

    This sentence is mentioned under the main() function:

    Here we instantiate our new child, show it, and execute the application.

    Is it correct to say "child" here? If so, why is "MyWidget" considered a child?

    Thanks.

  2. #2
    Join Date
    Oct 2010
    Posts
    55
    Thanks
    1
    Thanked 11 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    9

    Default Re: Is this sentence correct?

    It does seem inconsistent with the rest of the text since it is not created with a parent widget.

  3. #3
    Join Date
    Jun 2011
    Location
    Finland
    Posts
    164
    Thanks
    1
    Thanked 26 Times in 26 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: Is this sentence correct?

    Every widget is a child of the application, so I would say it is correct to say that a child has been instantiated.

  4. #4
    Join Date
    Oct 2010
    Posts
    55
    Thanks
    1
    Thanked 11 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    9

    Default Re: Is this sentence correct?

    I think it's a mistake. Up to that point in the text, the terminology is consistent:

    • A child widget is a widget constructed with a parent widget (window).
    • A widget without a parent widget is always an independent window.

    In the final example, MyWidget is clearly a window in this context since it has no parent (widget.parent() is 0).

    Unless child here refers to parent/child relationship in the class hierarchy, i.e. inheritance (the text reads "we instantiate our new child," which suggests that the subject is an object, not a class) it is at least ambiguous.

  5. #5
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: Is this sentence correct?

    It is a child with no parent. Note that that this instance (widget) does not have a parent, otherwise this class of chidlren (MyWidget) can have parents, hence the statement is not worng.

  6. #6
    Join Date
    Oct 2010
    Posts
    55
    Thanks
    1
    Thanked 11 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    9

    Default Re: Is this sentence correct?

    MyWidget is a child class of QWidget. Is this what you mean? If so, I agree on that part but I am just saying that the terminology is not clear since the rest of the text is talking about parent/child relationship in the context of the QObject tree hierarchy. So, child; as in MyWidget/QWidget; yes, but most readers will probably read it as child widget. But it's not a child widget... or? Maybe I misunderstood you here. To me the concept of a child widget here is a widget being constructed with a parent widget (e.g., QPushButton quit("Quit", &window); ).

    The part "we instantiate our new child" implies that child here is an object, the widget to be specific, and not a class. This, plus the rest of the text suggests that the author is not referring to a class inheritance type-of parent/child relationship.

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Is this sentence correct?

    When it comes to subclassing the usual naming is "base" (or "super") and "derived" (or "descendant") class. Parent-child terminology is reserved for objects. On the other hand a "child widget" is a term of its own. It means a widget that is not a window (regardless whether the particular technology has the notion of parents and children).

    In the text mentioned the problematic part seems to be a residue after some other text.
    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. Highlighting individual words of a sentence
    By kellorooney in forum Newbie
    Replies: 1
    Last Post: 16th April 2010, 04:51
  2. File menu is not correct
    By dwarnold45 in forum Newbie
    Replies: 3
    Last Post: 31st March 2010, 21:03
  3. Correct way to clear a form?
    By Walter in forum Newbie
    Replies: 7
    Last Post: 16th August 2009, 18:54
  4. Replies: 5
    Last Post: 16th March 2007, 08:18
  5. QSetting value() not correct
    By bpetty in forum Newbie
    Replies: 1
    Last Post: 14th August 2006, 19:58

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.