Esempio n. 1
0
void TopMenu::setCheckedButton(bool value)
{
    if (value)
    {
        unSelectAll();
        TopMenuButton* _sender = qobject_cast<TopMenuButton*>(sender());
        _sender->setChecked(true);
        CursorMode::Mode curMode = CursorMode::Move;
        if(sender() == addLineButton)
            curMode = CursorMode::AddLine;
        else if(sender() == addRectButton)
            curMode = CursorMode::AddRect;
        else if(sender() == addTagButton)
            curMode = CursorMode::AddTag;
        else if(sender() == addPinButton)
            curMode = CursorMode::AddPin;
        emit setCursorModeSignal(curMode);
    }
    else
    {
        unSelectAll();
        moveButton->setChecked(true);
        emit setCursorModeSignal(CursorMode::Move);
    }
}
Esempio n. 2
0
	void Hand::insert(vector<Card> inCards){
		//for(int i=0; i<inCards.size(); i++) inCards[i].setSelect(false);
		handList.insert(handList.end(),inCards.begin(),inCards.end());
		numCards += inCards.size();
		sort(handList.begin(), handList.end(), compare);
		unSelectAll();
	}
Esempio n. 3
0
void TopMenu::setCursorModeSlot(CursorMode::Mode value)
{
    unSelectAll();
    if (value == CursorMode::Move)
        moveButton->setChecked(true);
    else if (value == CursorMode::AddLine)
        addLineButton->setChecked(true);
    else if (value == CursorMode::AddRect)
        addRectButton->setChecked(true);
    else if (value == CursorMode::AddTag)
        addTagButton->setChecked(true);
    else if (value == CursorMode::AddPin)
        addPinButton->setChecked(true);
}
Esempio n. 4
0
void SensorsConfig::menu(KListView *, QListViewItem *, const QPoint &)
{
  m_popupMenu = new QPopupMenu(this);

  m_popupMenu->insertItem(i18n("Select All"), 1);
  m_popupMenu->insertItem(i18n("Unselect All"), 2);
  m_popupMenu->insertItem(i18n("Invert Selection"), 3);

  switch (m_popupMenu->exec(QCursor::pos())) {
    case 1:
      selectAll();
      break;
    case 2:
      unSelectAll();
      break;
    case 3:
      invertSelect();
      break;
  }

  delete m_popupMenu;
}
Esempio n. 5
0
QgsDxfExportDialog::QgsDxfExportDialog( const QList<QgsMapLayer*>& layerKeys, QWidget* parent, Qt::WindowFlags f ): QDialog( parent, f )
{
  setupUi( this );
  connect( mFileLineEdit, SIGNAL( textChanged( const QString& ) ), this, SLOT( setOkEnabled() ) );
  connect( this, SIGNAL( accepted() ), this, SLOT( saveSettings() ) );
  connect( mSelectAllButton, SIGNAL( clicked() ), this, SLOT( selectAll() ) );
  connect( mUnSelectAllButton, SIGNAL( clicked() ), this, SLOT( unSelectAll() ) );

  QList<QgsMapLayer*>::const_iterator layerIt = layerKeys.constBegin();
  for ( ; layerIt != layerKeys.constEnd(); ++layerIt )
  {
    QgsMapLayer* layer = *layerIt;
    if ( layer )
    {
      if ( layer->type() == QgsMapLayer::VectorLayer )
      {
        QgsVectorLayer* vl = dynamic_cast<QgsVectorLayer*>( layer );
        if ( !vl->hasGeometryType() )
          continue;
        QListWidgetItem* layerItem = new QListWidgetItem( layer->name() );
        layerItem->setData( Qt::UserRole, layer->id() );
        layerItem->setFlags( Qt::ItemIsEnabled | Qt::ItemIsUserCheckable );
        layerItem->setCheckState( Qt::Checked );
        mLayersListWidget->addItem( layerItem );
      }
    }
  }

  //last dxf symbology mode
  QSettings s;
  mSymbologyModeComboBox->setCurrentIndex( s.value( "qgis/lastDxfSymbologyMode", "2" ).toInt() );
  //last symbol scale
  mSymbologyScaleLineEdit->setText( s.value( "qgis/lastSymbologyExportScale", "50000" ).toString() );

  buttonBox->button( QDialogButtonBox::Ok )->setEnabled( false );
}