Skip to content
Permalink
Browse files

layout

  • Loading branch information
signedav committed Oct 28, 2017
1 parent ae4c811 commit 910b9ea540f8634bc9738b83dc54370aee851c77
@@ -1,11 +1,11 @@
#include "qgsattributerelationedit.h"
#include "ui_qgsattributerelationedit.h"

QgsAttributeRelationEdit::QgsAttributeRelationEdit(const QString &relationid, QWidget *parent) :
QWidget(parent),
QgsAttributeRelationEdit::QgsAttributeRelationEdit( const QString &relationid, QWidget *parent ) :
QWidget( parent ),
mRelationId( relationid )
{
setupUi(this);
setupUi( this );
}

QgsAttributeRelationEdit::~QgsAttributeRelationEdit()
@@ -202,9 +202,7 @@ class APP_EXPORT QgsAttributeTypeDialog: public QWidget, private Ui::QgsAttribut
* \param index index of value in combobox
*/
void onCurrentWidgetChanged( int index );

//removed selectionListWidget: void selectionListWidget_currentRowChanged( int index );


void defaultExpressionChanged();

void showHelp();
@@ -7,7 +7,7 @@ QgsSourceFieldsProperties::QgsSourceFieldsProperties( QgsVectorLayer *layer, QWi
if ( !layer )
return;

setupUi(this);
setupUi( this );

//button appearance
mAddAttributeButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionNewAttribute.svg" ) ) );
@@ -136,19 +136,19 @@ void QgsSourceFieldsProperties::attributeAdded( int idx )
if ( sorted )
mFieldsList->setSortingEnabled( true );

for( int i = 0; i < 7/*mFieldsList->columnCount()*/; i++ ){
for( int i = 0; i < 7; i++ ){ // mFieldsList->columnCount()
switch ( mLayer->fields().fieldOrigin( idx ) )
{
case QgsFields::OriginExpression:
mFieldsList->item(idx,i)->setBackgroundColor(QColor(200, 200, 255));
mFieldsList->item( idx, i )->setBackgroundColor( QColor( 200, 200, 255 ) );
break;

case QgsFields::OriginJoin:
mFieldsList->item(idx,i)->setBackgroundColor(QColor(200, 255, 200));
mFieldsList->item( idx, i )->setBackgroundColor( QColor( 200, 255, 200 ) );
break;

default:
mFieldsList->item(idx,i)->setBackgroundColor(QColor(255, 255, 200));
mFieldsList->item( idx, i )->setBackgroundColor( QColor( 255, 255, 200 ) );
break;
}
}
@@ -267,7 +267,8 @@ void QgsSourceFieldsProperties::editingToggled()
updateFieldRenamingStatus();
}

void QgsSourceFieldsProperties::addAttributeClicked(){
void QgsSourceFieldsProperties::addAttributeClicked()
{
QgsAddAttrDialog dialog( mLayer, this );
if ( dialog.exec() == QDialog::Accepted )
{
@@ -276,7 +277,8 @@ void QgsSourceFieldsProperties::addAttributeClicked(){
}
}

void QgsSourceFieldsProperties::deleteAttributeClicked(){
void QgsSourceFieldsProperties::deleteAttributeClicked()
{
QSet<int> providerFields;
QSet<int> expressionFields;
Q_FOREACH ( QTableWidgetItem *item, mFieldsList->selectedItems() )
@@ -307,7 +309,8 @@ void QgsSourceFieldsProperties::deleteAttributeClicked(){
}
}

void QgsSourceFieldsProperties::calculateFieldClicked(){
void QgsSourceFieldsProperties::calculateFieldClicked()
{
if ( !mLayer )
{
return;
@@ -25,7 +25,6 @@
#include <QSpinBox>
#include <QTreeWidgetItem>
#include <QDropEvent>
#include <QPushButton>
#include <QTableWidgetItem>
#include <QMessageBox>
#include <QFileDialog>
@@ -55,7 +54,8 @@ class APP_EXPORT QgsSourceFieldsProperties : public QWidget, private Ui_QgsSourc
void loadRows();
void setRow( int row, int idx, const QgsField &field );

/** Adds an attribute to the table (but does not commit it yet)
/**
* Adds an attribute to the table (but does not commit it yet)
\param field the field to add
\returns false in case of a name conflict, true in case of success */
bool addAttribute( const QgsField &field );
@@ -94,18 +94,18 @@ class APP_EXPORT QgsSourceFieldsProperties : public QWidget, private Ui_QgsSourc

private slots:

void updateExpression();
void updateExpression();

//! Editing of layer was toggled
void editingToggled();
void addAttributeClicked();
void deleteAttributeClicked();
void calculateFieldClicked();

//! Editing of layer was toggled
void editingToggled();
void addAttributeClicked();
void deleteAttributeClicked();
void calculateFieldClicked();

void attributeAdded( int idx );
void attributeDeleted( int idx );
void attributeAdded( int idx );
void attributeDeleted( int idx );

void attributesListCellChanged( int row, int column );
void attributesListCellChanged( int row, int column );

};

0 comments on commit 910b9ea

Please sign in to comment.
You can’t perform that action at this time.