void QDeclarativeAnchorsPrivate::_q_widgetGeometryChanged()
{
    fillChanged();
    centerInChanged();
    updateHorizontalAnchors();
    updateVerticalAnchors();
}
void QDeclarativeAnchorsPrivate::updateOnComplete()
{
    fillChanged();
    centerInChanged();
    updateHorizontalAnchors();
    updateVerticalAnchors();
}
void QDeclarativeAnchorsPrivate::itemGeometryChanged(QDeclarativeItem *, const QRectF &newG, const QRectF &oldG)
{
    fillChanged();
    centerInChanged();
    if (newG.x() != oldG.x() || newG.width() != oldG.width())
        updateHorizontalAnchors();
    if (newG.y() != oldG.y() || newG.height() != oldG.height())
        updateVerticalAnchors();
}
void QDeclarativeAnchorsPrivate::updateMe()
{
    if (updatingMe) {
        updatingMe = false;
        return;
    }

    fillChanged();
    centerInChanged();
    updateHorizontalAnchors();
    updateVerticalAnchors();
}
void QDeclarativeAnchors::setFill(QGraphicsObject *f)
{
    Q_D(QDeclarativeAnchors);
    if (d->fill == f)
        return;

    if (!f) {
        d->remDepend(d->fill);
        d->fill = f;
        emit fillChanged();
        return;
    }
    if (f != d->item->parentItem() && f->parentItem() != d->item->parentItem()){
        qmlInfo(d->item) << tr("Cannot anchor to an item that isn't a parent or sibling.");
        return;
    }
    d->remDepend(d->fill);
    d->fill = f;
    d->addDepend(d->fill);
    emit fillChanged();
    d->fillChanged();
}
ViewItemDialog::ViewItemDialog(ViewItem *item, QWidget *parent)
    : Dialog(parent), _mode(Single), _item(item) {

  setWindowTitle(tr("Edit View Item"));

  // semi-hack: set the width of the list widget to 15 characters, which is enough
  // to say "X-Axis Markers" in english.  This is better than setting it to a fixed
  // number of pixels, as it scales with font size or screen resolution, but
  // it won't necessairly survive translations, or someone adding a option like
  // "Do something super important", which has more than 15 characters.
  // We have to do it here, before the layout is set, and we don't yet know how
  // what is going into the listWidget.
  _listWidget->setMinimumWidth(_listWidget->fontMetrics().averageCharWidth()*15);

  QWidget *extension = extensionWidget();

  QVBoxLayout *extensionLayout = new QVBoxLayout(extension);
  extensionLayout->setContentsMargins(0, -1, 0, -1);

  _editMultipleWidget = new EditMultipleWidget();
  extensionLayout->addWidget(_editMultipleWidget);

  extension->setLayout(extensionLayout);

  _editMultipleBox = topCustomWidget();

  QHBoxLayout *layout = new QHBoxLayout(_editMultipleBox);

  _tagStringLabel = new QLabel(tr("&Name:"), _editMultipleBox);
  _tagStringLabel->setObjectName("_tagStringLabel");
  _tagString = new QLineEdit(_editMultipleBox);
  connect(_tagString, SIGNAL(textChanged(QString)), this, SLOT(modified()));
  _tagStringLabel->setBuddy(_tagString);

  _editMultipleButton = new QPushButton(tr("Edit Multiple >>"));
  _editMultipleButton->setObjectName("_editMultipleButton");
  connect(_editMultipleButton, SIGNAL(clicked()), this, SLOT(slotEditMultiple()));

  layout->addWidget(_tagStringLabel);
  layout->addWidget(_tagString);
  layout->addWidget(_editMultipleButton);

  _editMultipleBox->setLayout(layout);

  setSupportsMultipleEdit(false);

  if (_item->hasBrush()) {
    _fillTab = new FillTab(this);
    connect(_fillTab, SIGNAL(apply()), this, SLOT(fillChanged()));
  }
  if (_item->hasStroke()) {
    _strokeTab = new StrokeTab(this);
    connect(_strokeTab, SIGNAL(apply()), this, SLOT(strokeChanged()));
  }
  _layoutTab = new LayoutTab(this);
  connect(_layoutTab, SIGNAL(apply()), this, SLOT(layoutChanged()));

  DialogPageTab *page = new DialogPageTab(this);
  page->setPageTitle(tr("Appearance"));
  if (_item->hasBrush()) {
    page->addDialogTab(_fillTab);
  }

  if (_item->hasStroke()) {
    page->addDialogTab(_strokeTab);
  }
  page->addDialogTab(_layoutTab);
  addDialogPage(page);

  if (!_item->customDimensionsTab()) {
    _dimensionsTab = new DimensionsTab(_item, this);
    DialogPage *dimensionsPage = new DialogPage(this);
    dimensionsPage->setPageTitle(tr("Size/Position"));
    dimensionsPage->addDialogTab(_dimensionsTab);
    addDialogPage(dimensionsPage);
    connect(_dimensionsTab, SIGNAL(apply()), this, SLOT(dimensionsChanged()));
  } else {
    _dimensionsTab = 0;
  }

  QList<DialogPage*> dialogPages = _item->dialogPages();
  foreach (DialogPage *dialogPage, dialogPages)
    addDialogPage(dialogPage);

  setupFill();
  setupStroke();
  setupLayout();
  setupDimensions();

  selectDialogPage(page);

  if (!_item->customDimensionsTab()) {
    connect(_dimensionsTab, SIGNAL(tabModified()), this, SLOT(modified()));
  }

  connect(this, SIGNAL(editMultipleMode()), this, SLOT(setMultipleEdit()));
  connect(this, SIGNAL(editSingleMode()), this, SLOT(setSingleEdit()));
  connect(_item, SIGNAL(relativeSizeUpdated()), this, SLOT(setupDimensions()));
  connect(_saveAsDefault, SIGNAL(clicked()), this, SLOT(modified()));

  _saveAsDefault->show();

  _tagStringLabel->setProperty("si","&Name:");
  _editMultipleButton->setProperty("si","Edit Multiple >>");
}
Exemple #7
0
void PieChart::setFill(bool b) {
    if(m_fill == b) { return; }
    m_fill = b;
    update();
    emit fillChanged();
}