/usr/include/qgis/qgsfieldconditionalformatwidget.h is in libqgis-dev 2.18.17+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | /***************************************************************************
qgsfieldconditionalformatwidget.h
-------------------
begin :
copyright :
email :
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSFIELDCONDITIONALFORMATWIDGET_H
#define QGSFIELDCONDITIONALFORMATWIDGET_H
#include <QWidget>
#include <QStandardItemModel>
#include <QStandardItem>
#include "ui_qgsfieldconditionalformatwidget.h"
#include "qgsfieldcombobox.h"
#include "qgsconditionalstyle.h"
/** \ingroup gui
* \class QgsFieldConditionalFormatWidget
* A widget for customising conditional formatting options.
* \note added in QGIS 2.12
*/
class GUI_EXPORT QgsFieldConditionalFormatWidget : public QWidget, private Ui::QgsFieldConditionalWidget
{
Q_OBJECT
public:
/** Constructor for QgsFieldConditionalFormatWidget.
* @param parent parent widget
*/
explicit QgsFieldConditionalFormatWidget( QWidget *parent = nullptr );
~QgsFieldConditionalFormatWidget();
/** Switches the widget to the rules page.
*/
void viewRules();
/** Sets the vector layer associated with the widget.
* @param theLayer vector layer
*/
void setLayer( QgsVectorLayer* theLayer );
/** Switches the widget to the edit style mode for the specified style.
* @param index index of conditional style to edit
* @param style initial conditional styling options
*/
void editStyle( int index, const QgsConditionalStyle& style );
/**
* @param style initial conditional styling options
*/
void loadStyle( const QgsConditionalStyle& style );
/** Resets the formatting options to their default state.
*/
void reset();
/**
* @brief Set the presets that can be used for quick pick
* @param styles A list of styles used as presets
*/
void setPresets( const QList<QgsConditionalStyle>& styles );
/**
* @brief The default presets for the widget. Normally set when the widget is
* created however called setPresets will override the default styles.
* @return List of default presets.
*/
QList<QgsConditionalStyle> defaultPresets() const;
signals:
/** Emitted when the conditional styling rules are updated.
* @param fieldName name of field whose rules have been modified.
*/
void rulesUpdated( const QString& fieldName );
public slots:
private:
QgsVectorLayer* mLayer;
int mEditIndex;
bool mEditing;
QStandardItemModel* mModel;
QStandardItemModel* mPresetsModel;
QgsSymbolV2* mSymbol;
QList<QgsConditionalStyle> mPresets;
QList<QgsConditionalStyle> getStyles();
void setFormattingFromStyle( const QgsConditionalStyle& style );
private slots:
void setExpression();
void updateIcon();
void presetSet( int index );
bool isCustomSet();
void ruleClicked( const QModelIndex& index );
void reloadStyles();
void cancelRule();
void deleteRule();
void saveRule();
void addNewRule();
void fieldChanged( const QString& fieldName );
};
#endif // QGSFIELDCONDITIONALFORMATWIDGET_H
|