当前位置: 首页>>代码示例>>C++>>正文


C++ setGraphicsEffect函数代码示例

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


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

示例1: setMaximized

void CardHostWindow::resizeWindowBufferEvent(int w, int h, QRect windowScreenBounds, bool forceSync)
{
	//Don't rotate.  Not now.  Not ever.
	bool directRendering = m_maximized;

	if(Settings::LunaSettings()->displayUiRotates) {
		if(directRendering)
			setMaximized(false); // disable direct rendering for the resize event
		setBoundingRect(windowScreenBounds.width(), windowScreenBounds.height());

		m_paintPath = QPainterPath();
		m_paintPath.addRoundedRect(m_boundingRect, 25, 25);

		// reconstruct shadow
		CardDropShadowEffect* shadow = static_cast<CardDropShadowEffect*>(graphicsEffect());
		if (shadow) {
			bool enable = shadow->isEnabled();
			setGraphicsEffect(0);
			shadow = new CardDropShadowEffect(this);
			setGraphicsEffect(shadow);
			shadow->setEnabled(enable);
		}

		if(directRendering)
			setMaximized(true); // re-enable direct rendering
	}
}
开发者ID:ctbrowser,项目名称:luna-sysmgr,代码行数:27,代码来源:CardHostWindow.cpp

示例2: setGraphicsEffect

void SBI_ImagesIcon::updateIcon()
{
    if (testCurrentPageWebAttribute(QWebEngineSettings::AutoLoadImages)) {
        setGraphicsEffect(0);
    }
    else {
        QGraphicsColorizeEffect* effect = new QGraphicsColorizeEffect(this);
        effect->setColor(Qt::gray);
        setGraphicsEffect(effect);
    }
}
开发者ID:Martii,项目名称:qupzilla,代码行数:11,代码来源:sbi_imagesicon.cpp

示例3: setGraphicsEffect

void CanvasLine::setLineSelected(bool yesno)
{
    if (locked) return;
    if (options.fancy_eyecandy)
    {
        if (yesno)
            setGraphicsEffect(new CanvasPortGlow(item1->getPortType(), toGraphicsObject()));
        else
            setGraphicsEffect(0);
    }

    updateLineGradient(yesno);
    line_selected = true;
}
开发者ID:Adamiko,项目名称:los,代码行数:14,代码来源:canvasline.cpp

示例4: KTabBar

TabBar::TabBar(QWidget *parent)
    : KTabBar(parent)
    , m_actualIndex(-1)
    , m_currentTabPreviewIndex(-1)
    , m_isFirstTimeOnTab(true)
    , m_tabHighlightEffect(new TabHighlightEffect(this))
    , m_animationMapper(new QSignalMapper(this))
{
    setElideMode(Qt::ElideRight);

    setDocumentMode(true);
    setTabsClosable(true);
    setMovable(true);

    setContextMenuPolicy(Qt::CustomContextMenu);

    // avoid ambiguos shortcuts. See BUG:275858
    KAcceleratorManager::setNoAccel(this);

    connect(this, SIGNAL(contextMenu(int, QPoint)), this, SLOT(contextMenu(int, QPoint)));
    connect(this, SIGNAL(emptyAreaContextMenu(QPoint)), this, SLOT(emptyAreaContextMenu(QPoint)));

    connect(m_animationMapper, SIGNAL(mapped(int)), this, SLOT(removeAnimation(int)));
    setGraphicsEffect(m_tabHighlightEffect);

    setAnimatedTabHighlighting(ReKonfig::animatedTabHighlighting());
    setAcceptDrops(true);
}
开发者ID:Arakmar,项目名称:rekonq,代码行数:28,代码来源:tabbar.cpp

示例5: QGraphicsBlurEffect

