本文整理汇总了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
}
}
示例2: setGraphicsEffect
void SBI_ImagesIcon::updateIcon()
{
if (testCurrentPageWebAttribute(QWebEngineSettings::AutoLoadImages)) {
setGraphicsEffect(0);
}
else {
QGraphicsColorizeEffect* effect = new QGraphicsColorizeEffect(this);
effect->setColor(Qt::gray);
setGraphicsEffect(effect);
}
}
示例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;
}
示例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);
}
示例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();
}
示例6: setGraphicsEffect
void LabelIamge::leaveEvent(QEvent *evt)
{
effect->setOpacity(1.0f);
setGraphicsEffect(effect);
return QLabel::leaveEvent(evt);
}
示例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);
}
示例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" ) );
}
示例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);
}
示例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()));
}
示例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);
}
示例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();
}
示例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();
}
示例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);
}
示例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);
}