• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setWindowOpacity函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中setWindowOpacity函数的典型用法代码示例。如果您正苦于以下问题:C++ setWindowOpacity函数的具体用法?C++ setWindowOpacity怎么用?C++ setWindowOpacity使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了setWindowOpacity函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: setWindowState

void EyeProtector::updateTime()
{
    //activate the window
    setWindowState(Qt::WindowActive);
    QDateTime now = QDateTime::currentDateTime();//获取系统现在的时间
    long time = now.toMSecsSinceEpoch() / 1000;
    // duration every hour
    if (time % 3600 == 0 ) {
        ready = true;
    }
    if (ready) {
        ++i;
        if (i < 100) {
            setWindowOpacity(i * 0.01);
            show();
        }
        if (i == 100) {
            ready = false;
            hide();
            i = 40;
        }
    } else {
        setWindowOpacity(0.0);
    }

    QString str = now.toString("yyyy-MM-dd hh:mm:ss"); //设置显示格式
    ui->label_2->setText( str );
}
开发者ID:winjeg,项目名称:EyeGuard,代码行数:28,代码来源:eyeprotector.cpp


示例2: dlg

void CObjInfo::on_clb_tracking_clicked()
////////////////////////////////////////
{
  CObjTracking dlg(this, &m_infoItem, &m_map->m_mapView);  

  setWindowOpacity(0);
  dlg.exec();    
  setWindowOpacity(1);
}
开发者ID:PavelMr,项目名称:skytechx,代码行数:9,代码来源:cobjinfo.cpp


示例3: QWidget

QUML_BEGIN_NAMESPACE_GW

Popover::Popover(QWidget* parent, QPoint pos, Qt::Orientation orientation) :
        QWidget(parent), mLayout(new QVBoxLayout()) {
    setWindowFlags(Qt::Popup | Qt::Window | Qt::CustomizeWindowHint);
    setAttribute(Qt::WA_DeleteOnClose);

    mMouse = pos;
    mOrientation = orientation;

    // Slightly shift the origin for looks.
    if(mOrientation == Qt::Horizontal) {
        pos.ry() -= 26;
    } else {
        pos.rx() -= 26;
    }

    mPos = pos;

    setWindowOpacity(0.85);

    setLayout(mLayout);
    mLayout->setAlignment(Qt::AlignTop);

    setFocus();
}
开发者ID:SynthiNet,项目名称:Qumulus,代码行数:26,代码来源:Popover.cpp


示例4: setWindowOpacity

void SketchMainHelpPrivate::enterEventAux() {
	if(m_shouldGetTransparent) {
		setWindowOpacity(1.0);
		QTimer::singleShot(2000, this, SLOT(setTransparent()));
	}
	//m_closeButton->doShow();
}
开发者ID:h4ck3rm1k3,项目名称:fritzing,代码行数:7,代码来源:sketchmainhelp.cpp


示例5: windowOpacity

/**
 * Hidding fullscreen controller slowly
 * Linux: need composite manager
 * Windows: it is blinking, so it can be enabled by define TRASPARENCY
 */
void FullscreenControllerWidget::slowHideFSC()
{
#if HAVE_TRANSPARENCY
    if( b_slow_hide_begin )
    {
        b_slow_hide_begin = false;

        p_slowHideTimer->stop();
        /* the last part of time divided to 100 pieces */
        p_slowHideTimer->start( (int)( i_slow_hide_timeout / 2 / ( windowOpacity() * 100 ) ) );

    }
    else
    {
         if ( windowOpacity() > 0.0 )
         {
             /* we should use 0.01 because of 100 pieces ^^^
                but than it cannt be done in time */
             setWindowOpacity( windowOpacity() - 0.02 );
         }

         if ( windowOpacity() <= 0.0 )
             p_slowHideTimer->stop();
    }
#endif
}
开发者ID:r1k,项目名称:vlc,代码行数:31,代码来源:controller.cpp


示例6: setWindowOpacity

