void PreviewLabel::mouseReleaseEvent(QMouseEvent * event) { if (!m_borderImage) return QLabel::mouseMoveEvent(event); if (m_dragging_left || m_dragging_top || m_dragging_right|| m_dragging_bottom) { m_hooverInfo->hide(); if (m_dragging_left) emit leftMarginChanged(); if (m_dragging_top) emit topMarginChanged(); if (m_dragging_bottom) emit bottomMarginChanged(); if (m_dragging_right) emit rightMarginChanged(); m_dragging_left = false; m_dragging_top = false; m_dragging_right = false; m_dragging_bottom = false; QApplication::restoreOverrideCursor(); event->accept(); } else { QLabel::mouseReleaseEvent(event); } }
ParagraphIndentSpacing::ParagraphIndentSpacing(QWidget *parent) : QWidget(parent), m_fontMetricsChecked(false) { widget.setupUi(this); connect(widget.first, SIGNAL(valueChangedPt(qreal)), this, SLOT(firstLineMarginChanged(qreal))); connect(widget.left, SIGNAL(valueChangedPt(qreal)), this, SLOT(leftMarginChanged(qreal))); connect(widget.right, SIGNAL(valueChangedPt(qreal)), this, SLOT(rightMarginChanged(qreal))); // Keep order in sync with lineSpacingType() and display() widget.lineSpacing->addItem(i18nc("Line spacing value", "Single")); widget.lineSpacing->addItem(i18nc("Line spacing value", "1.5 Lines")); widget.lineSpacing->addItem(i18nc("Line spacing value", "Double")); widget.lineSpacing->addItem(i18nc("Line spacing type", "Proportional")); // called Proportional like in OO widget.lineSpacing->addItem(i18nc("Line spacing type", "Additional")); // normal distance + absolute value widget.lineSpacing->addItem(i18nc("Line spacing type", "Fixed")); widget.lineSpacing->addItem(i18nc("Line spacing type", "At least")); connect(widget.first, SIGNAL(valueChangedPt(qreal)), this, SLOT(firstIndentValueChanged())); connect(widget.left, SIGNAL(valueChangedPt(qreal)), this, SLOT(leftMarginValueChanged())); connect(widget.right, SIGNAL(valueChangedPt(qreal)), this, SLOT(rightMarginValueChanged())); connect(widget.after, SIGNAL(valueChangedPt(qreal)), this, SLOT(bottomMarginValueChanged())); connect(widget.before, SIGNAL(valueChangedPt(qreal)), this, SLOT(topMarginValueChanged())); connect(widget.lineSpacing, SIGNAL(currentIndexChanged(int)), this, SLOT(lineSpacingChanged(int))); connect(widget.useFont, SIGNAL(toggled(bool)), this, SLOT(useFontMetrices(bool))); connect(widget.autoTextIndent, SIGNAL(stateChanged(int)), this, SLOT(autoTextIndentChanged(int))); connect(widget.proportional, SIGNAL(valueChanged(int)), this, SLOT(spacingPercentChanged())); connect(widget.custom, SIGNAL(valueChangedPt(qreal)), this, SLOT(spacingValueChanged())); lineSpacingChanged(0); }
void QDeclarativeAnchors::setLeftMargin(qreal offset) { Q_D(QDeclarativeAnchors); if (d->leftMargin == offset) return; d->leftMargin = offset; if(d->fill) d->fillChanged(); else d->updateHorizontalAnchors(); emit leftMarginChanged(); }
void ToolbarMenu::showEvent(QShowEvent *e) { Q_UNUSED(e); QAction *a = MainWindow::instance()->getAction("stopafterthis"); QStyleOptionMenuItem option; initStyleOption(&option, a); int leftMargin = option.maxIconWidth; #ifdef APP_WIN leftMargin *= 1.5; #endif setStyleSheet("QToolBar > QToolButton[first] {margin-left:" + QString::number(leftMargin) + "px}"); emit leftMarginChanged(leftMargin); }
ParagraphGeneral::ParagraphGeneral(QWidget *parent) : QWidget(parent), m_blockSignals(false), m_nameHidden(false), m_style(0) { widget.setupUi(this); //Disable for now //inherit style widget.label_3->setVisible(false); widget.inheritStyle->setVisible(false); //use named charStyle widget.useCharacterStyle->setVisible(false); widget.label_4->setVisible(false); widget.characterStyle->setVisible(false); //include in TOC widget.inToc->setVisible(false); // m_paragraphIndentSpacing = new ParagraphIndentSpacing(this); widget.tabs->addTab(m_paragraphIndentSpacing, i18n("Indent/Spacing")); connect(m_paragraphIndentSpacing, SIGNAL(firstLineMarginChanged(qreal)), widget.preview, SLOT(setFirstLineMargin(qreal))); connect(m_paragraphIndentSpacing, SIGNAL(leftMarginChanged(qreal)), widget.preview, SLOT(setLeftMargin(qreal))); connect(m_paragraphIndentSpacing, SIGNAL(rightMarginChanged(qreal)), widget.preview, SLOT(setRightMargin(qreal))); connect(m_paragraphIndentSpacing, SIGNAL(lineSpacingChanged(qreal,qreal,qreal,int,bool)), widget.preview, SLOT(setLineSpacing(qreal,qreal,qreal,int,bool))); m_paragraphLayout = new ParagraphLayout(this); widget.tabs->addTab(m_paragraphLayout, i18n("General Layout")); connect(m_paragraphLayout, SIGNAL(horizontalAlignmentChanged(Qt::Alignment)), this, SLOT(horizontalAlignmentChanged(Qt::Alignment))); m_paragraphBulletsNumbers = new ParagraphBulletsNumbers(this); widget.tabs->addTab(m_paragraphBulletsNumbers, i18n("Bullets/Numbers")); connect(m_paragraphBulletsNumbers, SIGNAL(bulletListItemChanged(const QString&)), this, SLOT(bulletListItemChanged(const QString&))); m_paragraphDecorations = new ParagraphDecorations(this); widget.tabs->addTab(m_paragraphDecorations, i18n("Decorations")); connect(m_paragraphDecorations, SIGNAL(backgroundColorChanged(const QColor&)), this, SLOT(backgroundColorChanged(const QColor&))); widget.preview->setText(QString("Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.")); connect(widget.name, SIGNAL(textChanged(const QString &)), this, SIGNAL(nameChanged(const QString&))); connect(widget.name, SIGNAL(textChanged(const QString &)), this, SLOT(setName(const QString&))); }
void AnchorsBase::setLeftMargin(int leftMargin) { Q_D(AnchorsBase); if (d->leftMargin == leftMargin) { return; } d->leftMargin = leftMargin; if (d->fill->target()) { updateFill(); } else if (isBinding(d->left)) { updateHorizontal(); } emit leftMarginChanged(leftMargin); }
/** * @brief cwSceneToImageTask::setLeftMargin * @param leftMargin */ void cwSceneToImageTask::setLeftMargin(double leftMargin) { if(LeftMargin != leftMargin) { LeftMargin = leftMargin; emit leftMarginChanged(); } }