• 大小: 37.42MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-06-16
  • 语言: C/C++
  • 标签: Qt  Dll  MFC  事件循环  

资源简介

将Qt控件和窗口封装进dll中,并使用MFC和Qt应用程序写出demo来调用该dll。将dll中封装的Qt窗口嵌入到主程序中,实现窗口渲染和消息传递。

资源截图

代码片段和文件信息

#include “DialogManager.h“
#include “libDialogQt.h“
#include “libDialogWin.h“


DialogManager::DialogManager()
    : inited_(false)
     libDialogPtr_(nullptr)
{
}
DialogManager::~DialogManager()
{
}

bool DialogManager::Initialize(const libGlobalParam* globalParam)
{
    bool expected = false;
    if (!inited_.compare_exchange_strong(expected true))
        return true;

    if (!globalParam || globalParam->hWindow == 0)
        return false;

    if (globalParam->appType == APPTYPE::MAT_QT && !globalParam->qtApplication)
        return false;

    if (globalParam->appType == MAT_QT)
        libDialogPtr_ = std::make_shared();
    else if (globalParam->appType == MAT_WIN)
        libDialogPtr_ = std::make_shared();

    return libDialogPtr_->Initialize(globalParam);
}
void DialogManager::ShowDialog()
{
    if (inited_ && libDialogPtr_)
        libDialogPtr_->ShowDialog();
}
bool DialogManager::GetHandle(HWINDOW& handle)
{
    if (!inited_ || !libDialogPtr_)
    {
        handle = 0;
        return false;
    }
    
    return libDialogPtr_->GetHandle(handle);
}
void DialogManager::Resize(int width int height)
{
    if (inited_ && libDialogPtr_)
        libDialogPtr_->Resize(width height);
}
void DialogManager::HideDialog()
{
    if (inited_ && libDialogPtr_)
        libDialogPtr_->HideDialog();
}
void DialogManager::Uninitialize()
{
    bool expected = true;
    if (!inited_.compare_exchange_strong(expected false))
        return;

    if (libDialogPtr_)
    {
        libDialogPtr_->UnInitialize();
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件         50  2020-04-14 13:11  libQtIn\.git\COMMIT_EDITMSG

     文件        298  2020-03-02 10:29  libQtIn\.git\config

     文件         73  2020-03-02 10:29  libQtIn\.git\description

     文件         23  2020-03-02 10:29  libQtIn\.git\HEAD

     文件        478  2020-03-02 10:29  libQtIn\.git\hooks\applypatch-msg.sample

     文件        896  2020-03-02 10:29  libQtIn\.git\hooks\commit-msg.sample

     文件       3327  2020-03-02 10:29  libQtIn\.git\hooks\fsmonitor-watchman.sample

     文件        189  2020-03-02 10:29  libQtIn\.git\hooks\post-update.sample

     文件        424  2020-03-02 10:29  libQtIn\.git\hooks\pre-applypatch.sample

     文件       1638  2020-03-02 10:29  libQtIn\.git\hooks\pre-commit.sample

     文件       1348  2020-03-02 10:29  libQtIn\.git\hooks\pre-push.sample

     文件       4898  2020-03-02 10:29  libQtIn\.git\hooks\pre-rebase.sample

     文件        544  2020-03-02 10:29  libQtIn\.git\hooks\pre-receive.sample

     文件       1492  2020-03-02 10:29  libQtIn\.git\hooks\prepare-commit-msg.sample

     文件       3610  2020-03-02 10:29  libQtIn\.git\hooks\update.sample

     文件       7012  2020-04-14 13:11  libQtIn\.git\index

     文件        240  2020-03-02 10:29  libQtIn\.git\info\exclude

     文件       2087  2020-04-14 13:11  libQtIn\.git\logs\HEAD

     文件       2087  2020-04-14 13:11  libQtIn\.git\logs\refs\heads\master

     文件        173  2020-03-02 10:29  libQtIn\.git\logs\refs\remotes\origin\HEAD

     文件        560  2020-03-05 17:44  libQtIn\.git\logs\refs\remotes\origin\master

     文件        155  2020-04-13 17:06  libQtIn\.git\ms-persist.xml

     文件        235  2020-03-02 14:38  libQtIn\.git\objects\01\a2f0e0f79ec33f0b2d63a3db585781aaba9fc6

     文件        182  2020-03-02 10:30  libQtIn\.git\objects\03\3096806ea7d19d9975c66a3fb21d53388a061a

     文件        553  2020-03-02 14:40  libQtIn\.git\objects\03\55c539e73abc3abb7280f531a92da95edaf608

     文件        227  2020-04-14 13:08  libQtIn\.git\objects\03\c296f25f4dc93fc61e38026a4ad70f0fd952a1

     文件        176  2020-03-05 17:44  libQtIn\.git\objects\04\36ae2afeefa784cd131c6a89489e2607429c86

     文件     100868  2020-04-14 13:08  libQtIn\.git\objects\04\604ab4a530a4651085b857b9739090f06d0338

     文件        544  2020-03-02 10:30  libQtIn\.git\objects\04\64280b2b9c01faec8d85536f66e4ee5716ee5c

     文件      28014  2020-03-05 17:44  libQtIn\.git\objects\04\7d2b48ac91fd96b673f2a37c7373cae02b10b5

............此处省略511个文件信息

评论

共有 条评论