/*!
  It creates the PauseMenu.
*/
PauseMenu::PauseMenu(MainWindow *window)
{
    // init
    this->window = window;

    // Gereral window
    setWindowOpacity(0.9);

    // Buttons
    layout = new QVBoxLayout();
    hLayout = new QHBoxLayout();

    label = new QLabel("<h2 align=\"center\">Pause menu</h2>");
    resumeButton = new QPushButton("&Resume");
    resumeButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
    connect(resumeButton, SIGNAL(clicked()), this, SLOT(resume()));
    mainMenuButton = new QPushButton("&Main Menu");
    mainMenuButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
    connect(mainMenuButton, SIGNAL(clicked()), this, SLOT(mainMenu()));

    layout->insertSpacing(0, 100);
    layout->addWidget(label);
    layout->insertSpacing(1, 100);
    layout->addWidget(resumeButton);
    layout->addWidget(mainMenuButton);
    layout->insertSpacing(5, 250);

    hLayout->insertSpacing(0, 300);
    hLayout->addLayout(layout);
    hLayout->insertSpacing(2, 300);

    setLayout(hLayout);
}
开发者ID:corn-eliu,项目名称:runsepprun,代码行数:36,代码来源:PauseMenu.cpp


示例7: QDialog

DropBox::DropBox(QWidget *parent, QAbstractItemModel *model, SettingsModel *settings)
:
	QDialog(parent, Qt::CustomizeWindowHint | Qt::WindowStaysOnTopHint),
	m_counterLabel(this),
	m_model(model),
	m_settings(settings),
	m_moving(false),
	m_firstShow(true)
{
	//Init the dialog, from the .ui file
	setupUi(this);
	
	//Init counter
	m_counterLabel.setParent(dropBoxLabel);
	m_counterLabel.setText("0");
	m_counterLabel.setAlignment(Qt::AlignHCenter | Qt::AlignTop);
	SET_FONT_BOLD(m_counterLabel, true);

	//Prevent close
	m_canClose = false;

	//Make transparent
	setWindowOpacity(0.8);
	
	//Translate UI
	QEvent languageChangeEvent(QEvent::LanguageChange);
	changeEvent(&languageChangeEvent);
}
开发者ID:arestarh,项目名称:LameXP,代码行数:28,代码来源:Dialog_DropBox.cpp


示例8: PsMainWindow

Window::Window(QWidget *parent) : PsMainWindow(parent),
intro(0), main(0), settings(0), layerBG(0), _topWidget(0),
_connecting(0), _clearManager(0), dragging(false), _inactivePress(false), _mediaView(0) {

	icon16 = icon256.scaledToWidth(16, Qt::SmoothTransformation);
	icon32 = icon256.scaledToWidth(32, Qt::SmoothTransformation);
	icon64 = icon256.scaledToWidth(64, Qt::SmoothTransformation);

	if (objectName().isEmpty()) {
		setObjectName(qsl("MainWindow"));
	}
	resize(st::wndDefWidth, st::wndDefHeight);
	setWindowOpacity(1);
	setLocale(QLocale(QLocale::English, QLocale::UnitedStates));
	centralwidget = new QWidget(this);
	centralwidget->setObjectName(qsl("centralwidget"));
	setCentralWidget(centralwidget);

	QMetaObject::connectSlotsByName(this);

	_inactiveTimer.setSingleShot(true);
	connect(&_inactiveTimer, SIGNAL(timeout()), this, SLOT(onInactiveTimer()));

	connect(&notifyWaitTimer, SIGNAL(timeout()), this, SLOT(notifyFire()));
}
开发者ID:Samuel0Paul,项目名称:tdesktop,代码行数:25,代码来源:window.cpp


示例9: if

bool KFontDialog::eventFilter(QObject *obj, QEvent *event) {
    if(obj == ui->btn_close) {
            if(event->type() == QEvent::Enter){
                ui->btn_close->setPixmap(QPixmap(":/pixmap/image/closeBtn-hover.png"));
            }else if(event->type() == QEvent::Leave){
                ui->btn_close->setPixmap(QPixmap(":/pixmap/image/closeBtn.png"));
            }else if(event->type() == QEvent::MouseButtonPress){
                ui->btn_close->setPixmap(QPixmap(":/pixmap/image/closeBtn-hover.png"));
            }else if(event->type() == QEvent::MouseButtonRelease){
                QMouseEvent *me = (QMouseEvent *)event;
                QLabel *lb = (QLabel *)obj;
                if(me->x() > 0 && me->x() < lb->width() && me->y() > 0 && me->y() < lb->height()){
                    this->close();
                }else{
                    ui->btn_close->setPixmap(QPixmap(":/pixmap/image/closeBtn.png"));
                }
            } else {
                return QObject::eventFilter(obj, event);
            }
    }
    if(obj == ui->okBtn ||obj == ui->quitBtn)
    {
        if(event->type() == QEvent::MouseButtonPress)
        {
            QMouseEvent *me = (QMouseEvent *)event;
            dragPos = me->globalPos() - frameGeometry().topLeft();
        }else if(event->type() == QEvent::MouseButtonRelease)
        {
            setWindowOpacity(1);
        }
    }
    return QObject::eventFilter(obj, event);
}
开发者ID:fanyujiao,项目名称:CMS,代码行数:33,代码来源:kfontdialog.cpp