void LinkSelectionItem::appear(const QPointF& animStartPos, const QRectF& linkRect) 
{
    QGraphicsBlurEffect* blur = new QGraphicsBlurEffect();
    blur->setBlurHints(QGraphicsBlurEffect::PerformanceHint);
    blur->setBlurRadius(15);
    setGraphicsEffect(blur);

    QPropertyAnimation* rectAnimation = new QPropertyAnimation(this, "rect");
    rectAnimation->setDuration(s_appearAnimDuration);

    rectAnimation->setStartValue(QRectF(animStartPos, QSize(3, 3)));
    rectAnimation->setEndValue(linkRect);    

    rectAnimation->setEasingCurve(QEasingCurve::OutExpo);

    QPropertyAnimation* opacityAnimation = new QPropertyAnimation(this, "opacity");
    opacityAnimation->setDuration(s_disappearAnimDuration);

    opacityAnimation->setStartValue(s_linkOpacity);
    opacityAnimation->setEndValue(0.0);

    opacityAnimation->setEasingCurve(QEasingCurve::InExpo);
    
    m_linkSelectiogroup.addAnimation(rectAnimation);
    m_linkSelectiogroup.addAnimation(opacityAnimation);
    m_linkSelectiogroup.start();
}
开发者ID:Trim,项目名称:yberbrowser,代码行数:27,代码来源:LinkSelectionItem.cpp

示例6: setGraphicsEffect

void LabelIamge::leaveEvent(QEvent *evt)
{
	effect->setOpacity(1.0f);
	setGraphicsEffect(effect);

	return QLabel::leaveEvent(evt);
}
开发者ID:Code-Guy,项目名称:Paradise,代码行数:7,代码来源:labelimage.cpp

示例7: QWidget

KCMailSendingStatus::KCMailSendingStatus(QWidget *parent) :
    QWidget(parent)
{
    setContentsMargins(0,0,0,0);
    setAutoFillBackground(true);
    setMinimumHeight(50);

    QVBoxLayout *mainLayout=new QVBoxLayout(this);
    mainLayout->setContentsMargins(7,7,7,7);
    mainLayout->setSpacing(7);
    setLayout(mainLayout);

    reportStatus=new QLabel(this);
    reportStatus->setAlignment(Qt::AlignCenter);
    mainLayout->addWidget(reportStatus);
    mailProgress=new QProgressBar(this);
    mailProgress->setTextVisible(false);
    mainLayout->addWidget(mailProgress);

    QGraphicsDropShadowEffect *wndShadow = new QGraphicsDropShadowEffect(this);
    wndShadow->setBlurRadius(15.0);
    wndShadow->setColor(QColor(0, 0, 0, 200));
    wndShadow->setOffset(0);
    setGraphicsEffect(wndShadow);

    pal=mailProgress->palette();

    statusAnime=new QPropertyAnimation(this, "geometry", this);
    statusAnime->setEasingCurve(QEasingCurve::OutCubic);
}
开发者ID:Kreogist,项目名称:Cuties,代码行数:30,代码来源:kcmailreports.cpp

示例8: setFlag

void QgsComposerItem::init( const bool manageZValue )
{
  setFlag( QGraphicsItem::ItemIsSelectable, true );
  //set default pen and brush
  setBrush( QBrush( QColor( 255, 255, 255, 255 ) ) );
  QPen defaultPen( QColor( 0, 0, 0 ) );
  defaultPen.setWidthF( 0.3 );
  defaultPen.setJoinStyle( mFrameJoinStyle );
  setPen( defaultPen );
  //let z-Value be managed by composition
  if ( mComposition && manageZValue )
  {
    mCompositionManagesZValue = true;
    mComposition->addItemToZList( this );
  }
  else
  {
    mCompositionManagesZValue = false;
  }

  // Setup composer effect
  mEffect = new QgsComposerEffect();
  setGraphicsEffect( mEffect );

  // data defined strings
  mDataDefinedNames.insert( QgsComposerObject::PageNumber, QString( "dataDefinedPageNumber" ) );
  mDataDefinedNames.insert( QgsComposerObject::PositionX, QString( "dataDefinedPositionX" ) );
  mDataDefinedNames.insert( QgsComposerObject::PositionY, QString( "dataDefinedPositionY" ) );
  mDataDefinedNames.insert( QgsComposerObject::ItemWidth, QString( "dataDefinedWidth" ) );
  mDataDefinedNames.insert( QgsComposerObject::ItemHeight, QString( "dataDefinedHeight" ) );
  mDataDefinedNames.insert( QgsComposerObject::ItemRotation, QString( "dataDefinedRotation" ) );
  mDataDefinedNames.insert( QgsComposerObject::Transparency, QString( "dataDefinedTransparency" ) );
  mDataDefinedNames.insert( QgsComposerObject::BlendMode, QString( "dataDefinedBlendMode" ) );
  mDataDefinedNames.insert( QgsComposerObject::ExcludeFromExports, QString( "dataDefinedExcludeExports" ) );
}
开发者ID:NyakudyaA,项目名称:QGIS,代码行数:35,代码来源:qgscomposeritem.cpp

