Exemple #1
0
void Highlight::setItem(QQuickItem *item)
{
    if (m_item)
        m_item->disconnect(this);

    if (item) {
        connect(item, SIGNAL(xChanged()), SLOT(adjust()));
        connect(item, SIGNAL(yChanged()), SLOT(adjust()));
        connect(item, SIGNAL(widthChanged()), SLOT(adjust()));
        connect(item, SIGNAL(heightChanged()), SLOT(adjust()));
        connect(item, SIGNAL(rotationChanged()), SLOT(adjust()));
        connect(item, SIGNAL(transformOriginChanged(TransformOrigin)),
                SLOT(adjust()));
    }
    QQuickWindow *view = item->window();
    QQuickItem * contentItem = view->contentItem();
    if (contentItem) {
        connect(contentItem, SIGNAL(xChanged()), SLOT(adjust()));
        connect(contentItem, SIGNAL(yChanged()), SLOT(adjust()));
        connect(contentItem, SIGNAL(widthChanged()), SLOT(adjust()));
        connect(contentItem, SIGNAL(heightChanged()), SLOT(adjust()));
        connect(contentItem, SIGNAL(rotationChanged()), SLOT(adjust()));
        connect(contentItem, SIGNAL(transformOriginChanged(TransformOrigin)),
                SLOT(adjust()));
    }
    m_item = item;
    setContentsSize(view->size());
    adjust();
}
Exemple #2
0
void ShaderEffectSource::setSourceItem(QDeclarativeItem *item)
{
    if (item == m_sourceItem)
        return;

    if (m_sourceItem) {
        disconnect(m_sourceItem, SIGNAL(widthChanged()), this, SLOT(markSourceSizeDirty()));
        disconnect(m_sourceItem, SIGNAL(heightChanged()), this, SLOT(markSourceSizeDirty()));

        if (m_refs)
            detachSourceItem();
    }

    m_sourceItem = item;

    if (m_sourceItem) {

        // Must have some item as parent
        if (m_sourceItem->parentItem() == 0)
            m_sourceItem->setParentItem(this);

        if (m_refs)
            attachSourceItem();

        connect(m_sourceItem, SIGNAL(widthChanged()), this, SLOT(markSourceSizeDirty()));
        connect(m_sourceItem, SIGNAL(heightChanged()), this, SLOT(markSourceSizeDirty()));
    }

    updateSizeAndTexture();
    emit sourceItemChanged();
    emit repaintRequired();
}
void DeclarativeItemContainer::setDeclarativeItem(QDeclarativeItem *item, bool reparent)
{
    if (m_declarativeItem) {
        disconnect(m_declarativeItem.data(), 0, this, 0);
    }
    m_declarativeItem = item;
    if (reparent) {
        static_cast<QGraphicsItem *>(item)->setParentItem(this);
    }
    setMinimumWidth(item->implicitWidth());
    setMinimumHeight(item->implicitHeight());
    resize(item->width(), item->height());
    connect(m_declarativeItem.data(), SIGNAL(widthChanged()), this, SLOT(widthChanged()));
    connect(m_declarativeItem.data(), SIGNAL(heightChanged()), this, SLOT(heightChanged()));

    if (m_declarativeItem.data()->metaObject()->indexOfProperty("minimumWidth") >= 0) {
        QObject::connect(m_declarativeItem.data(), SIGNAL(minimumWidthChanged()), this, SLOT(minimumWidthChanged()));
    }

    if (m_declarativeItem.data()->metaObject()->indexOfProperty("minimumHeight") >= 0) {
        QObject::connect(m_declarativeItem.data(), SIGNAL(minimumHeightChanged()), this, SLOT(minimumHeightChanged()));
    }
    minimumWidthChanged();
    minimumHeightChanged();
}
Exemple #4
0
    QmlMapControl::QmlMapControl (QQuickItem *parent) :
        QQuickPaintedItem(parent)
    {
        setOpaquePainting(true);
        setAcceptHoverEvents(true);
        setAcceptedMouseButtons(Qt::AllButtons);

        layermanager = new LayerManager(this, size);
        screen_middle = QPoint(size.width()/2, size.height()/2);

        mousepressed = false;
        scaleVisible = true;
        crosshairsVisible = true;
        mymousemode = Panning;
        mouse_wheel_events = true;

        connect(ImageManager::instance(), SIGNAL(imageReceived()),
                this, SLOT(updateRequestNew()));

        connect(ImageManager::instance(), SIGNAL(loadingFinished()),
                this, SLOT(loadingFinished()));

        setWidth(size.width()+1);
        setHeight(size.height()+1);

        connect( this, SIGNAL(widthChanged()) , SLOT(sizeChanged()) );
        connect( this, SIGNAL(heightChanged()), SLOT(sizeChanged()) );
    }
