void MDeclarativeImplicitSizeItem::setImplicitWidthNotify(const qreal width)
{
    if (implicitWidth() == width)
        return;

    setImplicitWidth(width);
    emit implicitWidthChanged();
}
Esempio n. 2
0
void PageItem::setPageNumber(int number)
{
    if ((m_page && m_viewPort.pageNumber == number) ||
            !m_documentItem ||
            !m_documentItem.data()->isOpened() ||
            number < 0 ||
            (uint)number >= m_documentItem.data()->document()->pages()) {
        return;
    }

    m_viewPort.pageNumber = number;
    m_page = m_documentItem.data()->document()->page(number);

    emit pageNumberChanged();
    emit implicitWidthChanged();
    emit implicitHeightChanged();
    checkBookmarksChanged();
    m_redrawTimer->start();
}
Esempio n. 3
0
IconItem::IconItem(QQuickItem *parent)
    : QQuickItem(parent),
      m_svgIcon(0),
      m_status(Plasma::Svg::Normal),
      m_smooth(false),
      m_active(false),
      m_animated(true),
      m_usesPlasmaTheme(true),
      m_textureChanged(false),
      m_sizeChanged(false),
      m_allowNextAnimation(false),
      m_colorGroup(Plasma::Theme::NormalColorGroup),
      m_animValue(0)
{
    m_animation = new QPropertyAnimation(this);
    connect(m_animation, SIGNAL(valueChanged(QVariant)),
            this, SLOT(valueChanged(QVariant)));
    connect(m_animation, SIGNAL(finished()),
            this, SLOT(animationFinished()));
    m_animation->setTargetObject(this);
    m_animation->setEasingCurve(QEasingCurve::InOutQuad);
    m_animation->setDuration(250); //FIXME from theme

    setFlag(ItemHasContents, true);

    connect(KIconLoader::global(), SIGNAL(iconLoaderSettingsChanged()),
            this, SIGNAL(implicitWidthChanged()));
    connect(KIconLoader::global(), SIGNAL(iconLoaderSettingsChanged()),
            this, SIGNAL(implicitHeightChanged()));

    connect(this, &QQuickItem::enabledChanged,
            this, &IconItem::enabledChanged);

    connect(this, &QQuickItem::windowChanged,
            this, &IconItem::schedulePixmapUpdate);

    //initialize implicit size to the Dialog size
    setImplicitWidth(KIconLoader::global()->currentSize(KIconLoader::Dialog));
    setImplicitHeight(KIconLoader::global()->currentSize(KIconLoader::Dialog));
}