示例10: setGeometry

void PopUpMessage::show()
{
    setGeometry(QApplication::desktop()->availableGeometry().width() - 36 - width() + QApplication::desktop() -> availableGeometry().x(),
                QApplication::desktop()->availableGeometry().height() - 36 - height() + QApplication::desktop() -> availableGeometry().y(),
                width(),
                height());
    if(!isVisible()){
        setWindowOpacity(0.0);

        animation.setDuration(150);
        animation.setStartValue(0.0);
        animation.setEndValue(1.0);

        QWidget::show();

        animation.start();
        timer->start(3000);
    } else {
        animation.setDuration(windowOpacity()*150);
        animation.setStartValue(windowOpacity());
        animation.setEndValue(1.0);
        animation.start();
        timer->start(3000);
    }
}
开发者ID:Legotckoi,项目名称:EColor,代码行数:25,代码来源:popupmessage.cpp


示例11: m_settings

Widget::Widget(const char* wname) : m_settings(wname)//, m_shortcutGrabber(this, m_settings)
{
    setWindowFlags(Qt::ToolTip);
    setAttribute(Qt::WA_TranslucentBackground);
    setWindowOpacity(m_settings.get("gui/opacity").toInt() / 100.0);
    QPropertyAnimation* anim = new QPropertyAnimation(this);
    anim->setTargetObject(this);
    m_animation.addAnimation(anim);
    anim->setEasingCurve(QEasingCurve::Type(m_settings.get("gui/in_animation").toInt()));
    connect(anim, SIGNAL(finished()), this, SLOT(reverseTrigger()));
    connectForPosition(m_settings.get("gui/position").toString());
    connect(&m_visible, SIGNAL(timeout()), this, SLOT(reverseStart()));
    m_visible.setSingleShot(true);
    QHBoxLayout* l = new QHBoxLayout;
    l->setSizeConstraint(QLayout::SetNoConstraint);
    l->setMargin(0);
    l->setContentsMargins(0, 0, 0, 0);
    setLayout(l);
    l->addWidget(m_contentView["icon"] = new QLabel);
    l->addWidget(m_contentView["title"] = new QLabel);
    l->addWidget(m_contentView["text"] = new QLabel);
    m_contentView["title"]->setOpenExternalLinks(true);
    m_contentView["text"]->setOpenExternalLinks(true);
    setContextMenuPolicy(Qt::CustomContextMenu);
    connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(onHide()));
    // Let the event loop run
    QTimer::singleShot(30, this, SLOT(init()));
}
开发者ID:ptrxyz,项目名称:twmn,代码行数:28,代码来源:widget.cpp


示例12: KVI_OPTION_UINT

void KviMainWindow::updatePseudoTransparency()
{
#ifdef COMPILE_PSEUDO_TRANSPARENCY
	uint uOpacity = KVI_OPTION_UINT(KviOption_uintGlobalWindowOpacityPercent) < 50 ? 50 : KVI_OPTION_UINT(KviOption_uintGlobalWindowOpacityPercent);
	setWindowOpacity((float)uOpacity / 100);
#if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW)
#ifndef Q_WS_EX_LAYERED
#define Q_WS_EX_LAYERED WS_EX_LAYERED
#endif
	if(uOpacity < 100)
	{
		SetWindowLong(reinterpret_cast<HWND>(effectiveWinId()), GWL_EXSTYLE,
		    GetWindowLong(reinterpret_cast<HWND>(effectiveWinId()), GWL_EXSTYLE) | Q_WS_EX_LAYERED);
	}
	else
	{
		SetWindowLong(reinterpret_cast<HWND>(effectiveWinId()), GWL_EXSTYLE,
		    GetWindowLong(reinterpret_cast<HWND>(effectiveWinId()), GWL_EXSTYLE) & ~Q_WS_EX_LAYERED);
	}
#endif
	if(g_pShadedParentGlobalDesktopBackground)
		m_pWindowStack->update();

	if(g_pShadedChildGlobalDesktopBackground)
	{
		for(KviWindow * wnd = m_pWinList->first(); wnd; wnd = m_pWinList->next())
			wnd->updateBackgrounds();
		m_pWindowList->updatePseudoTransparency();
	}
#endif
}
开发者ID:un1versal,项目名称:KVIrc,代码行数:31,代码来源:KviMainWindow.cpp