Exemple #5
0
void ShapeSideBar::updateForCurrentPropertyChange()
{
	d->rectGroup->setVisible((bool)d->rectLayer);
	d->textGroup->setVisible((bool)d->textLayer);
	
	if (d->rectLayer)
	{
		emit xChanged(d->rectLayer->rect().x());
		emit yChanged(d->rectLayer->rect().y());
		emit widthChanged(d->rectLayer->rect().width());
		emit heightChanged(d->rectLayer->rect().height());
	}
	
	if (d->textLayer)
	{
		if (d->textEdit->toPlainText() != d->textLayer->text())
			d->textEdit->setText(d->textLayer->text());
		
		QFont font = d->textLayer->font();
		QString fontText = font.family() + " / " + font.styleName() + " / " + QString::number(font.pointSize()) + "pt";
		d->fontButton->setText(fontText);
		
		emit fontItalicChanged(font.italic());
		
		auto alignment = d->textLayer->alignment();
		
		for (Qt::Alignment alignElem : { Qt::AlignLeft, Qt::AlignHCenter, Qt::AlignRight, Qt::AlignTop, Qt::AlignVCenter, Qt::AlignBottom })
		{
			if (alignment & alignElem)
				d->alignButtons[alignElem]->setChecked(true);
		}
	}
}
Exemple #6
0
CalcScreen::CalcScreen(QQuickItem *parent) :
    QQuickPaintedItem(parent), m_calc(NULL)
{
//    setFillColor(Qt::color1);
    connect(this, SIGNAL( widthChanged() ), this, SLOT( setLcd() ));
    connect(this, SIGNAL( heightChanged() ), this, SLOT( setLcd() ));
}
/**
 * Constructor.
 */
