void QgsScaleBarPluginGui::on_buttonBox_accepted()
{
  hide();
  emit changePlacement( cboPlacement->currentIndex() );
  emit changePreferredSize( spnSize->value() );
  emit changeSnapping( chkSnapping->isChecked() );
  emit changeEnabled( chkEnable->isChecked() );
  emit changeStyle( cboStyle->currentIndex() );
  emit changeColor( pbnChangeColor->color() );
  emit refreshCanvas();
  accept();
}
Beispiel #2
0
void MultiStepRangeBackgroundItem::contextMenuEvent(
  QGraphicsSceneContextMenuEvent *event)
{
  QMenu menu;

  PlacementData placementData = meta->LPub.multiStep.placement.value();

  QString name = "Move These Steps";
  QAction *placementAction = menu.addAction(name);
  placementAction->setWhatsThis(commonMenus.naturalLanguagePlacementWhatsThis(
    StepGroupType,placementData,name));

  QAction *perStepAction = menu.addAction(
    meta->LPub.multiStep.pli.perStep.value() ?
      "No Parts List per Step" :
      "Parts List per Step");

  QAction *allocAction;
  
  if (page->allocType() == Vertical) {
    allocAction = menu.addAction("Display as Rows");
    allocAction->setWhatsThis(
      "Display as Rows:\n"
      "  Change this whole set of steps from columns of steps\n"
      "  to rows of steps");
  } else {
    allocAction = menu.addAction("Display as Columns");
    allocAction->setWhatsThis(
      "Display as Columns:\n"
      "  Change this whole set of steps from rows of steps\n"
      "  to columns of steps");
  }

  QAction *marginAction = menu.addAction("Change Step Group Margins");

  marginAction->setWhatsThis("Change Step Group Margins:\n"
                             "  Margins are the empty space around this group of steps.\n"
                             "  You can change the margins if things are too close together,\n"
                             "  or too far apart. You can change the things in this group of\n"
                             "  steps by putting your mouse cursor over them, and clicking\n"
                             "  the menu button\n");

  QAction *selectedAction = menu.exec(event->screenPos());

  if (selectedAction == placementAction) {
    changePlacement(PageType,
                    relativeType,
                    "Step Group Placement",
                    page->topOfSteps(),
                    page->bottomOfSteps(),
                    &meta->LPub.multiStep.placement,
                    true,1,false);
  } else if (selectedAction == perStepAction) {
    changeBool(page->topOfSteps(),
               page->bottomOfSteps(),
              &meta->LPub.multiStep.pli.perStep,true,1,false,false);
  } else if (selectedAction == marginAction) {
    changeMargins("Step Group Margins",
                  page->topOfSteps(),
                  page->bottomOfSteps(),
                  margin);
  } else if (selectedAction == allocAction) {
    changeAlloc(page->topOfSteps(),
                page->bottomOfSteps(),
                page->allocMeta());
  }
}