Coder Social home page Coder Social logo

maskdemo's Introduction

maskdemo

需要在弹框的窗体背后遮罩原有主窗体,使得突出显示弹窗窗体(刘典武example)

需要在弹框的窗体背后遮罩原有主窗体,使得突出显示弹窗窗体,突然想到之前写过一个全局截屏的东东,原理一致,拿来改改。 优点:只需要引入一个头文件和实现文件即可,在主窗体中设置下需要遮罩的主窗体和可能弹窗窗体的类名即可。就是如此简单。 复制代码

//第一步,设置需要遮罩的父窗体
    MaskWidget::Instance()->setMainWidget(this);
    //第二步,设置哪些弹窗窗体需要被遮罩
    QStringList dialogNames;
    dialogNames << "frm1" << "frm2";
    MaskWidget::Instance()->setDialogNames(dialogNames);

附带的全局截屏类,也是只要一行代码即可在项目任何地方使用全局截屏。

也可以作为蒙版这样的效果

ScreenWidget 类中有个 bgScreen 成员 注意一下 实现遮罩的关键

maskdemo's People

Contributors

czzcreator avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.