Example #1
0
CQLayerOptionTool::
CQLayerOptionTool(CQIllustrator *illustrator) :
 CQOptionTool(), illustrator_(illustrator), dialog_(0)
{
  dialog_ = new CQLayerOptionDialog(this);

  QVBoxLayout *layout = new QVBoxLayout(this);
  layout->setMargin(0); layout->setSpacing(0);

  QLabel *label = new QLabel("<small><b>Layer</b></small>");

  layout->addWidget(label);

  label_ = new QLabel;

  QFontMetrics fm(font());

  int width = fm.width("ABCDEFGHIJKLM");

  label_->setMinimumWidth(width);

  layout->addWidget(label_);

  connect(dialog_, SIGNAL(valueChanged(const QString &)),
          this, SIGNAL(valueChanged(const QString &)));

  connect(this, SIGNAL(poppingUp()), this, SLOT(populateSlot()));

  //------

  updateLayer();
}
Example #2
0
void MailLayer::fujianBtnCallBack( CCObject* pSender )
{
	if (layerNum == MAILLAYER_TAG_WRITE)
	{
		layerNum = MAILLAYER_TAG_FUJIAN;
		updateLayer();
	}
}
Example #3
0
void MailLayer::writeBtnCallBack( CCObject* pSender )
{
	if (layerNum == MAILLAYER_TAG_MAIL)
	{
		layerNum = MAILLAYER_TAG_WRITE;
		updateLayer();
	}
}
Example #4
0
void MailLayer::scroCallBack( CCObject* pSender )
{
	UIButton* tempPanel = dynamic_cast<UIButton*>(pSender);
	int temp = tempPanel->getTag();

// 	UIScrollView* scroV = dynamic_cast<UIScrollView*>(m_mailLayout->getChildByName("ScrollView"));
// 	UIButton* scroPanel[5];
// 	for (int i = 0; i < 5; i++)
// 	{
// 		scroPanel[i] = dynamic_cast<Layout*>(scroV->getChildByName(CCString::createWithFormat("Panel_%d", i)->getCString()));
// 		scroPanel[i]->setBackGroundColor(ccc3(150,200,255));
// 	}
// 	
// 	scroPanel[temp % 100]->setBackGroundColor(ccc3(255,20,255));

	layerNum = MAILLAYER_TAG_RECEIVE;
	updateLayer();
}
QgsBullsEyeWidget::QgsBullsEyeWidget( QgsMapCanvas *canvas, QgsLayerTreeView* layerTreeView )
    : QgsBottomBar( canvas ), mLayerTreeView( layerTreeView )
{
  setLayout( new QHBoxLayout );
  layout()->setSpacing( 10 );

  QWidget* base = new QWidget();
  ui.setupUi( base );
  layout()->addWidget( base );

  QPushButton* closeButton = new QPushButton();
  closeButton->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
  closeButton->setIcon( QIcon( ":/images/themes/default/mIconClose.png" ) );
  closeButton->setToolTip( tr( "Close" ) );
  connect( closeButton, SIGNAL( clicked( bool ) ), this, SIGNAL( close() ) );
  layout()->addWidget( closeButton );
  layout()->setAlignment( closeButton, Qt::AlignTop );

  ui.comboBoxLabels->addItem( tr( "Disabled" ), static_cast<int>( QgsBullsEyeLayer::NO_LABELS ) );
  ui.comboBoxLabels->addItem( tr( "Axes" ), static_cast<int>( QgsBullsEyeLayer::LABEL_AXES ) );
  ui.comboBoxLabels->addItem( tr( "Rings" ), static_cast<int>( QgsBullsEyeLayer::LABEL_RINGS ) );
  ui.comboBoxLabels->addItem( tr( "Axes and rings" ), static_cast<int>( QgsBullsEyeLayer::LABEL_AXES_RINGS ) );

  connect( ui.toolButtonAddLayer, SIGNAL( clicked( bool ) ), this, SLOT( createLayer() ) );
  connect( ui.inputCenter, SIGNAL( coordinateChanged() ), this, SLOT( updateLayer() ) );
  connect( ui.toolButtonPickCenter, SIGNAL( clicked( bool ) ), this, SIGNAL( requestPickCenter() ) );
  connect( ui.spinBoxRings, SIGNAL( valueChanged( int ) ), this, SLOT( updateLayer() ) );

  connect( ui.spinBoxRingInterval, SIGNAL( valueChanged( double ) ), this, SLOT( updateLayer() ) );
  connect( ui.spinBoxAxesInterval, SIGNAL( valueChanged( double ) ), this, SLOT( updateLayer() ) );

  connect( ui.toolButtonColor, SIGNAL( colorChanged( QColor ) ), this, SLOT( updateColor( QColor ) ) );
  connect( ui.spinBoxFontSize, SIGNAL( valueChanged( int ) ), this, SLOT( updateFontSize( int ) ) );
  connect( ui.comboBoxLabels, SIGNAL( currentIndexChanged( int ) ), this, SLOT( updateLabeling( int ) ) );
  connect( ui.spinBoxLineWidth, SIGNAL( valueChanged( int ) ), this, SLOT( updateLineWidth( int ) ) );

  connect( QgsMapLayerRegistry::instance(), SIGNAL( layersAdded( QList<QgsMapLayer*> ) ), this, SLOT( repopulateLayers() ) );
  connect( QgsMapLayerRegistry::instance(), SIGNAL( layersRemoved( QStringList ) ), this, SLOT( repopulateLayers() ) );
  connect( mCanvas, SIGNAL( currentLayerChanged( QgsMapLayer* ) ), this, SLOT( updateSelectedLayer( QgsMapLayer* ) ) );

  repopulateLayers();
  connect( ui.comboBoxLayer, SIGNAL( currentIndexChanged( int ) ), this, SLOT( currentLayerChanged( int ) ) );
}
Example #6
0
RectTool::RectTool(AddingType type, Canvas *canvas) :
	Tool(canvas),
	d(new Data)
{
	d->layerController = canvas->findChild<LayerUIController *>();
	d->updateManager = new CanvasUpdateManager(this);
	connect(d->updateManager, SIGNAL(updateTilesRequested(QPointSet)), this, SIGNAL(requestUpdate(QPointSet)));
	
	// set modes
	
	d->addingType = type;
	
	if (d->addingType == NoAdding)
		d->selectingMode = SelectImmediately;
	else
		d->selectingMode = SelectLater;
	
	// create graphics items
	{
		auto group = new QGraphicsItemGroup();
		group->setHandlesChildEvents(false);
		setGraphicsItem(group);
		
		{
			auto frame = new FrameGraphicsItem(group);
			d->frameItem = frame;
		}
	}
	
	addHandle(Top | Left, 1);
	addHandle(Top | Right, 1);
	addHandle(Bottom | Left, 1);
	addHandle(Bottom | Right, 1);
	addHandle(Top, 0);
	addHandle(Bottom, 0);
	addHandle(Left, 0);
	addHandle(Right, 0);
	
	connect(layerScene(), SIGNAL(selectionChanged(QList<LayerConstRef>,QList<LayerConstRef>)), this, SLOT(updateSelected()));
	connect(layerScene(), SIGNAL(layerChanged(LayerConstRef)), this, SLOT(updateLayer(LayerConstRef)));
	connect(canvas, SIGNAL(transformsChanged(SP<const CanvasTransforms>)), this, SLOT(updateGraphicsItems()));
	updateSelected();
}
Example #7
0
void MailLayer::closeBtnCallBack(CCObject* pSender)
{
	switch(layerNum){
	case MAILLAYER_TAG_MAIL:
		{
			m_Mediator->dispose();
		}break;
	case MAILLAYER_TAG_WRITE:
	case MAILLAYER_TAG_RECEIVE:
	case MAILLAYER_TAG_FUJIAN:
		{
			layerNum = MAILLAYER_TAG_MAIL;
			updateLayer();
		}break;
	default:
		break;
	}

}
Example #8
0
void QgsLegendModel::updateItem( QStandardItem* item )
{
  if ( !item )
  {
    return;
  }

  //only layer items are supported for update
  QgsComposerLegendItem* cItem = dynamic_cast<QgsComposerLegendItem*>( item );
  if ( ! cItem )
  {
    return;
  }

  QgsComposerLegendItem::ItemType type = cItem->itemType();
  if ( type == QgsComposerLegendItem::LayerItem )
  {
    updateLayer( cItem );
  }
}