From 9c1dd5abbf0df0aca4499513fb2c4b396ccf92e0 Mon Sep 17 00:00:00 2001 From: "ithink.chan" Date: Fri, 26 Jul 2019 11:28:34 +0800 Subject: [PATCH] =?UTF-8?q?Qt=20Creator=20Promote=20to=20=E7=94=A8?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ithink.chan --- .../Qt_Creator/Qt_Creator_Promote_to_用法.md | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Software/Program/Environment/Qt/Qt_Creator/Qt_Creator_Promote_to_用法.md diff --git a/Software/Program/Environment/Qt/Qt_Creator/Qt_Creator_Promote_to_用法.md b/Software/Program/Environment/Qt/Qt_Creator/Qt_Creator_Promote_to_用法.md new file mode 100644 index 0000000..e35dabc --- /dev/null +++ b/Software/Program/Environment/Qt/Qt_Creator/Qt_Creator_Promote_to_用法.md @@ -0,0 +1,24 @@ +# Qt Creator Promote to 用法 + +在 Qt Creator 的 Design 中,右击谋控件,可将该控件提升为自定义控件。 + +## 使用条件 + +被提升的控件必须与目标控件属于同一父类。 + +## 使用方法 + +首先添加用于提升的控件: + +1. 新建谋一自定义控件,可以带 ui 也可以不带 ui; +2. 为该控件增加属性、编写自定义方法; +3. 右键选中要提升的控件,选择 “Promote to ...”(注意这个是带省略号的); +4. Base class name 选择父类; +5. Promoted class name 填写自定义类的类名; +6. Header file 填写自定义类的头文件; +7. 点击 Add 按钮。 + +然后再提升控件 + +1. 右击要提升的控件; +2. 点选 “Promote to”(注意这个是不带省略号的),选择已添加好的自定义控件。