Skip to content

Commit

Permalink
layout
Browse files Browse the repository at this point in the history
  • Loading branch information
signedav committed Oct 28, 2017
1 parent ae4c811 commit 910b9ea
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 26 deletions.
6 changes: 3 additions & 3 deletions src/app/qgsattributerelationedit.cpp
@@ -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()
Expand Down
4 changes: 1 addition & 3 deletions src/app/qgsattributetypedialog.h
Expand Up @@ -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();
Expand Down
19 changes: 11 additions & 8 deletions src/app/qgssourcefieldsproperties.cpp
Expand Up @@ -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" ) ) );
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -267,7 +267,8 @@ void QgsSourceFieldsProperties::editingToggled()
updateFieldRenamingStatus();
}

void QgsSourceFieldsProperties::addAttributeClicked(){
void QgsSourceFieldsProperties::addAttributeClicked()
{
QgsAddAttrDialog dialog( mLayer, this );
if ( dialog.exec() == QDialog::Accepted )
{
Expand All @@ -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() )
Expand Down Expand Up @@ -307,7 +309,8 @@ void QgsSourceFieldsProperties::deleteAttributeClicked(){
}
}

void QgsSourceFieldsProperties::calculateFieldClicked(){
void QgsSourceFieldsProperties::calculateFieldClicked()
{
if ( !mLayer )
{
return;
Expand Down
24 changes: 12 additions & 12 deletions src/app/qgssourcefieldsproperties.h
Expand Up @@ -25,7 +25,6 @@
#include <QSpinBox>
#include <QTreeWidgetItem>
#include <QDropEvent>
#include <QPushButton>
#include <QTableWidgetItem>
#include <QMessageBox>
#include <QFileDialog>
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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 );

};

Expand Down

0 comments on commit 910b9ea

Please sign in to comment.