示例13: QMenu

KNAnimationMenu::KNAnimationMenu(QWidget *parent) :
    QMenu(parent),
    m_showContent(false),
    #ifndef Q_OS_MACX
    m_showAnime(new QPropertyAnimation(this, "geometry", this)),
    #endif
    m_mouseDownPos(QPoint(0,0))
{
    //Set properties.
    setAutoFillBackground(true);
#ifndef Q_OS_MACX
    setWindowOpacity(0.85);
    //Configure the animation.
    m_showAnime->setEasingCurve(QEasingCurve::OutCubic);
    m_showAnime->setDuration(150);
    //When the show anime is finished, show the content.
    connect(m_showAnime, &QPropertyAnimation::finished,
            [=]
            {
                //Set the show content flag.
                m_showContent=true;
                //Update the menu.
                update();
            });
#endif
}
开发者ID:AnkyoChu,项目名称:Mu,代码行数:26,代码来源:knanimationmenu.cpp


示例14: m_id

Notification::Notification(int id)
    : m_id(id)
    , m_body(NULL)
    , m_titleLabel(NULL)
    , m_iconLabel(NULL)
    , m_msgLabel(NULL)
    , m_opacity(1.0)
    , m_icon(0)
{
    QVBoxLayout *bodyLayout = new QVBoxLayout(this);
    bodyLayout->setMargin(8);
    m_body = new QWidget(this);
    bodyLayout->addWidget(m_body);
    bodyLayout->setSizeConstraint(QLayout::SetMaximumSize);

    QGridLayout *layout = new QGridLayout(m_body);
    layout->setMargin(0);

    m_titleLabel = new QLabel(this);
    layout->addWidget(m_titleLabel, 0, 0, 1, 2, Qt::AlignCenter);
    m_titleLabel->setTextFormat(Qt::PlainText);
    setTitle( QString() );

    m_iconLabel = new QLabel(this);
    layout->addWidget(m_iconLabel, 1, 0, Qt::AlignTop);

    m_msgLabel = new QLabel(this);
    layout->addWidget(m_msgLabel, 1, 1, Qt::AlignAbsolute);

    setWindowFlags(Qt::ToolTip);
    setWindowOpacity(m_opacity);
}
开发者ID:wizardofozzie,项目名称:CopyQ,代码行数:32,代码来源:notification.cpp


示例15: setWindowOpacity

void Notification::leaveEvent(QEvent *event)
{
    setWindowOpacity(m_opacity);
    if ( m_timer.interval() > 0 )
        m_timer.start();
    QWidget::leaveEvent(event);
}
开发者ID:wizardofozzie,项目名称:CopyQ,代码行数:7,代码来源:notification.cpp


示例16: QWidget

SnapScreen::SnapScreen(QWidget *parent) :
QWidget(parent)
{
	setAttribute(Qt::WA_DeleteOnClose);
	//显示按下截图时瞬间的图像(即原图)
	screenImage=QPixmap::grabWindow
	(
	QApplication::desktop()->winId(),0,0,
	QApplication::desktop()->width(),
	QApplication::desktop()->height()
	).toImage();
	screenWidget.setWindowState(Qt::WindowFullScreen);
	screenPalette.setBrush(backgroundRole(),QBrush(screenImage));
	screenWidget.setPalette(screenPalette);
	screenWidget.setVisible(true);
	//进入截图模式
	snapPalette.setColor(backgroundRole(),QColor(0,0,0));
	setPalette(snapPalette);//设置有色滤镜
	setWindowOpacity(0.5);//设置透明度以看见后面的画面
	setWindowState(Qt::WindowFullScreen);//截图的可选择区域是整个屏幕
	setMouseTracking(true);//这是为了让鼠标没按下时也能触发mouseMoveEvent,以便显示当前点的坐标值和颜色值
	//这个是截图器
	snapWidget.ptrScreenWidget=&screenWidget;
	snapWidget.ptrSnapScope=&snapScope;
	snapWidget.setVisible(true);
	//这个是一个小型放大镜,用于精确观察
	snapScope.ptrImageSource=&screenWidget;
	snapScope.setVisible(true);
	currentPos=QCursor::pos();
	//连接信号和槽
	connect(&snapWidget,SIGNAL(signalClose()),this,SLOT(close()));//接收关闭信号
	connect(this,SIGNAL(signalGetSnap()),&snapWidget,SLOT(slotGetSnap()));
}
开发者ID:MtDesert,项目名称:ChatClient,代码行数:33,代码来源:SnapScreen.cpp


