17 #include <QMessageBox> 49 connect( mShowAllButton, SIGNAL( clicked(
bool ) ),
this, SLOT(
showAll() ) );
50 connect( mHideAllButton, SIGNAL( clicked(
bool ) ),
this, SLOT(
hideAll() ) );
93 if ( !vl || mConfig.
columns().count() < 7 )
95 mShowAllButton->hide();
96 mHideAllButton->hide();
114 for (
int i = 0 ; i < mFieldsList->count() ; i++ )
121 columns.
append( columnConfig );
131 for (
int i = 0 ; i < mFieldsList->count() ; i++ )
133 mFieldsList->item( i )->setCheckState( Qt::Checked );
139 for (
int i = 0 ; i < mFieldsList->count() ; i++ )
141 mFieldsList->item( i )->setCheckState( Qt::Unchecked );
QByteArray toByteArray() const
void update(const QgsFields &fields)
Update the configuration with the given fields.
field comes from a joined layer (originIndex / 1000 = index of the join, originIndex % 1000 = index w...
FieldOrigin fieldOrigin(int fieldIdx) const
Get field's origin (value from an enumeration)
QgsAttributeTableConfig config() const
Get the updated configuration.
void append(const T &value)
static QIcon getThemeIcon(const QString &theName)
Helper to get a theme icon.
This column represents an action widget.
Type type
The type of this column.
QString tr(const char *sourceText, const char *disambiguation, int n)
QgsFields fields() const
Returns the list of fields of this layer.
void setValue(const QString &key, const QVariant &value)
void hideAll()
hideAll unchecks all the fields to hide them all in the attribute table
bool hidden
Flag that controls if the column is hidden.
void showAll()
showAll checks all the fields to show them all in the attribute table
QString name
The name of the attribute if this column represents a field.
QVariant fromValue(const T &value)
QVector< ColumnConfig > columns() const
Get the list with all columns and their configuration.
QgsAttributeTableConfig attributeTableConfig() const
Get the attribute table configuration object.
QVariant value(const QString &key, const QVariant &defaultValue) const
~QgsOrganizeTableColumnsDialog()
Destructor.
Defines the configuration of a column in the attribute table.
This is a container for configuration of the attribute table.
QgsOrganizeTableColumnsDialog(const QgsVectorLayer *vl, QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::Window)
Constructor.
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
Represents a vector layer which manages a vector based data sets.
field is calculated from an expression
QString attributeDisplayName(int attributeIndex) const
Convenience function that returns the attribute alias if defined or the field name else...
int fieldNameIndex(const QString &fieldName) const
Returns the index of a field name or -1 if the field does not exist.
void setColumns(const QVector< ColumnConfig > &columns)
Set the list of columns visible in the attribute table.