明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 254|回复: 0

ObjectArx 单例接口封装

[复制链接]
发表于 2025-6-28 14:06:24 | 显示全部楼层 |阅读模式
本帖最后由 枫叶棋语 于 2025-7-8 18:46 编辑
  1. <blockquote>#pragma once
复制代码
使用示例
QtForm.h

  1. #pragma once

  2. #include <qwidget.h>
  3. #include <qwindowdefs.h>
  4. #include <singleinstance.h>
  5. #include "ui_qtform.h"
  6. class QtForm :
  7.   public QWidget,
  8.   public Ui::QtFormClass,
  9.   public SingleInstance<QtForm>
  10. {
  11. public:
  12.   QtForm(QWidget* parent = nullptr);
  13.   ~QtForm();
  14. };

复制代码
QtForm.cpp
  1. #include "stdafx.h"
  2. #include "qtform.h"

  3. QtForm::QtForm(QWidget* parent) : QWidget(parent), Ui::QtFormClass()
  4. {
  5.   setupUi(this);
  6.   setAttribute(Qt::WA_DeleteOnClose);
  7.   setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
  8. }

  9. QtForm::~QtForm()
  10. {
  11.   this->close();
  12. }
复制代码







回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2025-7-27 04:08 , Processed in 0.129317 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表