QG_PenToolBar::QG_PenToolBar( const QString & title, QWidget * parent )
        : QToolBar(title, parent) {

    this->setMinimumWidth(300);
    this->setMaximumWidth(420);

    colorBox = new QG_ColorBox(true, false, this, "colorbox");
    colorBox->setMinimumWidth(64);
    colorBox->setToolTip(tr("Line color"));
    connect(colorBox, SIGNAL(colorChanged(const RS_Color&)),
            this, SLOT(slotColorChanged(const RS_Color&)));

    widthBox = new QG_WidthBox(true, false, this, "widthbox");
    widthBox->setMinimumWidth(64);
    widthBox->setToolTip(tr("Line width"));
    connect(widthBox, SIGNAL(widthChanged(RS2::LineWidth)),
            this, SLOT(slotWidthChanged(RS2::LineWidth)));

    lineTypeBox = new QG_LineTypeBox(true, false, this, "lineTypebox");
    lineTypeBox->setMinimumWidth(64);
    lineTypeBox->setToolTip(tr("Line type"));
    connect(lineTypeBox, SIGNAL(lineTypeChanged(RS2::LineType)),
            this, SLOT(slotLineTypeChanged(RS2::LineType)));

    currentPen.setColor(colorBox->getColor());
    currentPen.setWidth(widthBox->getWidth());
    currentPen.setLineType(lineTypeBox->getLineType());

    addWidget(colorBox);
    addWidget(widthBox);
    addWidget(lineTypeBox);

}
void QchScreenShot::setWidth(int w) {
    if (w != width()) {
        Q_D(QchScreenShot);
        d->width = w;
        emit widthChanged();
    }
}
Exemple #9
0
KWFrameGeometry::KWFrameGeometry(FrameConfigSharedState *state)
        : m_state(state),
        m_frame(0),
        m_topOfPage(0),
        m_blockSignals(false),
        m_originalGeometryLock(false)
{
    m_state->addUser();
    widget.setupUi(this);
    setUnit(m_state->document()->unit());
    widget.width->setMinimum(0.0);
    widget.height->setMinimum(0.0);
    widget.leftMargin->setMinimum(0.0);
    widget.rightMargin->setMinimum(0.0);
    widget.bottomMargin->setMinimum(0.0);
    widget.topMargin->setMinimum(0.0);

    widget.keepAspect->setKeepAspectRatio(m_state->keepAspectRatio());

    connect(widget.leftMargin, SIGNAL(valueChangedPt(qreal)), this, SLOT(syncMargins(qreal)));
    connect(widget.rightMargin, SIGNAL(valueChangedPt(qreal)), this, SLOT(syncMargins(qreal)));
    connect(widget.bottomMargin, SIGNAL(valueChangedPt(qreal)), this, SLOT(syncMargins(qreal)));
    connect(widget.topMargin, SIGNAL(valueChangedPt(qreal)), this, SLOT(syncMargins(qreal)));

    connect(widget.width, SIGNAL(valueChangedPt(qreal)), this, SLOT(widthChanged(qreal)));
    connect(widget.height, SIGNAL(valueChangedPt(qreal)), this, SLOT(heightChanged(qreal)));

    connect(m_state, SIGNAL(keepAspectRatioChanged(bool)), widget.keepAspect, SLOT(setKeepAspectRatio(bool)));
    connect(widget.keepAspect, SIGNAL(keepAspectRatioChanged(bool)), this, SLOT(updateAspectRatio(bool)));

    connect(widget.positionSelector, SIGNAL(positionSelected(KFlake::Position)),
            this, SLOT(setGeometryAlignment(KFlake::Position)));

}
Exemple #10
0
void DriverItem::updateText()
{
    if(m_item)
    {
        QString s(m_item->get("text"));
        if(m_item->isOption())
            s.append(QString::fromLatin1(": <%1>").arg(m_item->prettyText()));
        if(m_item->type() == DrBase::List)
        {
            // remove all children: something has changed (otherwise this
            // function would not be called), so it make sense to remove
            // those children in all cases.
            while(firstChild())
                delete firstChild();
            DrBase *ch = static_cast< DrListOption * >(m_item)->currentChoice();
            if(ch && ch->type() == DrBase::ChoiceGroup)
            {
                // add new children
                static_cast< DrChoiceGroup * >(ch)->createItem(this);
                setOpen(true);
            }
        }
        setText(0, s);
    }
    else
        setText(0, "ERROR");
    widthChanged();
}
Exemple #11
0
GenericCodeEditor::GenericCodeEditor( Document *doc, QWidget *parent ):
    QPlainTextEdit( parent ),
    mDoc(doc),
    mEditorBoxIsActive(false),
    mLastCursorBlock(-1)
{
    Q_ASSERT(mDoc != 0);

    setFrameShape(QFrame::NoFrame);

    viewport()->setAttribute( Qt::WA_MacNoClickThrough, true );

    mLineIndicator = new LineIndicator(this);
    mLineIndicator->move( contentsRect().topLeft() );

    mOverlay = new QGraphicsScene(this);

    QPalette overlayPalette;
    overlayPalette.setBrush(QPalette::Base, Qt::NoBrush);

    QGraphicsView *overlayView = new QGraphicsView(mOverlay, this);
    overlayView->setFrameShape( QFrame::NoFrame );
    overlayView->setPalette(overlayPalette);
    overlayView->setFocusPolicy( Qt::NoFocus );
    overlayView->setAttribute(Qt::WA_TransparentForMouseEvents, true);
    overlayView->setSceneRect(QRectF(0,0,1,1));
    overlayView->setAlignment(Qt::AlignLeft | Qt::AlignTop);

    mOverlayWidget = overlayView;

    mOverlayAnimator = new OverlayAnimator(this, mOverlay);

    connect( mDoc, SIGNAL(defaultFontChanged()), this, SLOT(onDocumentFontChanged()) );

    connect( this, SIGNAL(blockCountChanged(int)),
             mLineIndicator, SLOT(setLineCount(int)) );

    connect( mLineIndicator, SIGNAL( widthChanged() ),
             this, SLOT( updateLayout() ) );

    connect( this, SIGNAL(updateRequest(QRect,int)),
             this, SLOT(updateLineIndicator(QRect,int)) );

    connect( this, SIGNAL(selectionChanged()),
             mLineIndicator, SLOT(update()) );
    connect(this, SIGNAL(selectionChanged()), this, SLOT(updateDocLastSelection()));
    connect( this, SIGNAL(cursorPositionChanged()),
             this, SLOT(onCursorPositionChanged()) );

    connect( Main::instance(), SIGNAL(applySettingsRequest(Settings::Manager*)),
             this, SLOT(applySettings(Settings::Manager*)) );

    QTextDocument *tdoc = doc->textDocument();
    QPlainTextEdit::setDocument(tdoc);
    onDocumentFontChanged();
    doc->setLastActiveEditor(this);

    applySettings( Main::settings() );
}
Exemple #12
0
void MyMenu::setWidth(int arg)
{
    int m_width = menu->width ();
    if (m_width != arg) {
        menu->setFixedWidth (arg);
        emit widthChanged(arg);
    }
}
Exemple #13
0
void MyWindow::setWidth(int arg)
{
    if (m_width != arg&&arg<=maximumWidth ()&&arg>=minimumWidth ()) {
        m_width = arg;
        contentItem ()->setWidth (arg);
        emit widthChanged(arg);
    }
}
Exemple #14
0
void Directory::setPixmap(QPixmap *px)
{
	pix = px;
	setup();
	widthChanged(0);
	invalidateHeight();
	repaint();
}
void ScreenResolutionManager::setWidth(int width)
{
	if (m_width == width)
		return;

	m_width = width;
	emit widthChanged(m_width);
}
/*!
    \internal
*/
void QDeclarativeMapLineProperties::setWidth(qreal width)
{
    if (width_ == width)
        return;

    width_ = width;
    emit widthChanged(width_);
}
void LineGraph::setWidth(int width)
{
    if (m_width == width)
        return;

    m_width = width;
    emit widthChanged(width);
}
Exemple #18
0
void FileItem::setPixmap( QPixmap *p )
{
    pix = p;
    setup();
    widthChanged( 0 );
    invalidateHeight();
    repaint();
}
XYChartBackgroundPainter::XYChartBackgroundPainter(QQuickItem* parent) :
    QQuickPaintedItem(parent),
    m_xyChartCore(0)
{
    setFlag(QQuickItem::ItemHasContents, true);

    connect(this, SIGNAL(widthChanged()), SLOT(triggerUpdate()));
    connect(this, SIGNAL(heightChanged()), SLOT(triggerUpdate()));
}
QDeclarativePolylineMapItem::QDeclarativePolylineMapItem(QQuickItem *parent)
:   QDeclarativeGeoMapItemBase(parent), dirtyMaterial_(true), updatingGeometry_(false)
{
    setFlag(ItemHasContents, true);
    QObject::connect(&line_, SIGNAL(colorChanged(QColor)),
                     this, SLOT(updateAfterLinePropertiesChanged()));
    QObject::connect(&line_, SIGNAL(widthChanged(qreal)),
                     this, SLOT(updateAfterLinePropertiesChanged()));
}
PolygonItem::PolygonItem(QQuickItem *parent) :
	QQuickPaintedItem(parent),
	_color(QColor(255, 255, 255))
{
	setAntialiasing(true);
	connect(this, SIGNAL(widthChanged()), SLOT(onAppearanceChanged()));
	connect(this, SIGNAL(heightChanged()), SLOT(onAppearanceChanged()));
	connect(this, SIGNAL(colorChanged()), SLOT(onAppearanceChanged()));
}
Exemple #22
0
void Field::setWidth(int width)
{
    if (m_width == width) {
        return;
    }

    m_width = width;
    emit widthChanged(width);
}
void InputRegion::setWidth(qreal width)
{
    Q_D(InputRegion);
    if (d->width != width) {
        d->width = width;
        d->scheduleUpdate();
        emit widthChanged();
    }
}
Exemple #24
0
void saveAbleImage::setWidth(int width)
{
    qDebug() <<"width : "<< width;
    if(width_ != width){
        width_ = width;

        emit widthChanged();
    }
}
QDeclarativeRectangleMapItem::QDeclarativeRectangleMapItem(QQuickItem *parent)
:   QDeclarativeGeoMapItemBase(parent), color_(Qt::transparent), dirtyMaterial_(true)
{
    setFlag(ItemHasContents, true);
    QObject::connect(&border_, SIGNAL(colorChanged(QColor)),
                     this, SLOT(updateMapItemAssumeDirty()));
    QObject::connect(&border_, SIGNAL(widthChanged(qreal)),
                     this, SLOT(updateMapItemAssumeDirty()));
}
void BooksListWatcher::setListView(QQuickItem* aView)
{
    if (iListView != aView) {
        const QSize oldSize(iSize);
        if (iListView) iListView->disconnect(this);
        iListView = aView;
        if (iListView) {
            connect(iListView,
                SIGNAL(widthChanged()),
                SLOT(onWidthChanged()));
            connect(iListView,
                SIGNAL(heightChanged()),
                SLOT(onHeightChanged()));
            connect(iListView,
                SIGNAL(contentXChanged()),
                SLOT(onContentXChanged()));
            connect(iListView,
                SIGNAL(contentYChanged()),
                SLOT(onContentYChanged()));
            connect(iListView,
                SIGNAL(contentWidthChanged()),
                SLOT(onContentSizeChanged()));
            connect(iListView,
                SIGNAL(contentHeightChanged()),
                SLOT(onContentSizeChanged()));
            iContentX = contentX();
            iContentY = contentY();
            updateCurrentIndex();
        } else {
            iContentX = iContentY = 0;
            iSize = QSize(0,0);
        }
        Q_EMIT listViewChanged();
        if (oldSize != iSize) {
            Q_EMIT sizeChanged();
        }
        if (oldSize.width() != iSize.width()) {
            Q_EMIT widthChanged();
        }
        if (oldSize.height() != iSize.height()) {
            Q_EMIT heightChanged();
        }
    }
}
/*!
    \internal
*/
void QDeclarativeGeoMapQuickItem::setMap(QDeclarativeGeoMap *quickMap, QGeoMap *map)
{
    QDeclarativeGeoMapItemBase::setMap(quickMap,map);
    if (map && quickMap) {
        QObject::connect(quickMap, SIGNAL(heightChanged()), this, SLOT(updateMapItem()));
        QObject::connect(quickMap, SIGNAL(widthChanged()), this, SLOT(updateMapItem()));
        QObject::connect(map, SIGNAL(cameraDataChanged(QGeoCameraData)), this, SLOT(updateMapItem()));
        updateMapItem();
    }
}
void QQuickPopupWindow::setPopupContentItem(QQuickItem *contentItem)
{
    if (!contentItem)
        return;

    contentItem->setParentItem(this->contentItem());
    connect(contentItem, SIGNAL(widthChanged()), this, SLOT(updateSize()));
    connect(contentItem, SIGNAL(heightChanged()), this, SLOT(updateSize()));
    m_contentItem = contentItem;
}
Exemple #29
0
void FilterWidget::setWidth(int w)
{
    if (w == ui->mSpinWidth->value())
        return;

    mEmitSignals = false;
    ui->mSpinWidth->setValue(w);
    mEmitSignals = true;

    emit widthChanged(w);
}
Exemple #30
0
void DotMatrixRepresentation::setWidth(int w)
{
	if(isw->getWidth() != w){
		isw->blockSignals(true);
		isw->setWidth(w);
		isw->blockSignals(false);

		dmWidget->setWidth(w);
		emit sizeChanged(QSize(w, isw->height()));
		emit widthChanged(w);
	}
}