示例17: Loading

void Widget::slotClickLoginBtn()
{
    QString stdNum = ui->id->text();
    QString passwd = ui->pw->text();

    QString parameters;



    // 학생 모드일경우
    if(ui->type->currentIndex() == STD)
    {
        parameters.append("student/");
        parameters.append(stdNum);
        parameters.append("/");

        parameters.append("passwd/");
        parameters.append(passwd);
        login->post_url(STUDENT,POST_LOGIN, parameters, NULL ,4,HEADER_NON);
    }
    // 교수 모드일경우
    else
    {
        parameters.append("professor/");
        parameters.append(stdNum);
        parameters.append("/");

        parameters.append("passwd/");
        parameters.append(passwd);
        login->post_url(PROFESSOR,POST_LOGIN, parameters, NULL ,4,HEADER_NON);
    }
    load = new Loading();
    setWindowOpacity(0.8);
    load->show();
}
开发者ID:gnu-swta,项目名称:Chat,代码行数:35,代码来源:widget.cpp


示例18: move

void FcitxWarnDialog::mouseMoveEvent(QMouseEvent *event) {
    if (event->buttons() & Qt::LeftButton ) {
        move(event->globalPos() - dragPos);
        setWindowOpacity(1);//0.5
    }
    event->accept();
}
开发者ID:fanyujiao,项目名称:CMS,代码行数:7,代码来源:fcitxwarndialog.cpp


示例19: if

void kWarningWindow::kShow(int type){

	//加载警告种类
	//0 ok
	//1 error
	if (type == 0){
		kMusicData::successSound();
		windowImage.load("Resources\\image\\warning");
	}
	else if (type == 1){
		kMusicData::errorSound();
		windowImage.load("Resources\\image\\warning2");
	}

	//透明度
	setWindowOpacity(1.0);

	//动画
	timeid = startTimer(40);


	update();

	//移动到中间
	QDesktopWidget* desktop = QApplication::desktop();
	move((desktop->width() - 580) / 2, (desktop->height() - 270) / 2);

	show();
}
开发者ID:KinderRiven,项目名称:RFIDSystem,代码行数:29,代码来源:kwarningwindow.cpp


示例20: show

void RocketStorageInfoDialog::Open()
{
    if (isVisible())
        return;
        
    show();
    setFocus(Qt::ActiveWindowFocusReason);
    activateWindow();

    setWindowOpacity(0.0);

    QPropertyAnimation *showAnim = new QPropertyAnimation(this, "windowOpacity", this);
    showAnim->setStartValue(0.0);
    showAnim->setEndValue(1.0);
    showAnim->setDuration(300);
    showAnim->setEasingCurve(QEasingCurve(QEasingCurve::InOutQuad)); 
    showAnim->start();
    
    plugin_->Notifications()->CenterToMainWindow(this);
    plugin_->Notifications()->DimForeground();
    
    // If input mode is enabled, focus the input field and 
    // select the text so user can start writing.
    if (ui.lineEditInput->isVisible())
    {
        ui.lineEditInput->setFocus(Qt::MouseFocusReason);
        ui.lineEditInput->selectAll();
    }
}
开发者ID:Adminotech,项目名称:meshmoon-plugins,代码行数:29,代码来源:MeshmoonStorageDialogs.cpp



注:本文中的setWindowOpacity函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setWindowState函数代码示例发布时间:2022-05-30
下一篇:
C++ setWindowName函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap