/usr/include/qgis/qgseffectstackpropertieswidget.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 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 | /***************************************************************************
qgseffectstackpropertieswidget.h
--------------------------------
begin : January 2015
copyright : (C) 2015 by Nyall Dawson
email : nyall dot dawson at gmail.com
***************************************************************************
* *
* 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 QGSEFFECTSTACKPROPERTIESWIDGET_H
#define QGSEFFECTSTACKPROPERTIESWIDGET_H
#include "qgsdialog.h"
#include "effects/qgseffectstack.h"
#include <QWidget>
#include <QStandardItemModel>
#include <qgspanelwidget.h>
#include "ui_qgseffectstackpropertieswidgetbase.h"
class EffectItem;
class QgsPaintEffect;
class QCheckBox;
class QToolButton;
class QgsPanelWidget;
/** \ingroup gui
* \class QgsEffectStackPropertiesWidget
* \brief A widget for modifying the properties of a QgsEffectStack, including adding
* and reordering effects within the stack.
*
* \note Added in version 2.9
* \see QgsEffectStack
* \see QgsEffectStackPropertiesDialog
* \see QgsEffectStackCompactWidget
*/
class GUI_EXPORT QgsEffectStackPropertiesWidget : public QgsPanelWidget, private Ui::QgsEffectStackPropertiesWidgetBase
{
Q_OBJECT
public:
/** QgsEffectStackPropertiesWidget constructor
* @param stack QgsEffectStack to modify in the widget
* @param parent parent widget
*/
QgsEffectStackPropertiesWidget( QgsEffectStack* stack, QWidget* parent = nullptr );
~QgsEffectStackPropertiesWidget();
/** Returns effect stack attached to the widget
* @returns QgsEffectStack modified by the widget
*/
QgsEffectStack* stack() { return mStack; }
/** Sets the picture to use for effect previews for the dialog
* @param picture preview picture
*/
void setPreviewPicture( const QPicture& picture );
public slots:
/** Moves the currently selected effect down in the stack.
*/
void moveEffectDown();
/** Moves the currently selected effect up in the stack.
*/
void moveEffectUp();
/** Adds a new effect to the stack.
*/
void addEffect();
/** Removes the currently selected effect from the stack.
*/
void removeEffect();
/** Updates the widget when the selected effect changes type.
*/
void effectChanged();
/** Updates the effect preview icon.
*/
void updatePreview();
/** Updates the effect stack when the currently selected effect changes properties.
* @param newEffect new effect to replace existing effect at selected position within the stack.
*/
void changeEffect( QgsPaintEffect* newEffect );
protected:
QgsEffectStack* mStack;
QStandardItemModel* mModel;
QWidget* mPresentWidget;
QPicture* mPreviewPicture;
/** Refreshes the widget to reflect the current state of the stack.
*/
void loadStack();
/** Refreshes the widget to reflect the current state of a specified stack.
* @param stack QgsEffectStack for widget
*/
void loadStack( QgsEffectStack* stack );
/** Enables or disables widgets depending on the selected effect within the stack.
*/
void updateUi();
/** Returns the currently selected effect within the stack.
* @note not available in python bindings
*/
EffectItem* currentEffectItem();
/** Moves the currently selected effect within the stack by a specified offset
*/
void moveEffectByOffset( int offset );
/** Sets the effect properties widget
*/
void setWidget( QWidget* widget );
};
/** \ingroup gui
* \class QgsEffectStackPropertiesDialog
* \brief A dialog for modifying the properties of a QgsEffectStack, including adding
* and reordering effects within the stack.
*
* \note Added in version 2.9
* \see QgsEffectStack
* \see QgsEffectStackPropertiesWidget
* \see QgsEffectStackCompactWidget
*/
class GUI_EXPORT QgsEffectStackPropertiesDialog: public QgsDialog
{
Q_OBJECT
public:
/** QgsEffectStackPropertiesDialog constructor
* @param stack QgsEffectStack to modify in the dialog
* @param parent parent widget
* @param f window flags
*/
QgsEffectStackPropertiesDialog( QgsEffectStack* stack, QWidget* parent = nullptr, const Qt::WindowFlags& f = nullptr );
~QgsEffectStackPropertiesDialog();
/** Returns effect stack attached to the dialog
* @returns QgsEffectStack modified by the dialog
*/
QgsEffectStack* stack();
/** Sets the picture to use for effect previews for the dialog
* @param picture preview picture
*/
void setPreviewPicture( const QPicture& picture );
protected:
QgsEffectStackPropertiesWidget* mPropertiesWidget;
};
/** \ingroup gui
* \class QgsEffectStackCompactWidget
* \brief A small widget consisting of a check box for enabling/disabling an effect stack
* and a button for opening an effect stack customisation dialog.
*
* \note Added in version 2.9
* \see QgsEffectStack
* \see QgsEffectStackPropertiesWidget
* \see QgsEffectStackPropertiesDialog
*/
class GUI_EXPORT QgsEffectStackCompactWidget: public QgsPanelWidget
{
Q_OBJECT
public:
/** QgsEffectStackCompactWidget constructor
* @param parent parent widget
* @param effect QgsPaintEffect for modification by the widget. If the effect
* is not a QgsEffectStack, it will be automatically converted to an effect
* stack consisting of the original effect
*/
QgsEffectStackCompactWidget( QWidget* parent = nullptr, QgsPaintEffect* effect = nullptr );
~QgsEffectStackCompactWidget();
/** Sets paint effect attached to the widget,
* @param effect QgsPaintEffect for modification by the widget. If the effect
* is not a QgsEffectStack, it will be automatically converted to an effect
* stack consisting of the original effect
* @see paintEffect
*/
void setPaintEffect( QgsPaintEffect* effect );
/** Returns paint effect attached to the widget
* @returns QgsPaintEffect modified by the widget
* @see setPaintEffect
*/
QgsPaintEffect* paintEffect() const { return mStack; }
/** Sets the picture to use for effect previews for the dialog
* @param picture preview picture
*/
void setPreviewPicture( const QPicture &picture );
signals:
/** Emitted when the paint effect properties change
*/
void changed();
private slots:
void showDialog();
void enableToggled( bool checked );
void updateAcceptWidget( QgsPanelWidget* panel );
void updateEffectLive();
private:
QgsEffectStack* mStack;
QCheckBox* mEnabledCheckBox;
QToolButton* mButton;
QPicture* mPreviewPicture;
};
#endif //QGSEFFECTSTACKPROPERTIESWIDGET_H
|