三亩地 三亩地SAN MU DI · CODE DIARY
ARTICLE DETAIL

日记详情

真实记录编程学习的某一天,欢迎挑你感兴趣的翻一翻。

Notes for C++ GUI Programming with Qt 4 (2nd Edition)

Notes for C++ GUI Programming with Qt 4 (2nd Edition)

This post extracts some knowledge from C++ GUI Programming with Qt 4 (2nd Edition).

Chapter 2. Creating Dialogs

Whether we do it in code or in Qt Designer, creating a dialog always involves the same fundamental steps: 1. Create and initialize the child widgets. 2. Put the child widgets in layouts. 3. Set the tab order. 4. Establish signalslot connections. 5. Implement the dialog's custom slots.

Qt's parent-child mechanism is implemented in QObject. When we create an object (a widget, validator, or any other kind) with a parent, the parent adds the object to the list of its children. When the parent is deleted, it walks through its list of children and deletes each child. The children themselves then delete all of their children, and so on recursively until none remain.


原文链接:https://zhuang.dev/reading/cpp-gui-programming-with-qt-4/overview/

← 返回列表