示例9: pixmapRect

Thumbnail::Thumbnail(const QPixmap &originalPixmap)
{
	QPixmap pixmap = originalPixmap.scaled(PixmapSize, PixmapSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
	QPixmap shadow;
	QRect pixmapRect(Margin + PixmapSize / 2 - pixmap.size().width() / 2, Margin + PixmapSize / 2 - pixmap.size().height() / 2, pixmap.size().width(), pixmap.size().height());
	
	if (_shadowCache.contains(pixmap.size()))
	{
		shadow = _shadowCache.value(pixmap.size());
	}
	else
	{
		shadow = QPixmap(thumbnailSize());
		shadow.fill(Qt::transparent);
		
		QGraphicsScene scene(shadow.rect());
		auto rectItem = scene.addRect(pixmapRect, Qt::NoPen, Qt::white);
		QGraphicsDropShadowEffect effect(0);
		effect.setBlurRadius(6);
		effect.setOffset(0);
		rectItem->setGraphicsEffect(&effect);
		
		QPainter painter(&shadow);
		scene.render(&painter);
		painter.end();
		
		_shadowCache.insert(pixmap.size(), shadow);
	}
	
	_thumbnail = shadow;
	QPainter painter(&_thumbnail);
	painter.drawPixmap(pixmapRect.topLeft(), pixmap);
}
开发者ID:h2so5,项目名称:PaintField,代码行数:33,代码来源:thumbnail.cpp

示例10: QLabel

LoadScreen::LoadScreen(QWidget* parent)
	: QLabel(parent)
{
	setCursor(Qt::WaitCursor);
	setStyleSheet("LoadScreen {background: #666 url(':/load.png') no-repeat center;}");

	m_text = new QLabel(this);
	m_text->hide();
	m_text->setCursor(Qt::WaitCursor);
	m_text->setAlignment(Qt::AlignCenter);
	m_text->setStyleSheet("QLabel {color: #d7d7d7; background-color: #1e1e1e; border-top-left-radius: 0.25em; border-top-right-radius: 0.25em; padding: 0.25em 0.5em;}");

	QVBoxLayout* layout = new QVBoxLayout(this);
	layout->setMargin(0);
	layout->addStretch();
	layout->addWidget(m_text, 0, Qt::AlignCenter);

	m_hide_effect = new QGraphicsOpacityEffect(this);
	m_hide_effect->setOpacity(1.0);
	setGraphicsEffect(m_hide_effect);

	m_hide_timer = new QTimer(this);
	m_hide_timer->setInterval(30);
	connect(m_hide_timer, SIGNAL(timeout()), this, SLOT(fade()));
}
开发者ID:Fusion,项目名称:focuswriter,代码行数:25,代码来源:load_screen.cpp

示例11: QGraphicsColorizeEffect

QVariant Pixmap::itemChange(GraphicsItemChange change, const QVariant &value){
    if(change == ItemSelectedHasChanged){
        if(value.toBool()){
            QGraphicsColorizeEffect *effect = new QGraphicsColorizeEffect(this);
            effect->setColor(QColor(0xCC, 0x00, 0x00));
            setGraphicsEffect(effect);
        }else
            setGraphicsEffect(NULL);

        emit selected_changed();
    }else if(change == ItemEnabledHasChanged){
        emit enable_changed();
    }

    return QGraphicsObject::itemChange(change, value);
}
开发者ID:gaodayihao,项目名称:GSanguosha,代码行数:16,代码来源:pixmap.cpp

示例12: QGraphicsDropShadowEffect

void MenuBar::show()
{
    // Add shadow for better readability
    if (! Plasma::WindowEffects::isEffectAvailable(Plasma::WindowEffects::BlurBehind)) {
        QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect();
        shadow->setBlurRadius(5);
        shadow->setOffset(QPointF(1, 1));
        shadow->setColor(Plasma::Theme::defaultTheme()->color(Plasma::Theme::BackgroundColor));
        setGraphicsEffect(shadow);
    } else {
        setGraphicsEffect(0);
    }
    m_hideTimer->start(1000);
    QGraphicsView::show();

}
开发者ID:fluxer,项目名称:kde-workspace,代码行数:16,代码来源:menubar.cpp

示例13: setGraphicsEffect

void CanvasLine::setLineSelected(bool yesno)
{
    if (m_locked)
        return;

    if (options.eyecandy == EYECANDY_FULL)
    {
        if (yesno)
            setGraphicsEffect(new CanvasPortGlow(item1->getPortType(), toGraphicsObject()));
        else
            setGraphicsEffect(0);
    }

    m_lineSelected = yesno;
    updateLineGradient();
}
开发者ID:Houston4444,项目名称:Cadence,代码行数:16,代码来源:canvasline.cpp

示例14: QGraphicsView

WaitWidget::WaitWidget(const QString &message, QWidget *parent):
		QGraphicsView(parent),
		d(new WaitWidgetPrivate)
{
	if ( !message.isEmpty() ) {
		d->m_message = QString("%1\r\n").arg(message);
	}
	createUi();

	// Fondo transparente
	setStyleSheet("background: transparent");
	// Se desactivan las barras
	setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
	setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
	setAttribute(Qt::WA_DeleteOnClose);

	setupScene();
	setScene(&d->m_scene);

	d->m_shadow = new QGraphicsDropShadowEffect(this);
	d->m_shadow->setBlurRadius(5);
	d->m_shadow->setOffset(QPointF(3, 3));
	setGraphicsEffect(d->m_shadow);

	setRenderHint(QPainter::Antialiasing, true);
	setFrameStyle(QFrame::NoFrame);
}
开发者ID:BaconGo,项目名称:alepherp,代码行数:27,代码来源:waitwidget.cpp

示例15: QFrame

TabPreview::TabPreview(QupZilla* mainClass, QWidget* parent)
    : QFrame(parent)
    , p_QupZilla(mainClass)
    , m_pixmap(new QLabel)
    , m_title(new QLabel)
    , m_previewIndex(-1)
    , m_animationsEnabled(true)
{
    m_pixmap->setAlignment(Qt::AlignHCenter);
    m_title->setAlignment(Qt::AlignHCenter);
    m_title->setWordWrap(true);

    QVBoxLayout* layout = new QVBoxLayout(this);
    layout->addWidget(m_pixmap);
    layout->addWidget(m_title);
    layout->setMargin(0);
    layout->setAlignment(Qt::AlignCenter);
    setLayout(layout);

    setBackgroundRole(QPalette::ToolTipBase);
    setForegroundRole(QPalette::ToolTipText);

    setContentsMargins(5, 5, 5, 5);
    setMaximumWidth(250);
    setMaximumHeight(170);

    m_animation =  new QPropertyAnimation(this, "geometry", this);
    m_opacityEffect = new QGraphicsOpacityEffect(this);
    m_opacityAnimation = new QPropertyAnimation(m_opacityEffect, "opacity", this);

    setGraphicsEffect(m_opacityEffect);
    m_opacityEffect->setOpacity(0.0);
}
开发者ID:dagsoftware,项目名称:QupZilla,代码行数:33,代码来源:tabpreview.cpp


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