mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-13 00:03:09 -04:00
[FEATURE] support 64bit feature ids
This commit is contained in:
parent
72e5edc550
commit
5a3a87fde2
@ -213,7 +213,7 @@ IF (PEDANTIC)
|
||||
ADD_DEFINITIONS( /wd4610 ) # user defined constructor required (sqlite3_index_info)
|
||||
ADD_DEFINITIONS( /wd4706 ) # assignment within conditional expression (pal)
|
||||
ELSE (MSVC)
|
||||
ADD_DEFINITIONS( -Wall -Wno-long-long -Wformat-security -Wno-strict-aliasing )
|
||||
ADD_DEFINITIONS( -Wall -Wextra -Wredundant-decls -Wno-long-long -Wformat-security -Wno-strict-aliasing )
|
||||
# Qt produces lots of warnings with strict aliasing (as of Qt 4.4.0 & GCC 4.3)
|
||||
# ADD_DEFINITIONS( -fstrict-aliasing -Wstrict-aliasing=1 )
|
||||
ENDIF (MSVC)
|
||||
|
@ -4,14 +4,17 @@ which are not wrapped by PyQt:
|
||||
- QVector< QVector<TYPE> >
|
||||
- QVector< QVector< QVector<TYPE> > >
|
||||
- QList< QList<TYPE> >
|
||||
- QList<qint64>
|
||||
- QSet<int>
|
||||
- QSet<qint64>
|
||||
- QSet<TYPE>
|
||||
- QMap<int, QMap<int, TYPE> >
|
||||
- QMap<qint64, QMap<int, TYPE> >
|
||||
- QMap<QString, QVariant::Type>
|
||||
- QMap<TYPE1, TYPE2*>
|
||||
- QMap<double, TYPE>
|
||||
- QMultiMap<double, TYPE2>
|
||||
- QMap<int, QgsOverlayObject*>*
|
||||
- QMap<qint64, QgsGeometry>
|
||||
- QMap<qint64, QgsOverlayObject*>*
|
||||
*/
|
||||
|
||||
%Feature QSETINT_CONVERSION
|
||||
@ -48,9 +51,9 @@ template <TYPE>
|
||||
|
||||
if ((l = PyList_New(sipCpp->size())) == NULL)
|
||||
return NULL;
|
||||
|
||||
|
||||
const sipMappedType* qvector_qgspoint = sipFindMappedType("QVector<QgsPoint>");
|
||||
|
||||
|
||||
// Set the list elements.
|
||||
for (int i = 0; i < sipCpp->size(); ++i)
|
||||
{
|
||||
@ -65,13 +68,13 @@ template <TYPE>
|
||||
}
|
||||
PyList_SET_ITEM(l, i, tobj);
|
||||
}
|
||||
|
||||
|
||||
return l;
|
||||
%End
|
||||
|
||||
%ConvertToTypeCode
|
||||
const sipMappedType* qvector_qgspoint = sipFindMappedType("QVector<QgsPoint>");
|
||||
|
||||
|
||||
// Check the type if that is all that is required.
|
||||
if (sipIsErr == NULL)
|
||||
{
|
||||
@ -85,7 +88,7 @@ template <TYPE>
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
QVector< QVector<TYPE> > *ql = new QVector< QVector<TYPE> >;
|
||||
|
||||
for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i)
|
||||
@ -130,9 +133,9 @@ template <TYPE>
|
||||
|
||||
if ((l = PyList_New(sipCpp->size())) == NULL)
|
||||
return NULL;
|
||||
|
||||
|
||||
const sipMappedType* qvector_qgspoint = sipFindMappedType("QVector<QVector<QgsPoint> >");
|
||||
|
||||
|
||||
// Set the list elements.
|
||||
for (int i = 0; i < sipCpp->size(); ++i)
|
||||
{
|
||||
@ -151,9 +154,9 @@ template <TYPE>
|
||||
%End
|
||||
|
||||
%ConvertToTypeCode
|
||||
|
||||
|
||||
const sipMappedType* qvector_qgspoint = sipFindMappedType("QVector<QVector<QgsPoint> >");
|
||||
|
||||
|
||||
// Check the type if that is all that is required.
|
||||
if (sipIsErr == NULL)
|
||||
{
|
||||
@ -167,7 +170,7 @@ template <TYPE>
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
QVector< QVector< QVector<TYPE> > > *ql = new QVector< QVector< QVector<TYPE> > >;
|
||||
|
||||
for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i)
|
||||
@ -290,7 +293,7 @@ template <TYPE>
|
||||
|
||||
if ((l = PyList_New(sipCpp->size())) == NULL)
|
||||
return NULL;
|
||||
|
||||
|
||||
// Set the list elements.
|
||||
QSet<int>::iterator it = sipCpp->begin();
|
||||
for (int i = 0; it != sipCpp->end(); ++it, ++i)
|
||||
@ -327,6 +330,102 @@ template <TYPE>
|
||||
};
|
||||
%End
|
||||
|
||||
%MappedType QList<qint64>
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <QList>
|
||||
%End
|
||||
|
||||
%ConvertFromTypeCode
|
||||
// Create the list.
|
||||
PyObject *l;
|
||||
|
||||
if ((l = PyList_New(sipCpp->size())) == NULL)
|
||||
return NULL;
|
||||
|
||||
// Set the list elements.
|
||||
QList<qint64>::iterator it = sipCpp->begin();
|
||||
for (int i = 0; it != sipCpp->end(); ++it, ++i)
|
||||
{
|
||||
PyObject *tobj;
|
||||
|
||||
if ((tobj = PyLong_FromLongLong(*it)) == NULL)
|
||||
{
|
||||
Py_DECREF(l);
|
||||
return NULL;
|
||||
}
|
||||
PyList_SET_ITEM(l, i, tobj);
|
||||
}
|
||||
|
||||
return l;
|
||||
%End
|
||||
|
||||
%ConvertToTypeCode
|
||||
// Check the type if that is all that is required.
|
||||
if (sipIsErr == NULL)
|
||||
return PyList_Check(sipPy);
|
||||
|
||||
QList<qint64> *qlist = new QList<qint64>;
|
||||
|
||||
for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i)
|
||||
{
|
||||
*qlist << PyLong_AsLongLong(PyList_GET_ITEM(sipPy, i));
|
||||
}
|
||||
|
||||
*sipCppPtr = qlist;
|
||||
return sipGetState(sipTransferObj);
|
||||
%End
|
||||
|
||||
};
|
||||
|
||||
%MappedType QSet<qint64>
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <QSet>
|
||||
%End
|
||||
|
||||
%ConvertFromTypeCode
|
||||
// Create the list.
|
||||
PyObject *l;
|
||||
|
||||
if ((l = PyList_New(sipCpp->size())) == NULL)
|
||||
return NULL;
|
||||
|
||||
// Set the list elements.
|
||||
QSet<qint64>::iterator it = sipCpp->begin();
|
||||
for (int i = 0; it != sipCpp->end(); ++it, ++i)
|
||||
{
|
||||
PyObject *tobj;
|
||||
|
||||
if ((tobj = PyLong_FromLongLong(*it)) == NULL)
|
||||
{
|
||||
Py_DECREF(l);
|
||||
return NULL;
|
||||
}
|
||||
PyList_SET_ITEM(l, i, tobj);
|
||||
}
|
||||
|
||||
return l;
|
||||
%End
|
||||
|
||||
%ConvertToTypeCode
|
||||
// Check the type if that is all that is required.
|
||||
if (sipIsErr == NULL)
|
||||
return PyList_Check(sipPy);
|
||||
|
||||
QSet<qint64> *qset = new QSet<qint64>;
|
||||
|
||||
for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i)
|
||||
{
|
||||
qset->insert(PyLong_AsLongLong(PyList_GET_ITEM(sipPy, i)));
|
||||
}
|
||||
|
||||
*sipCppPtr = qset;
|
||||
return sipGetState(sipTransferObj);
|
||||
%End
|
||||
|
||||
};
|
||||
|
||||
%If (QSETTYPE_CONVERSION)
|
||||
template <TYPE>
|
||||
%MappedType QSet<TYPE>
|
||||
@ -347,7 +446,7 @@ template <TYPE>
|
||||
|
||||
if ((l = PyList_New(sipCpp->size())) == NULL)
|
||||
return NULL;
|
||||
|
||||
|
||||
// Set the list elements.
|
||||
int i=0;
|
||||
for (QSet<TYPE>::iterator it = sipCpp->begin(); it != sipCpp->end(); ++it, ++i)
|
||||
@ -363,7 +462,7 @@ template <TYPE>
|
||||
}
|
||||
PyList_SET_ITEM(l, i, tobj);
|
||||
}
|
||||
|
||||
|
||||
return l;
|
||||
%End
|
||||
|
||||
@ -401,14 +500,14 @@ template <TYPE>
|
||||
*sipCppPtr = qset;
|
||||
return sipGetState(sipTransferObj);
|
||||
%End
|
||||
|
||||
};
|
||||
%End
|
||||
|
||||
template<TYPE>
|
||||
%MappedType QMap<int, QMap<int, TYPE> >
|
||||
%MappedType QMap<qint64, QMap<int, TYPE> >
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <QtGlobal>
|
||||
#include <QMap>
|
||||
#if (SIP_VERSION >= 0x040900)
|
||||
#define sipClass_QString ((sipWrapperType *) sipTypeAsPyTypeObject (sipType_QString))
|
||||
@ -424,21 +523,21 @@ template<TYPE>
|
||||
|
||||
if ((d = PyDict_New()) == NULL)
|
||||
return NULL;
|
||||
|
||||
|
||||
const sipMappedType* qmap2 = sipFindMappedType("QMap<int, TYPE>");
|
||||
|
||||
|
||||
// Set the list elements.
|
||||
for (QMap<int, QMap<int, TYPE> >::iterator it = sipCpp->begin(); it != sipCpp->end(); ++it)
|
||||
for (QMap<qint64, QMap<int, TYPE> >::iterator it = sipCpp->begin(); it != sipCpp->end(); ++it)
|
||||
{
|
||||
QMap<int, TYPE>* t = new QMap<int, TYPE>(*it);
|
||||
|
||||
PyObject *kobj = PyInt_FromLong(it.key());
|
||||
|
||||
PyObject *kobj = PyLong_FromLongLong(it.key());
|
||||
PyObject *tobj = sipConvertFromMappedType(t, qmap2, sipTransferObj);
|
||||
|
||||
if (kobj == NULL || tobj == NULL || PyDict_SetItem(d, kobj, tobj) < 0)
|
||||
{
|
||||
Py_DECREF(d);
|
||||
|
||||
|
||||
if (kobj)
|
||||
{
|
||||
Py_DECREF(kobj);
|
||||
@ -455,11 +554,11 @@ template<TYPE>
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Py_DECREF(kobj);
|
||||
Py_DECREF(tobj);
|
||||
}
|
||||
|
||||
|
||||
return d;
|
||||
%End
|
||||
|
||||
@ -477,46 +576,46 @@ template<TYPE>
|
||||
{
|
||||
if (!PyDict_Check(tobj))
|
||||
return 0;
|
||||
|
||||
|
||||
Py_ssize_t j = 0;
|
||||
while (PyDict_Next(tobj, &j, &kobj2, &tobj2))
|
||||
{
|
||||
if (!sipCanConvertToInstance(tobj2, sipClass_TYPE, SIP_NOT_NONE))
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
QMap<int, QMap<int, TYPE> > *qm = new QMap<int, QMap<int, TYPE> >;
|
||||
|
||||
|
||||
QMap<qint64, QMap<int, TYPE> > *qm = new QMap<qint64, QMap<int, TYPE> >;
|
||||
|
||||
|
||||
Py_ssize_t i = 0;
|
||||
while (PyDict_Next(sipPy, &i, &kobj, &tobj))
|
||||
{
|
||||
int k = PyInt_AsLong(kobj);
|
||||
|
||||
qint64 k = PyLong_AsLongLong(kobj);
|
||||
|
||||
// using sipConvertToMappedType to convert directly to QMap<int, TYPE> doesn't work
|
||||
// and ends with a segfault
|
||||
|
||||
|
||||
QMap<int, TYPE> qm2;
|
||||
|
||||
|
||||
Py_ssize_t j = 0;
|
||||
while (PyDict_Next(tobj, &j, &kobj2, &tobj2))
|
||||
{
|
||||
int k2 = PyInt_AsLong(kobj2);
|
||||
int state;
|
||||
|
||||
|
||||
TYPE* fa = reinterpret_cast<TYPE*>(sipConvertToInstance(tobj2, sipClass_TYPE, sipTransferObj,SIP_NOT_NONE,&state,sipIsErr));
|
||||
|
||||
|
||||
if (*sipIsErr)
|
||||
{
|
||||
sipReleaseInstance(tobj2, sipClass_TYPE, state);
|
||||
delete qm;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
qm2.insert(k2, *fa);
|
||||
sipReleaseInstance(tobj2, sipClass_TYPE, state);
|
||||
}
|
||||
@ -526,7 +625,93 @@ template<TYPE>
|
||||
*sipCppPtr = qm;
|
||||
return sipGetState(sipTransferObj);
|
||||
%End
|
||||
};
|
||||
|
||||
%MappedType QMap<qint64, QgsGeometry>
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <QMap>
|
||||
%End
|
||||
|
||||
%ConvertFromTypeCode
|
||||
// Create the list.
|
||||
PyObject *d;
|
||||
|
||||
if ((d = PyDict_New()) == NULL)
|
||||
return NULL;
|
||||
|
||||
// Set the list elements.
|
||||
for (QMap<qint64, QgsGeometry>::iterator it = sipCpp->begin(); it != sipCpp->end(); ++it)
|
||||
{
|
||||
PyObject *kobj = PyLong_FromLongLong(it.key());
|
||||
PyObject *tobj = sipConvertFromInstance( &it.value(), sipClass_QgsGeometry, sipTransferObj);
|
||||
|
||||
if (kobj == NULL || tobj == NULL || PyDict_SetItem(d, kobj, tobj) < 0)
|
||||
{
|
||||
Py_DECREF(d);
|
||||
|
||||
if (kobj)
|
||||
{
|
||||
Py_DECREF(kobj);
|
||||
}
|
||||
|
||||
if (tobj)
|
||||
{
|
||||
Py_DECREF(tobj);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_DECREF(tobj);
|
||||
}
|
||||
|
||||
return d;
|
||||
%End
|
||||
|
||||
%ConvertToTypeCode
|
||||
PyObject *kobj, *tobj;
|
||||
|
||||
// Check the type if that is all that is required.
|
||||
if (sipIsErr == NULL)
|
||||
{
|
||||
if (!PyDict_Check(sipPy))
|
||||
return 0;
|
||||
|
||||
Py_ssize_t i = 0;
|
||||
while (PyDict_Next(sipPy, &i, &kobj, &tobj))
|
||||
{
|
||||
if (!PyDict_Check(tobj))
|
||||
return 0;
|
||||
|
||||
if (!sipCanConvertToInstance(tobj, sipClass_QgsGeometry, SIP_NOT_NONE))
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
QMap<qint64, QgsGeometry> *qm = new QMap<qint64, QgsGeometry>;
|
||||
|
||||
Py_ssize_t i = 0;
|
||||
while (PyDict_Next(sipPy, &i, &kobj, &tobj))
|
||||
{
|
||||
int state;
|
||||
qint64 k = PyLong_AsLongLong(kobj);
|
||||
QgsGeometry * fa = reinterpret_cast<QgsGeometry*>(sipConvertToInstance(tobj, sipClass_QgsGeometry, sipTransferObj,SIP_NOT_NONE,&state,sipIsErr));
|
||||
|
||||
if (*sipIsErr)
|
||||
{
|
||||
sipReleaseInstance(tobj, sipClass_QgsGeometry, state);
|
||||
delete qm;
|
||||
return 0;
|
||||
}
|
||||
|
||||
qm->insert(k, *fa);
|
||||
}
|
||||
|
||||
*sipCppPtr = qm;
|
||||
return sipGetState(sipTransferObj);
|
||||
%End
|
||||
};
|
||||
|
||||
%MappedType QMap<QString, QVariant::Type>
|
||||
@ -603,13 +788,13 @@ template<TYPE>
|
||||
{
|
||||
if (!sipCanConvertToInstance(t1obj, sipClass_QString, SIP_NOT_NONE))
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
QMap<QString, QVariant::Type> *qm = new QMap<QString, QVariant::Type>;
|
||||
|
||||
|
||||
while (PyDict_Next(sipPy, &i, &t1obj, &t2obj))
|
||||
{
|
||||
int state;
|
||||
@ -628,9 +813,9 @@ template<TYPE>
|
||||
|
||||
sipReleaseInstance(t1, sipClass_QString, state);
|
||||
}
|
||||
|
||||
|
||||
*sipCppPtr = qm;
|
||||
|
||||
|
||||
return sipGetState(sipTransferObj);
|
||||
%End
|
||||
};
|
||||
@ -713,20 +898,20 @@ template<TYPE1, TYPE2>
|
||||
|
||||
if (!sipCanConvertToInstance(t2obj, sipClass_TYPE2, SIP_NOT_NONE))
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
QMap<TYPE1, TYPE2*> *qm = new QMap<TYPE1, TYPE2*>;
|
||||
|
||||
|
||||
while (PyDict_Next(sipPy, &i, &t1obj, &t2obj))
|
||||
{
|
||||
int state1, state2;
|
||||
|
||||
TYPE1 *t1 = reinterpret_cast<TYPE1 *>(sipConvertToInstance(t1obj, sipClass_TYPE1, sipTransferObj, SIP_NOT_NONE, &state1, sipIsErr));
|
||||
TYPE2 *t2 = reinterpret_cast<TYPE2 *>(sipConvertToInstance(t2obj, sipClass_TYPE2, sipTransferObj, SIP_NOT_NONE, &state2, sipIsErr));
|
||||
|
||||
|
||||
if (*sipIsErr)
|
||||
{
|
||||
sipReleaseInstance(t1, sipClass_TYPE1, state1);
|
||||
@ -741,9 +926,9 @@ template<TYPE1, TYPE2>
|
||||
sipReleaseInstance(t1, sipClass_TYPE1, state1);
|
||||
sipReleaseInstance(t2, sipClass_TYPE2, state2);
|
||||
}
|
||||
|
||||
|
||||
*sipCppPtr = qm;
|
||||
|
||||
|
||||
return sipGetState(sipTransferObj);
|
||||
%End
|
||||
};
|
||||
@ -974,7 +1159,7 @@ template<double, TYPE2>
|
||||
%End
|
||||
};
|
||||
|
||||
%MappedType QMap<int, QgsOverlayObject*>
|
||||
%MappedType QMap<qint64, QgsOverlayObject*>
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <QMap>
|
||||
@ -994,7 +1179,7 @@ template<double, TYPE2>
|
||||
if ((d = PyDict_New()) == NULL)
|
||||
return NULL;
|
||||
|
||||
for (QMap<int, QgsOverlayObject*>::iterator it = sipCpp->begin(); it != sipCpp->end(); ++it)
|
||||
for (QMap<qint64, QgsOverlayObject*>::iterator it = sipCpp->begin(); it != sipCpp->end(); ++it)
|
||||
{
|
||||
QgsOverlayObject* oobj = new QgsOverlayObject(*it.value());
|
||||
|
||||
@ -1031,7 +1216,7 @@ template<double, TYPE2>
|
||||
int i = 0;
|
||||
#endif
|
||||
|
||||
QMap<int, QgsOverlayObject*> *qm = new QMap<int, QgsOverlayObject*>;
|
||||
QMap<qint64, QgsOverlayObject*> *qm = new QMap<qint64, QgsOverlayObject*>;
|
||||
|
||||
while (PyDict_Next(sipPy, &i, &t1obj, &t2obj))
|
||||
{
|
||||
|
@ -4,10 +4,10 @@
|
||||
typedef QMap<int, QVariant> QgsAttributeMap;
|
||||
|
||||
// key = feature id, value = changed attributes
|
||||
typedef QMap<int, QMap<int, QVariant> > QgsChangedAttributesMap;
|
||||
typedef QMap<qint64, QMap<int, QVariant> > QgsChangedAttributesMap;
|
||||
|
||||
// key = feature id, value = changed geometry
|
||||
typedef QMap<int, QgsGeometry> QgsGeometryMap;
|
||||
typedef QMap<qint64, QgsGeometry> QgsGeometryMap;
|
||||
|
||||
// key = field index, value = field name
|
||||
typedef QMap<int, QString> QgsFieldNameMap;
|
||||
@ -50,7 +50,7 @@ class QgsFeature
|
||||
%End
|
||||
|
||||
//! Constructor
|
||||
QgsFeature(int id = 0, QString typeName = "" );
|
||||
QgsFeature(qint64 id = 0, QString typeName = "" );
|
||||
|
||||
/** copy ctor needed due to internal pointer */
|
||||
QgsFeature(const QgsFeature & rhs );
|
||||
@ -63,13 +63,13 @@ class QgsFeature
|
||||
* Get the feature id for this feature
|
||||
* @return Feature id
|
||||
*/
|
||||
int id() const;
|
||||
qint64 id() const;
|
||||
|
||||
/**
|
||||
* Set the feature id for this feature
|
||||
* @param id Feature id
|
||||
*/
|
||||
void setFeatureId(int id);
|
||||
void setFeatureId(qint64 id);
|
||||
|
||||
|
||||
/** returns the feature's type name
|
||||
|
@ -34,10 +34,10 @@ public:
|
||||
/* queries */
|
||||
|
||||
/** returns features that intersect the specified rectangle */
|
||||
QList<int> intersects(QgsRectangle rect);
|
||||
QList<qint64> intersects(QgsRectangle rect);
|
||||
|
||||
/** returns nearest neighbors (their count is specified by second parameter) */
|
||||
QList<int> nearestNeighbor(QgsPoint point, int neighbors);
|
||||
QList<qint64> nearestNeighbor(QgsPoint point, int neighbors);
|
||||
|
||||
|
||||
};
|
||||
|
@ -90,10 +90,10 @@ class QgsVectorDataProvider : QgsDataProvider
|
||||
* @param fetchAttributes a list containing the indexes of the attribute fields to copy
|
||||
* @return True when feature was found, otherwise false
|
||||
*/
|
||||
virtual bool featureAtId(int featureId,
|
||||
QgsFeature& feature,
|
||||
bool fetchGeometry = true,
|
||||
QList<int> fetchAttributes = QList<int>());
|
||||
virtual bool featureAtId(qint64 featureId,
|
||||
QgsFeature& feature,
|
||||
bool fetchGeometry = true,
|
||||
QList<int> fetchAttributes = QList<int>());
|
||||
|
||||
/**
|
||||
* Get the next feature resulting from a select operation.
|
||||
@ -182,7 +182,7 @@ class QgsVectorDataProvider : QgsDataProvider
|
||||
* @param id list containing feature ids to delete
|
||||
* @return true in case of success and false in case of failure
|
||||
*/
|
||||
virtual bool deleteFeatures(const QSet<int> & id);
|
||||
virtual bool deleteFeatures(const QSet<qint64> & id);
|
||||
|
||||
/**
|
||||
* Adds new attributes
|
||||
@ -212,7 +212,7 @@ class QgsVectorDataProvider : QgsDataProvider
|
||||
* @param attr_map a map containing changed attributes
|
||||
* @return true in case of success and false in case of failure
|
||||
*/
|
||||
virtual bool changeAttributeValues(const QMap<int, QMap<int, QVariant> > & attr_map);
|
||||
virtual bool changeAttributeValues(const QMap<qint64, QMap<int, QVariant> > &attr_map );
|
||||
|
||||
/**
|
||||
* Returns the default value for field specified by @c fieldId
|
||||
@ -225,7 +225,7 @@ class QgsVectorDataProvider : QgsDataProvider
|
||||
* the second map parameter being the new geometries themselves
|
||||
* @return true in case of success and false in case of failure
|
||||
*/
|
||||
virtual bool changeGeometryValues(QMap<int, QgsGeometry> & geometry_map);
|
||||
virtual bool changeGeometryValues(QMap<qint64, QgsGeometry> & geometry_map);
|
||||
|
||||
/**
|
||||
* Creates a spatial index on the datasource (if supported by the provider type).
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
typedef QList<int> QgsAttributeList;
|
||||
typedef QSet<int> QgsFeatureIds;
|
||||
typedef QSet<qint64> QgsFeatureIds;
|
||||
typedef QSet<int> QgsAttributeIds;
|
||||
|
||||
|
||||
@ -142,10 +142,10 @@ public:
|
||||
QList<QgsFeature> selectedFeatures();
|
||||
|
||||
/** Return reference to identifiers of selected features */
|
||||
const QSet<int>& selectedFeaturesIds() const;
|
||||
const QSet<qint64> &selectedFeaturesIds() const;
|
||||
|
||||
/** Change selection to the new set of features */
|
||||
void setSelectedFeatures(const QSet<int>& ids);
|
||||
void setSelectedFeatures(const QSet<qint64> &ids);
|
||||
|
||||
/** Returns the bounding box of the selected features. If there is no selection, QgsRectangle(0,0,0,0) is returned */
|
||||
QgsRectangle boundingBoxOfSelected();
|
||||
@ -267,7 +267,7 @@ public:
|
||||
* in the given ring, item (first number is index 0), and feature
|
||||
* Not meaningful for Point geometries
|
||||
*/
|
||||
bool insertVertex(double x, double y, int atFeatureId, int beforeVertex);
|
||||
bool insertVertex(double x, double y, qint64 atFeatureId, int beforeVertex);
|
||||
|
||||
/** Moves the vertex at the given position number,
|
||||
* ring and item (first number is index 0), and feature
|
||||
@ -278,7 +278,7 @@ public:
|
||||
/** Deletes the vertex at the given position number,
|
||||
* ring and item (first number is index 0), and feature
|
||||
*/
|
||||
bool deleteVertex(int atFeatureId, int atVertex);
|
||||
bool deleteVertex(qint64 atFeatureId, int atVertex);
|
||||
|
||||
/** Deletes the selected features
|
||||
* @return true in case of success and false otherwise
|
||||
@ -313,7 +313,7 @@ public:
|
||||
@param dx translation of x-coordinate
|
||||
@param dy translation of y-coordinate
|
||||
@return 0 in case of success*/
|
||||
int translateFeature(int featureId, double dx, double dy);
|
||||
int translateFeature(qint64 featureId, double dx, double dy);
|
||||
|
||||
/**Splits features cut by the given line
|
||||
@param splitLine line that splits the layer features
|
||||
@ -417,10 +417,10 @@ public:
|
||||
|
||||
/** change feature's geometry
|
||||
@note added in version 1.2 */
|
||||
bool changeGeometry(int fid, QgsGeometry* geom);
|
||||
bool changeGeometry(qint64 fid, QgsGeometry* geom);
|
||||
|
||||
/** changed an attribute value (but does not commit it */
|
||||
bool changeAttributeValue(int fid, int field, QVariant value, bool emitSignal = true);
|
||||
bool changeAttributeValue(qint64 fid, int field, QVariant value, bool emitSignal = true);
|
||||
|
||||
/** add an attribute field (but does not commit it)
|
||||
returns true in case of success
|
||||
@ -453,7 +453,7 @@ public:
|
||||
bool addFeatures(QList<QgsFeature> features, bool makeSelected = TRUE);
|
||||
|
||||
/** delete a feature from the layer (but does not commit it) */
|
||||
bool deleteFeature(int fid);
|
||||
bool deleteFeature(qint64 fid);
|
||||
|
||||
/**
|
||||
Attempts to commit any changes to disk. Returns the result of the attempt.
|
||||
@ -528,93 +528,93 @@ public:
|
||||
/**access range */
|
||||
RangeData &range(int idx);
|
||||
|
||||
/**Adds a new overlay to this class. QgsVectorLayer takes ownership of the object
|
||||
@note this method was added in version 1.1
|
||||
*/
|
||||
void addOverlay( QgsVectorOverlay* overlay /Transfer/);
|
||||
/**Adds a new overlay to this class. QgsVectorLayer takes ownership of the object
|
||||
@note this method was added in version 1.1
|
||||
*/
|
||||
void addOverlay( QgsVectorOverlay* overlay /Transfer/);
|
||||
|
||||
/**Removes all overlays of a given type
|
||||
@note this method was added in version 1.1
|
||||
*/
|
||||
void removeOverlay( const QString& typeName );
|
||||
/**Removes all overlays of a given type
|
||||
@note this method was added in version 1.1
|
||||
*/
|
||||
void removeOverlay( const QString& typeName );
|
||||
|
||||
/**Returns pointers to the overlays of this layer
|
||||
@note this method was added in version 1.1
|
||||
*/
|
||||
void vectorOverlays( QList<QgsVectorOverlay*>& overlayList /Out/);
|
||||
/**Returns pointers to the overlays of this layer
|
||||
@note this method was added in version 1.1
|
||||
*/
|
||||
void vectorOverlays( QList<QgsVectorOverlay*>& overlayList /Out/);
|
||||
|
||||
/**Returns the (first) overlay of a type, e.g. diagram or label
|
||||
@note this method was added in version 1.1
|
||||
*/
|
||||
QgsVectorOverlay* findOverlayByType( const QString& typeName );
|
||||
/**Returns the (first) overlay of a type, e.g. diagram or label
|
||||
@note this method was added in version 1.1
|
||||
*/
|
||||
QgsVectorOverlay* findOverlayByType( const QString& typeName );
|
||||
|
||||
|
||||
/**
|
||||
* Create edit command for undo/redo operations
|
||||
* @param text text which is to be displayed in undo window
|
||||
*/
|
||||
void beginEditCommand(QString text);
|
||||
/**
|
||||
* Create edit command for undo/redo operations
|
||||
* @param text text which is to be displayed in undo window
|
||||
*/
|
||||
void beginEditCommand(QString text);
|
||||
|
||||
/** Finish edit command and add it to undo/redo stack */
|
||||
void endEditCommand();
|
||||
/** Finish edit command and add it to undo/redo stack */
|
||||
void endEditCommand();
|
||||
|
||||
/** Destroy active command and reverts all changes in it */
|
||||
void destroyEditCommand();
|
||||
/** Destroy active command and reverts all changes in it */
|
||||
void destroyEditCommand();
|
||||
|
||||
/** Execute undo operation. To be called only from QgsVectorLayerUndoCommand. */
|
||||
// (not necessary) void undoEditCommand(QgsUndoCommand* cmd);
|
||||
/** Execute undo operation. To be called only from QgsVectorLayerUndoCommand. */
|
||||
// (not necessary) void undoEditCommand(QgsUndoCommand* cmd);
|
||||
|
||||
/** Execute redo operation. To be called only from QgsVectorLayerUndoCommand. */
|
||||
// (not necessary) void redoEditCommand(QgsUndoCommand* cmd);
|
||||
/** Execute redo operation. To be called only from QgsVectorLayerUndoCommand. */
|
||||
// (not necessary) void redoEditCommand(QgsUndoCommand* cmd);
|
||||
|
||||
/** Returns the index of a field name or -1 if the field does not exist
|
||||
@note this method was added in version 1.4
|
||||
*/
|
||||
int fieldNameIndex( const QString& fieldName ) const;
|
||||
/** Returns the index of a field name or -1 if the field does not exist
|
||||
@note this method was added in version 1.4
|
||||
*/
|
||||
int fieldNameIndex( const QString& fieldName ) const;
|
||||
|
||||
/** Editing vertex markers
|
||||
@note public from version 1.4 */
|
||||
enum VertexMarkerType
|
||||
{
|
||||
SemiTransparentCircle,
|
||||
Cross,
|
||||
NoMarker /* added in version 1.1 */
|
||||
};
|
||||
/** Editing vertex markers
|
||||
@note public from version 1.4 */
|
||||
enum VertexMarkerType
|
||||
{
|
||||
SemiTransparentCircle,
|
||||
Cross,
|
||||
NoMarker /* added in version 1.1 */
|
||||
};
|
||||
|
||||
/** Draws a vertex symbol at (screen) coordinates x, y. (Useful to assist vertex editing.)
|
||||
@note public and static from version 1.4 */
|
||||
static void drawVertexMarker( double x, double y, QPainter& p, QgsVectorLayer::VertexMarkerType type, int vertexSize );
|
||||
/** Draws a vertex symbol at (screen) coordinates x, y. (Useful to assist vertex editing.)
|
||||
@note public and static from version 1.4 */
|
||||
static void drawVertexMarker( double x, double y, QPainter& p, QgsVectorLayer::VertexMarkerType type, int vertexSize );
|
||||
|
||||
/** Assembles mUpdatedFields considering provider fields, joined fields and added fields
|
||||
@note added in 1.7 */
|
||||
void updateFieldMap();
|
||||
/** Assembles mUpdatedFields considering provider fields, joined fields and added fields
|
||||
@note added in 1.7 */
|
||||
void updateFieldMap();
|
||||
|
||||
/** Caches joined attributes if required (and not already done)
|
||||
@note added in 1.7 */
|
||||
void createJoinCaches();
|
||||
/** Caches joined attributes if required (and not already done)
|
||||
@note added in 1.7 */
|
||||
void createJoinCaches();
|
||||
|
||||
/**Returns unique values for column
|
||||
@param index column index for attribute
|
||||
@param uniqueValues out: result list
|
||||
@limit maximum number of values to return (-1 if unlimited)
|
||||
@note: this method was added in version 1.7*/
|
||||
void uniqueValues( int index, QList<QVariant>& uniqueValues /Out/, int limit = -1 );
|
||||
/**Returns unique values for column
|
||||
@param index column index for attribute
|
||||
@param uniqueValues out: result list
|
||||
@limit maximum number of values to return (-1 if unlimited)
|
||||
@note: this method was added in version 1.7*/
|
||||
void uniqueValues( int index, QList<QVariant>& uniqueValues /Out/, int limit = -1 );
|
||||
|
||||
/**Returns minimum value for an attribute column or invalid variant in case of error
|
||||
@note added in 1.7*/
|
||||
QVariant minimumValue( int index );
|
||||
/**Returns minimum value for an attribute column or invalid variant in case of error
|
||||
@note added in 1.7*/
|
||||
QVariant minimumValue( int index );
|
||||
|
||||
/**Returns maximum value for an attribute column or invalid variant in case of error
|
||||
@note added in 1.7*/
|
||||
QVariant maximumValue( int index );
|
||||
/**Returns maximum value for an attribute column or invalid variant in case of error
|
||||
@note added in 1.7*/
|
||||
QVariant maximumValue( int index );
|
||||
|
||||
public slots:
|
||||
|
||||
/** Select feature by its ID, optionally emit signal selectionChanged() */
|
||||
void select(int featureId, bool emitSignal = TRUE);
|
||||
void select(qint64 featureId, bool emitSignal = TRUE);
|
||||
|
||||
/** Deselect feature by its ID, optionally emit signal selectionChanged() */
|
||||
void deselect( int featureId, bool emitSignal = TRUE );
|
||||
void deselect( qint64 featureId, bool emitSignal = TRUE );
|
||||
|
||||
/** Clear selection */
|
||||
void removeSelection(bool emitSignal = TRUE);
|
||||
@ -642,10 +642,10 @@ signals:
|
||||
void editingStopped();
|
||||
void attributeAdded(int idx);
|
||||
void attributeDeleted(int idx);
|
||||
void featureDeleted(int fid);
|
||||
void featureDeleted(qint64 fid);
|
||||
void layerDeleted();
|
||||
|
||||
void attributeValueChanged(int fid, int idx, const QVariant &);
|
||||
void attributeValueChanged(qint64 fid, int idx, const QVariant &);
|
||||
|
||||
/** Signals emitted after committing changes
|
||||
\note added in v1.6 */
|
||||
|
@ -18,7 +18,7 @@ class QgsVectorOverlay
|
||||
virtual void drawOverlayObjects( QgsRenderContext& context ) const = 0;
|
||||
|
||||
/**Gives direct access to oberlay objects*/
|
||||
QMap<int, QgsOverlayObject*>* overlayObjects();
|
||||
QMap<qint64, QgsOverlayObject*>* overlayObjects();
|
||||
|
||||
/**Describes the overlay type (e.g. "diagram" or "label")*/
|
||||
virtual QString typeName() const = 0;
|
||||
|
@ -35,7 +35,7 @@ class ANALYSIS_EXPORT Bezier3D: public ParametricLine
|
||||
/**Destructor*/
|
||||
virtual ~Bezier3D();
|
||||
/**Do not use this method, since a Bezier curve does not consist of other curves*/
|
||||
virtual void add( ParametricLine* pl );
|
||||
virtual void add( ParametricLine *pl );
|
||||
/**Calculates the first derivative and assigns it to v*/
|
||||
virtual void calcFirstDer( float t, Vector3D* v );
|
||||
/**Calculates the second derivative and assigns it to v*/
|
||||
@ -83,13 +83,15 @@ inline Bezier3D::~Bezier3D()
|
||||
|
||||
//----------------------------------------------invalid methods add and remove (because of inheritance from ParametricLine)
|
||||
|
||||
inline void Bezier3D::add( ParametricLine* pl )
|
||||
inline void Bezier3D::add( ParametricLine *pl )
|
||||
{
|
||||
Q_UNUSED( pl );
|
||||
QgsDebugMsg( "Error!!!!! A Bezier-curve can not be parent of a ParametricLine." );
|
||||
}
|
||||
|
||||
inline void Bezier3D::remove( int i )
|
||||
{
|
||||
Q_UNUSED( i );
|
||||
QgsDebugMsg( "Error!!!!! A Bezier-curve has no children to remove." );
|
||||
}
|
||||
|
||||
|
@ -48,6 +48,8 @@ bool MathUtils::calcBarycentricCoordinates( double x, double y, Point3D* p1, Poi
|
||||
|
||||
bool MathUtils::BarycentricToXY( double u, double v, double w, Point3D* p1, Point3D* p2, Point3D* p3, Point3D* result )//this is wrong at the moment. Furthermore, the case, where the denominators are 0 have to be treated (two ways of calculating px and py)
|
||||
{
|
||||
Q_UNUSED( w );
|
||||
|
||||
double px, py;
|
||||
if ( p1 && p2 && p3 && result )
|
||||
{
|
||||
|
@ -20,21 +20,28 @@
|
||||
|
||||
void ParametricLine::add( ParametricLine* pl )
|
||||
{
|
||||
Q_UNUSED( pl );
|
||||
std::cout << "warning, derive a class from ParametricLine" << std::endl;
|
||||
}
|
||||
|
||||
void ParametricLine::calcFirstDer( float t, Vector3D* v )
|
||||
{
|
||||
Q_UNUSED( t );
|
||||
Q_UNUSED( v );
|
||||
std::cout << "warning, derive a class from ParametricLine" << std::endl;
|
||||
}
|
||||
|
||||
void ParametricLine::calcSecDer( float t, Vector3D* v )
|
||||
{
|
||||
Q_UNUSED( t );
|
||||
Q_UNUSED( v );
|
||||
std::cout << "warning, derive a class from ParametricLine" << std::endl;
|
||||
}
|
||||
|
||||
void ParametricLine::calcPoint( float t, Point3D* )
|
||||
void ParametricLine::calcPoint( float t, Point3D *p )
|
||||
{
|
||||
Q_UNUSED( t );
|
||||
Q_UNUSED( p );
|
||||
std::cout << "warning, derive a class from ParametricLine" << std::endl;
|
||||
}
|
||||
|
||||
@ -46,16 +53,19 @@ ParametricLine* ParametricLine::getParent() const
|
||||
|
||||
void ParametricLine::remove( int i )
|
||||
{
|
||||
Q_UNUSED( i );
|
||||
std::cout << "warning, derive a class from ParametricLine" << std::endl;
|
||||
}
|
||||
|
||||
void ParametricLine::setControlPoly( QVector<Point3D*>* cp )
|
||||
{
|
||||
Q_UNUSED( cp );
|
||||
std::cout << "warning, derive a class from ParametricLine" << std::endl;
|
||||
}
|
||||
|
||||
void ParametricLine::setParent( ParametricLine* paral )
|
||||
{
|
||||
Q_UNUSED( paral );
|
||||
std::cout << "warning, derive a class from ParametricLine" << std::endl;
|
||||
}
|
||||
|
||||
@ -67,6 +77,7 @@ int ParametricLine::getDegree() const
|
||||
|
||||
const Point3D* ParametricLine::getControlPoint( int number ) const
|
||||
{
|
||||
Q_UNUSED( number );
|
||||
std::cout << "warning, derive a class from ParametricLine" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
@ -27,8 +27,11 @@
|
||||
#include "qgsdistancearea.h"
|
||||
#include <QProgressDialog>
|
||||
|
||||
bool QgsGeometryAnalyzer::simplify( QgsVectorLayer* layer, const QString& shapefileName,
|
||||
double tolerance, bool onlySelectedFeatures, QProgressDialog* p )
|
||||
bool QgsGeometryAnalyzer::simplify( QgsVectorLayer* layer,
|
||||
const QString& shapefileName,
|
||||
double tolerance,
|
||||
bool onlySelectedFeatures,
|
||||
QProgressDialog *p )
|
||||
{
|
||||
if ( !layer )
|
||||
{
|
||||
@ -255,8 +258,10 @@ void QgsGeometryAnalyzer::centroidFeature( QgsFeature& f, QgsVectorFileWriter* v
|
||||
}
|
||||
}
|
||||
|
||||
bool QgsGeometryAnalyzer::extent( QgsVectorLayer* layer, const QString& shapefileName,
|
||||
bool onlySelectedFeatures, QProgressDialog* p )
|
||||
bool QgsGeometryAnalyzer::extent( QgsVectorLayer* layer,
|
||||
const QString& shapefileName,
|
||||
bool onlySelectedFeatures,
|
||||
QProgressDialog * )
|
||||
{
|
||||
if ( !layer )
|
||||
{
|
||||
@ -408,7 +413,7 @@ bool QgsGeometryAnalyzer::convexHull( QgsVectorLayer* layer, const QString& shap
|
||||
QgsVectorFileWriter vWriter( shapefileName, dp->encoding(), fields, outputType, &crs );
|
||||
QgsFeature currentFeature;
|
||||
QgsGeometry* dissolveGeometry = 0; //dissolve geometry
|
||||
QMultiMap<QString, int> map;
|
||||
QMultiMap<QString, QgsFeatureId> map;
|
||||
|
||||
if ( onlySelectedFeatures )
|
||||
{
|
||||
@ -455,7 +460,7 @@ bool QgsGeometryAnalyzer::convexHull( QgsVectorLayer* layer, const QString& shap
|
||||
}
|
||||
}
|
||||
|
||||
QMultiMap<QString, int>::const_iterator jt = map.constBegin();
|
||||
QMultiMap<QString, QgsFeatureId>::const_iterator jt = map.constBegin();
|
||||
while ( jt != map.constEnd() )
|
||||
{
|
||||
QString currentKey = jt.key();
|
||||
@ -613,7 +618,7 @@ bool QgsGeometryAnalyzer::dissolve( QgsVectorLayer* layer, const QString& shapef
|
||||
|
||||
QgsVectorFileWriter vWriter( shapefileName, dp->encoding(), dp->fields(), outputType, &crs );
|
||||
QgsFeature currentFeature;
|
||||
QMultiMap<QString, int> map;
|
||||
QMultiMap<QString, QgsFeatureId> map;
|
||||
|
||||
if ( onlySelectedFeatures )
|
||||
{
|
||||
@ -639,7 +644,7 @@ bool QgsGeometryAnalyzer::dissolve( QgsVectorLayer* layer, const QString& shapef
|
||||
}
|
||||
|
||||
QgsGeometry *dissolveGeometry = 0; //dissolve geometry
|
||||
QMultiMap<QString, int>::const_iterator jt = map.constBegin();
|
||||
QMultiMap<QString, QgsFeatureId>::const_iterator jt = map.constBegin();
|
||||
QgsFeature outputFeature;
|
||||
while ( jt != map.constEnd() )
|
||||
{
|
||||
|
@ -150,9 +150,9 @@ void QgsOverlayAnalyzer::intersectFeature( QgsFeature& f, QgsVectorFileWriter* v
|
||||
return;
|
||||
}
|
||||
|
||||
QList<int> intersects;
|
||||
QList<QgsFeatureId> intersects;
|
||||
intersects = index->intersects( featureGeometry->boundingBox() );
|
||||
QList<int>::const_iterator it = intersects.constBegin();
|
||||
QList<QgsFeatureId>::const_iterator it = intersects.constBegin();
|
||||
QgsFeature outFeature;
|
||||
for ( ; it != intersects.constEnd(); ++it )
|
||||
{
|
||||
|
@ -48,6 +48,7 @@ class QgsAttributeTableDock : public QDockWidget
|
||||
|
||||
virtual void closeEvent( QCloseEvent * ev )
|
||||
{
|
||||
Q_UNUSED( ev );
|
||||
deleteLater();
|
||||
}
|
||||
};
|
||||
@ -196,23 +197,24 @@ void QgsAttributeTableDialog::on_mSelectedToTopButton_clicked()
|
||||
mModel->swapRows( mModel->rowToId( sourceIndex.row() ), *it );
|
||||
}
|
||||
|
||||
/*
|
||||
while (it != fids.end())
|
||||
{ //map!!!!
|
||||
//mModel->swapRows(mModel->rowToId(freeIndex), *it);
|
||||
//QModelIndex index = mFilterModel->mapFromSource(mModel->index(mModel->idToRow(*it), 0));
|
||||
QModelIndex sourceIndex = mFilterModel->mapToSource(mFilterModel->index(freeIndex, 0));
|
||||
mModel->swapRows(mModel->rowToId(sourceIndex.row()), *it);
|
||||
//mModel->swapRows(freeIndex, *it);
|
||||
#if 0
|
||||
while ( it != fids.end() )
|
||||
{ //map!!!!
|
||||
//mModel->swapRows(mModel->rowToId(freeIndex), *it);
|
||||
//QModelIndex index = mFilterModel->mapFromSource(mModel->index(mModel->idToRow(*it), 0));
|
||||
QModelIndex sourceIndex = mFilterModel->mapToSource( mFilterModel->index( freeIndex, 0 ) );
|
||||
mModel->swapRows( mModel->rowToId( sourceIndex.row() ), *it );
|
||||
//mModel->swapRows(freeIndex, *it);
|
||||
|
||||
if (fids.empty())
|
||||
break;
|
||||
else
|
||||
++it;
|
||||
if ( fids.empty() )
|
||||
break;
|
||||
else
|
||||
++it;
|
||||
|
||||
++freeIndex;
|
||||
}
|
||||
#endif
|
||||
|
||||
++freeIndex;
|
||||
}
|
||||
*/
|
||||
// just select proper rows
|
||||
//mModel->reload(mModel->index(0,0), mModel->index(mModel->rowCount(), mModel->columnCount()));
|
||||
//mModel->changeLayout();
|
||||
@ -405,7 +407,7 @@ void QgsAttributeTableDialog::updateRowSelection( int first, int last, int click
|
||||
|
||||
// Id must be mapped to table/view row
|
||||
QModelIndex index = mFilterModel->mapToSource( mFilterModel->index( first, 0 ) );
|
||||
int fid = mModel->rowToId( index.row() );
|
||||
QgsFeatureId fid = mModel->rowToId( index.row() );
|
||||
bool wasSelected = mSelectedFeatures.contains( fid );
|
||||
|
||||
// new selection should be created
|
||||
|
@ -1106,10 +1106,16 @@ void QgsComposer::on_mActionRedo_triggered()
|
||||
}
|
||||
}
|
||||
|
||||
void QgsComposer::moveEvent( QMoveEvent *e ) { saveWindowState(); }
|
||||
void QgsComposer::moveEvent( QMoveEvent *e )
|
||||
{
|
||||
Q_UNUSED( e );
|
||||
saveWindowState();
|
||||
}
|
||||
|
||||
void QgsComposer::resizeEvent( QResizeEvent *e )
|
||||
{
|
||||
Q_UNUSED( e );
|
||||
|
||||
// Move size grip when window is resized
|
||||
mSizeGrip->move( rect().bottomRight() - mSizeGrip->rect().bottomRight() );
|
||||
|
||||
|
@ -110,6 +110,8 @@ void QgsComposerMapWidget::on_mHeightLineEdit_editingFinished()
|
||||
|
||||
void QgsComposerMapWidget::on_mPreviewModeComboBox_activated( int i )
|
||||
{
|
||||
Q_UNUSED( i );
|
||||
|
||||
if ( !mComposerMap )
|
||||
{
|
||||
return;
|
||||
|
@ -166,6 +166,7 @@ void QgsComposerPictureWidget::on_mRotationSpinBox_valueChanged( double d )
|
||||
|
||||
void QgsComposerPictureWidget::on_mPreviewListWidget_currentItemChanged( QListWidgetItem* current, QListWidgetItem* previous )
|
||||
{
|
||||
Q_UNUSED( previous );
|
||||
if ( !mPicture || !current )
|
||||
{
|
||||
return;
|
||||
|
@ -149,6 +149,8 @@ void QgsCompositionWidget::createPaperEntries()
|
||||
|
||||
void QgsCompositionWidget::on_mPaperSizeComboBox_currentIndexChanged( const QString& text )
|
||||
{
|
||||
Q_UNUSED( text );
|
||||
|
||||
if ( mPaperSizeComboBox->currentText() == tr( "Custom" ) )
|
||||
{
|
||||
mPaperWidthDoubleSpinBox->setEnabled( true );
|
||||
@ -166,6 +168,8 @@ void QgsCompositionWidget::on_mPaperSizeComboBox_currentIndexChanged( const QStr
|
||||
|
||||
void QgsCompositionWidget::on_mPaperOrientationComboBox_currentIndexChanged( const QString& text )
|
||||
{
|
||||
Q_UNUSED( text );
|
||||
|
||||
if ( mPaperSizeComboBox->currentText() == tr( "Custom" ) )
|
||||
{
|
||||
adjustOrientation();
|
||||
@ -180,6 +184,8 @@ void QgsCompositionWidget::on_mPaperOrientationComboBox_currentIndexChanged( con
|
||||
|
||||
void QgsCompositionWidget::on_mPaperUnitsComboBox_currentIndexChanged( const QString& text )
|
||||
{
|
||||
Q_UNUSED( text );
|
||||
|
||||
double width = size( mPaperWidthDoubleSpinBox );
|
||||
double height = size( mPaperHeightDoubleSpinBox );
|
||||
|
||||
@ -468,6 +474,8 @@ void QgsCompositionWidget::on_mGridColorButton_clicked()
|
||||
|
||||
void QgsCompositionWidget::on_mGridStyleComboBox_currentIndexChanged( const QString& text )
|
||||
{
|
||||
Q_UNUSED( text );
|
||||
|
||||
if ( mComposition )
|
||||
{
|
||||
if ( mGridStyleComboBox->currentText() == tr( "Solid" ) )
|
||||
|
@ -138,6 +138,8 @@ void QgsLegend::showItem( QString msg, QTreeWidgetItem *item )
|
||||
|
||||
void QgsLegend::handleCurrentItemChanged( QTreeWidgetItem* current, QTreeWidgetItem* previous )
|
||||
{
|
||||
Q_UNUSED( current );
|
||||
Q_UNUSED( previous );
|
||||
QgsMapLayer *layer = currentLayer();
|
||||
|
||||
if ( mMapCanvas )
|
||||
@ -556,8 +558,10 @@ void QgsLegend::mouseReleaseEvent( QMouseEvent * e )
|
||||
checkLayerOrderUpdate();
|
||||
}
|
||||
|
||||
void QgsLegend::mouseDoubleClickEvent( QMouseEvent* e )
|
||||
void QgsLegend::mouseDoubleClickEvent( QMouseEvent *e )
|
||||
{
|
||||
Q_UNUSED( e );
|
||||
|
||||
QSettings settings;
|
||||
|
||||
switch ( settings.value( "/qgis/legendDoubleClickAction", 0 ).toInt() )
|
||||
@ -1588,9 +1592,13 @@ void QgsLegend::moveItem( QTreeWidgetItem* move, QTreeWidgetItem* after )
|
||||
{
|
||||
QgsDebugMsg( QString( "Moving layer : %1 (%2)" ).arg( move->text( 0 ) ).arg( move->type() ) );
|
||||
if ( after )
|
||||
{
|
||||
QgsDebugMsg( QString( "after layer : %1 (%2)" ).arg( after->text( 0 ) ).arg( after->type() ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
QgsDebugMsg( "as toplevel item" );
|
||||
}
|
||||
|
||||
static_cast<QgsLegendItem*>( move )->storeAppearanceSettings();//store settings in the moved item and its childern
|
||||
|
||||
@ -1760,6 +1768,8 @@ void QgsLegend::removePixmapHeightValue( int height )
|
||||
|
||||
void QgsLegend::handleItemChange( QTreeWidgetItem* item, int column )
|
||||
{
|
||||
Q_UNUSED( column );
|
||||
|
||||
if ( !item )
|
||||
{
|
||||
return;
|
||||
|
@ -58,6 +58,8 @@ void QgsLegendItem::print( QgsLegendItem * theItem )
|
||||
}
|
||||
++myIterator;
|
||||
}
|
||||
#else
|
||||
Q_UNUSED( theItem );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ class QgsLegendItem : public QTreeWidgetItem, public QObject
|
||||
NO_ACTION //do nothing
|
||||
};
|
||||
|
||||
virtual LEGEND_ITEM_TYPE type() const {return mType;}
|
||||
virtual LEGEND_ITEM_TYPE type() const { return mType; }
|
||||
|
||||
/**Subclasses which allow insertion of other items may implement this method.
|
||||
@param theItem legend item to insert into this item
|
||||
@ -70,7 +70,7 @@ class QgsLegendItem : public QTreeWidgetItem, public QObject
|
||||
If false, such settings don't change (e.g. during mouse drags). If true, the layers and/or map canvas
|
||||
settings are allowed to change (e.g. if the mouse button is released).
|
||||
@return true in case of success and false if theItem cannot be inserted*/
|
||||
virtual bool insert( QgsLegendItem* theItem ) {return false;}
|
||||
virtual bool insert( QgsLegendItem *theItem ) { Q_UNUSED( theItem ); return false; }
|
||||
void print( QgsLegendItem * theItem );
|
||||
/**Returns a pointer to the first child or 0 if there is none*/
|
||||
QgsLegendItem* firstChild();
|
||||
@ -101,9 +101,9 @@ class QgsLegendItem : public QTreeWidgetItem, public QObject
|
||||
QTreeWidgetItem's and QObject's insertChild() function */
|
||||
void insertChild( int index, QTreeWidgetItem *child );
|
||||
/**Do preparations after a new child was inserted (default empty)*/
|
||||
virtual void receive( QgsLegendItem* newChild ) {}
|
||||
virtual void receive( QgsLegendItem *newChild ) { Q_UNUSED( newChild ); }
|
||||
/**Do cleanups after a child item leaves (default empty)*/
|
||||
virtual void release( QgsLegendItem* formerChild ) {}
|
||||
virtual void release( QgsLegendItem *formerChild ) { Q_UNUSED( formerChild ); }
|
||||
|
||||
protected:
|
||||
LEGEND_ITEM_TYPE mType;
|
||||
|
@ -37,7 +37,8 @@ class QgsLegendPropertyGroup : public QgsLegendItem
|
||||
/** Overloads cmpare function of QListViewItem
|
||||
* @note The property group must always be the first in the list
|
||||
*/
|
||||
int compare( QTreeWidgetItem* i, int col, bool ascending ) {return -1;}
|
||||
int compare( QTreeWidgetItem* i, int col, bool ascending )
|
||||
{ Q_UNUSED( i ); Q_UNUSED( col ); Q_UNUSED( ascending ); return -1; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -42,6 +42,8 @@ QgsLegendSymbologyGroup::~QgsLegendSymbologyGroup()
|
||||
*/
|
||||
int QgsLegendSymbologyGroup::compare( QTreeWidgetItem * i, int col, bool ascending )
|
||||
{
|
||||
Q_UNUSED( col );
|
||||
Q_UNUSED( ascending );
|
||||
QgsLegendItem * myItem = dynamic_cast<QgsLegendItem *>( i ) ;
|
||||
if ( myItem->type() == QgsLegendItem::LEGEND_PROPERTY_GROUP )
|
||||
{
|
||||
|
@ -451,12 +451,14 @@ void QgsOpenVectorLayerDialog::on_btnEdit_clicked()
|
||||
|
||||
void QgsOpenVectorLayerDialog::on_cmbDatabaseTypes_currentIndexChanged( const QString & text )
|
||||
{
|
||||
Q_UNUSED( text );
|
||||
populateConnectionList();
|
||||
setSelectedConnectionType();
|
||||
}
|
||||
|
||||
void QgsOpenVectorLayerDialog::on_cmbConnections_currentIndexChanged( const QString & text )
|
||||
{
|
||||
Q_UNUSED( text );
|
||||
setSelectedConnection();
|
||||
}
|
||||
//********************end auto connected slots *****************/
|
||||
|
@ -73,6 +73,8 @@ void QgsVectorLayerSaveAsDialog::accept()
|
||||
|
||||
void QgsVectorLayerSaveAsDialog::on_mFormatComboBox_currentIndexChanged( int idx )
|
||||
{
|
||||
Q_UNUSED( idx );
|
||||
|
||||
browseFilename->setEnabled( true );
|
||||
leFilename->setEnabled( true );
|
||||
|
||||
|
@ -272,6 +272,7 @@ void QgsPgSourceSelect::on_mSearchColumnComboBox_currentIndexChanged( const QStr
|
||||
|
||||
void QgsPgSourceSelect::on_mSearchModeComboBox_currentIndexChanged( const QString & text )
|
||||
{
|
||||
Q_UNUSED( text );
|
||||
on_mSearchTableEdit_textChanged( mSearchTableEdit->text() );
|
||||
}
|
||||
|
||||
@ -929,6 +930,7 @@ void QgsPgSourceSelect::setConnectionListPosition()
|
||||
|
||||
void QgsPgSourceSelect::setSearchExpression( const QString& regexp )
|
||||
{
|
||||
Q_UNUSED( regexp );
|
||||
}
|
||||
|
||||
void QgsGeomColumnTypeThread::setConnInfo( QString conninfo, bool useEstimatedMetadata )
|
||||
|
@ -54,6 +54,7 @@ class QgsPgSourceSelectDelegate : public QItemDelegate
|
||||
const QStyleOptionViewItem &option,
|
||||
const QModelIndex &index ) const
|
||||
{
|
||||
Q_UNUSED( option );
|
||||
if ( index.column() == QgsDbTableModel::dbtmSql )
|
||||
{
|
||||
QLineEdit *le = new QLineEdit( parent );
|
||||
|
@ -3135,6 +3135,8 @@ void QgisApp::addWindow( QAction *action )
|
||||
mWindowMenu->addAction( action );
|
||||
action->setCheckable( true );
|
||||
action->setChecked( true );
|
||||
#else
|
||||
Q_UNUSED( action );
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -3143,6 +3145,8 @@ void QgisApp::removeWindow( QAction *action )
|
||||
#ifdef Q_WS_MAC
|
||||
mWindowActions->removeAction( action );
|
||||
mWindowMenu->removeAction( action );
|
||||
#else
|
||||
Q_UNUSED( action );
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -3736,7 +3740,7 @@ void QgisApp::mergeAttributesOfSelectedFeatures()
|
||||
|
||||
const QgsAttributeMap &merged = d.mergedAttributesMap();
|
||||
|
||||
foreach( int fid, vl->selectedFeaturesIds() )
|
||||
foreach( QgsFeatureId fid, vl->selectedFeaturesIds() )
|
||||
{
|
||||
for ( QgsAttributeMap::const_iterator it = merged.begin(); it != merged.end(); it++ )
|
||||
{
|
||||
@ -6500,6 +6504,7 @@ void QgisApp::updateUndoActions()
|
||||
// add project directory to python path
|
||||
void QgisApp::projectChanged( const QDomDocument &doc )
|
||||
{
|
||||
Q_UNUSED( doc );
|
||||
QgsProject *project = qobject_cast<QgsProject*>( sender() );
|
||||
if ( !project )
|
||||
return;
|
||||
|
@ -405,6 +405,7 @@ QAction *QgisAppInterface::actionAbout() { return qgis->actionAbout(); }
|
||||
|
||||
bool QgisAppInterface::openFeatureForm( QgsVectorLayer *vlayer, QgsFeature &f, bool updateFeatureOnly )
|
||||
{
|
||||
Q_UNUSED( updateFeatureOnly );
|
||||
if ( !vlayer )
|
||||
return false;
|
||||
|
||||
|
@ -93,6 +93,7 @@ void QgsAttributeTypeDialog::setCheckedState( QString checked, QString unchecked
|
||||
|
||||
void QgsAttributeTypeDialog::vCellChanged( int row, int column )
|
||||
{
|
||||
Q_UNUSED( column );
|
||||
if ( row == tableWidget->rowCount() - 1 )
|
||||
{
|
||||
tableWidget->insertRow( row + 1 );
|
||||
@ -104,8 +105,8 @@ void QgsAttributeTypeDialog::removeSelectedButtonPushed()
|
||||
QList<QTableWidgetItem *> list = tableWidget->selectedItems();
|
||||
QSet<int> rowsToRemove;
|
||||
int removed = 0;
|
||||
int i = 0;
|
||||
for ( ; i < list.size(); i++ )
|
||||
int i;
|
||||
for ( i = 0; i < list.size(); i++ )
|
||||
{
|
||||
if ( list[i]->column() == 0 )
|
||||
{
|
||||
|
@ -255,6 +255,7 @@ void QgsBookmarks::on_btnZoomTo_clicked()
|
||||
|
||||
void QgsBookmarks::on_lstBookmarks_itemDoubleClicked( QTreeWidgetItem *lvi )
|
||||
{
|
||||
Q_UNUSED( lvi );
|
||||
zoomToBookmark();
|
||||
}
|
||||
|
||||
|
@ -234,8 +234,10 @@ QAction* QgsConfigureShortcutsDialog::currentAction()
|
||||
return qobject_cast<QAction*>( action );
|
||||
}
|
||||
|
||||
void QgsConfigureShortcutsDialog::actionChanged( QTreeWidgetItem* current, QTreeWidgetItem* previous )
|
||||
void QgsConfigureShortcutsDialog::actionChanged( QTreeWidgetItem *current, QTreeWidgetItem *previous )
|
||||
{
|
||||
Q_UNUSED( current );
|
||||
Q_UNUSED( previous );
|
||||
// cancel previous shortcut setting (if any)
|
||||
setGettingShortcut( false );
|
||||
|
||||
|
@ -204,6 +204,7 @@ void QgsCustomizationDialog::cancel()
|
||||
|
||||
void QgsCustomizationDialog::on_actionSave_triggered( bool checked )
|
||||
{
|
||||
Q_UNUSED( checked );
|
||||
QSettings mySettings;
|
||||
QString lastDir = mySettings.value( mLastDirSettingsName, "." ).toString();
|
||||
|
||||
@ -222,6 +223,7 @@ void QgsCustomizationDialog::on_actionSave_triggered( bool checked )
|
||||
|
||||
void QgsCustomizationDialog::on_actionLoad_triggered( bool checked )
|
||||
{
|
||||
Q_UNUSED( checked );
|
||||
QSettings mySettings;
|
||||
QString lastDir = mySettings.value( mLastDirSettingsName, "." ).toString();
|
||||
|
||||
@ -240,16 +242,19 @@ void QgsCustomizationDialog::on_actionLoad_triggered( bool checked )
|
||||
|
||||
void QgsCustomizationDialog::on_actionExpandAll_triggered( bool checked )
|
||||
{
|
||||
Q_UNUSED( checked );
|
||||
treeWidget->expandAll();
|
||||
}
|
||||
|
||||
void QgsCustomizationDialog::on_actionCollapseAll_triggered( bool checked )
|
||||
{
|
||||
Q_UNUSED( checked );
|
||||
treeWidget->collapseAll();
|
||||
}
|
||||
|
||||
void QgsCustomizationDialog::on_actionSelectAll_triggered( bool checked )
|
||||
{
|
||||
Q_UNUSED( checked );
|
||||
QList<QTreeWidgetItem*> items = treeWidget->findItems( "*", Qt::MatchWildcard | Qt::MatchRecursive, 0 );
|
||||
|
||||
QList<QTreeWidgetItem*>::iterator i;
|
||||
@ -348,8 +353,9 @@ QTreeWidgetItem * QgsCustomizationDialog::readWidgetsXmlNode( QDomNode theNode )
|
||||
return myItem;
|
||||
}
|
||||
|
||||
bool QgsCustomizationDialog::switchWidget( QWidget * widget, QMouseEvent *event )
|
||||
bool QgsCustomizationDialog::switchWidget( QWidget *widget, QMouseEvent *e )
|
||||
{
|
||||
Q_UNUSED( e );
|
||||
QgsDebugMsg( "Entered" );
|
||||
if ( !actionCatch->isChecked() )
|
||||
return false;
|
||||
@ -752,6 +758,7 @@ void QgsCustomization::openDialog()
|
||||
|
||||
void QgsCustomization::customizeWidget( QWidget * widget, QEvent * event )
|
||||
{
|
||||
Q_UNUSED( event );
|
||||
// Test if the widget is child of QDialog
|
||||
if ( !widget->inherits( "QDialog" ) )
|
||||
return;
|
||||
|
@ -426,8 +426,9 @@ void QgsFieldCalculator::on_mAllPushButton_clicked()
|
||||
getFieldValues( 0 );
|
||||
}
|
||||
|
||||
void QgsFieldCalculator::on_mOutputFieldNameLineEdit_textChanged( const QString& text )
|
||||
void QgsFieldCalculator::on_mOutputFieldNameLineEdit_textChanged( const QString &text )
|
||||
{
|
||||
Q_UNUSED( text );
|
||||
setOkButtonState();
|
||||
}
|
||||
|
||||
@ -523,7 +524,9 @@ void QgsFieldCalculator::setOkButtonState()
|
||||
}
|
||||
|
||||
|
||||
void QgsFieldCalculator::on_mFieldsListWidget_currentItemChanged( QListWidgetItem * current, QListWidgetItem * previous )
|
||||
void QgsFieldCalculator::on_mFieldsListWidget_currentItemChanged( QListWidgetItem *current, QListWidgetItem *previous )
|
||||
{
|
||||
Q_UNUSED( current );
|
||||
Q_UNUSED( previous );
|
||||
getFieldValues( 25 );
|
||||
}
|
||||
|
@ -544,6 +544,7 @@ int QgsGraduatedSymbolDialog::calculateQuantiles( std::list<double>& result, con
|
||||
|
||||
QColor QgsGraduatedSymbolDialog::getColorFromRamp( QString ramp, int step, int totalSteps )
|
||||
{
|
||||
Q_UNUSED( ramp );
|
||||
QColor color;
|
||||
/* To do:
|
||||
Grab the ramp by name from a file or ramp registry
|
||||
|
@ -47,6 +47,7 @@ QgsHandleBadLayers::QgsHandleBadLayers( const QList<QDomNode> &layers, const QDo
|
||||
: QDialog( QgisApp::instance() )
|
||||
, mLayers( layers )
|
||||
{
|
||||
Q_UNUSED( projectDom );
|
||||
setupUi( this );
|
||||
|
||||
mVectorFileFilter = QgsProviderRegistry::instance()->fileVectorFilters();
|
||||
@ -166,6 +167,7 @@ void QgsHandleBadLayers::itemChanged( QTableWidgetItem *item )
|
||||
|
||||
void QgsHandleBadLayers::cellDoubleClicked( int row, int column )
|
||||
{
|
||||
Q_UNUSED( row );
|
||||
if ( column != 3 || !mBrowseButton->isEnabled() )
|
||||
return;
|
||||
|
||||
|
@ -53,8 +53,9 @@ class QgsIdentifyResultsDock : public QDockWidget
|
||||
setObjectName( "IdentifyResultsTableDock" ); // set object name so the position can be saved
|
||||
}
|
||||
|
||||
virtual void closeEvent( QCloseEvent * ev )
|
||||
virtual void closeEvent( QCloseEvent *e )
|
||||
{
|
||||
Q_UNUSED( e );
|
||||
deleteLater();
|
||||
}
|
||||
};
|
||||
@ -145,14 +146,15 @@ void QgsIdentifyResults::addFeature( QgsVectorLayer *vlayer,
|
||||
|
||||
connect( vlayer, SIGNAL( layerDeleted() ), this, SLOT( layerDestroyed() ) );
|
||||
connect( vlayer, SIGNAL( layerCrsChanged() ), this, SLOT( layerDestroyed() ) );
|
||||
connect( vlayer, SIGNAL( featureDeleted( int ) ), this, SLOT( featureDeleted( int ) ) );
|
||||
connect( vlayer, SIGNAL( attributeValueChanged( int, int, const QVariant & ) ), this, SLOT( attributeValueChanged( int, int, const QVariant & ) ) );
|
||||
connect( vlayer, SIGNAL( featureDeleted( QgsFeatureId ) ), this, SLOT( featureDeleted( QgsFeatureId ) ) );
|
||||
connect( vlayer, SIGNAL( attributeValueChanged( QgsFeatureId, int, const QVariant & ) ),
|
||||
this, SLOT( attributeValueChanged( QgsFeatureId, int, const QVariant & ) ) );
|
||||
connect( vlayer, SIGNAL( editingStarted() ), this, SLOT( editingToggled() ) );
|
||||
connect( vlayer, SIGNAL( editingStopped() ), this, SLOT( editingToggled() ) );
|
||||
}
|
||||
|
||||
QTreeWidgetItem *featItem = new QTreeWidgetItem;
|
||||
featItem->setData( 0, Qt::UserRole, f.id() );
|
||||
featItem->setData( 0, Qt::UserRole, FID_TO_STRING( f.id() ) );
|
||||
featItem->setData( 0, Qt::UserRole + 1, mFeatures.size() );
|
||||
mFeatures << f;
|
||||
layItem->addChild( featItem );
|
||||
@ -395,6 +397,7 @@ void QgsIdentifyResults::closeEvent( QCloseEvent *e )
|
||||
|
||||
void QgsIdentifyResults::itemClicked( QTreeWidgetItem *item, int column )
|
||||
{
|
||||
Q_UNUSED( column );
|
||||
if ( item->data( 0, Qt::UserRole ).toString() == "edit" )
|
||||
{
|
||||
lstResults->setCurrentItem( item );
|
||||
@ -648,14 +651,16 @@ QTreeWidgetItem *QgsIdentifyResults::retrieveAttributes( QTreeWidgetItem *item,
|
||||
return featItem;
|
||||
}
|
||||
|
||||
void QgsIdentifyResults::itemExpanded( QTreeWidgetItem* item )
|
||||
void QgsIdentifyResults::itemExpanded( QTreeWidgetItem *item )
|
||||
{
|
||||
Q_UNUSED( item );
|
||||
expandColumnsToFit();
|
||||
}
|
||||
|
||||
void QgsIdentifyResults::handleCurrentItemChanged( QTreeWidgetItem *current, QTreeWidgetItem *previous )
|
||||
{
|
||||
if ( current == NULL )
|
||||
Q_UNUSED( previous );
|
||||
if ( !current )
|
||||
{
|
||||
emit selectedFeatureChanged( 0, 0 );
|
||||
return;
|
||||
@ -709,8 +714,9 @@ void QgsIdentifyResults::disconnectLayer( QObject *layer )
|
||||
if ( vlayer )
|
||||
{
|
||||
disconnect( vlayer, SIGNAL( layerDeleted() ), this, SLOT( layerDestroyed() ) );
|
||||
disconnect( vlayer, SIGNAL( featureDeleted( int ) ), this, SLOT( featureDeleted( int ) ) );
|
||||
disconnect( vlayer, SIGNAL( attributeValueChanged( int, int, const QVariant & ) ), this, SLOT( attributeValueChanged( int, int, const QVariant & ) ) );
|
||||
disconnect( vlayer, SIGNAL( featureDeleted( QgsFeatureId ) ), this, SLOT( featureDeleted( QgsFeatureId ) ) );
|
||||
disconnect( vlayer, SIGNAL( attributeValueChanged( QgsFeatureId, int, const QVariant & ) ),
|
||||
this, SLOT( attributeValueChanged( QgsFeatureId, int, const QVariant & ) ) );
|
||||
disconnect( vlayer, SIGNAL( editingStarted() ), this, SLOT( editingToggled() ) );
|
||||
disconnect( vlayer, SIGNAL( editingStopped() ), this, SLOT( editingToggled() ) );
|
||||
}
|
||||
@ -720,7 +726,7 @@ void QgsIdentifyResults::disconnectLayer( QObject *layer )
|
||||
}
|
||||
}
|
||||
|
||||
void QgsIdentifyResults::featureDeleted( int fid )
|
||||
void QgsIdentifyResults::featureDeleted( QgsFeatureId fid )
|
||||
{
|
||||
QTreeWidgetItem *layItem = layerItem( sender() );
|
||||
|
||||
@ -731,7 +737,7 @@ void QgsIdentifyResults::featureDeleted( int fid )
|
||||
{
|
||||
QTreeWidgetItem *featItem = layItem->child( i );
|
||||
|
||||
if ( featItem && featItem->data( 0, Qt::UserRole ).toInt() == fid )
|
||||
if ( featItem && featItem->data( 0, Qt::UserRole ).toString() == FID_TO_STRING( fid ) )
|
||||
{
|
||||
delete mHighlights.take( featItem );
|
||||
delete featItem;
|
||||
@ -750,7 +756,7 @@ void QgsIdentifyResults::featureDeleted( int fid )
|
||||
}
|
||||
}
|
||||
|
||||
void QgsIdentifyResults::attributeValueChanged( int fid, int idx, const QVariant &val )
|
||||
void QgsIdentifyResults::attributeValueChanged( QgsFeatureId fid, int idx, const QVariant &val )
|
||||
{
|
||||
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( sender() );
|
||||
QTreeWidgetItem *layItem = layerItem( sender() );
|
||||
@ -762,7 +768,7 @@ void QgsIdentifyResults::attributeValueChanged( int fid, int idx, const QVariant
|
||||
{
|
||||
QTreeWidgetItem *featItem = layItem->child( i );
|
||||
|
||||
if ( featItem && featItem->data( 0, Qt::UserRole ).toInt() == fid )
|
||||
if ( featItem && featItem->data( 0, Qt::UserRole ).toString() == FID_TO_STRING( fid ) )
|
||||
{
|
||||
if ( featItem->data( 0, Qt::DisplayRole ).toString() == vlayer->displayField() )
|
||||
featItem->setData( 1, Qt::DisplayRole, val );
|
||||
|
@ -72,7 +72,7 @@ class QgsIdentifyResults: public QDialog, private Ui::QgsIdentifyResultsBase
|
||||
void closeEvent( QCloseEvent *e );
|
||||
|
||||
signals:
|
||||
void selectedFeatureChanged( QgsVectorLayer *, int featureId );
|
||||
void selectedFeatureChanged( QgsVectorLayer *, QgsFeatureId featureId );
|
||||
|
||||
public slots:
|
||||
/** Remove results */
|
||||
@ -85,8 +85,8 @@ class QgsIdentifyResults: public QDialog, private Ui::QgsIdentifyResultsBase
|
||||
|
||||
void layerDestroyed();
|
||||
void editingToggled();
|
||||
void featureDeleted( int fid );
|
||||
void attributeValueChanged( int fid, int idx, const QVariant & );
|
||||
void featureDeleted( QgsFeatureId fid );
|
||||
void attributeValueChanged( QgsFeatureId fid, int idx, const QVariant & );
|
||||
|
||||
void featureForm();
|
||||
void zoomToFeature();
|
||||
|
@ -500,6 +500,7 @@ void QgsLabelingGui::on_mFontSizeSpinBox_valueChanged( double d )
|
||||
|
||||
void QgsLabelingGui::on_mFontSizeUnitComboBox_currentIndexChanged( int index )
|
||||
{
|
||||
Q_UNUSED( index );
|
||||
updateFont( lblFontPreview->font() );
|
||||
}
|
||||
|
||||
|
@ -22,8 +22,9 @@ void QgsLabelPreview::setBuffer( double size, QColor color )
|
||||
update();
|
||||
}
|
||||
|
||||
void QgsLabelPreview::paintEvent( QPaintEvent* e )
|
||||
void QgsLabelPreview::paintEvent( QPaintEvent *e )
|
||||
{
|
||||
Q_UNUSED( e );
|
||||
QPainter p( this );
|
||||
|
||||
p.setRenderHint( QPainter::Antialiasing );
|
||||
|
@ -135,6 +135,7 @@ void QgsMapToolAddPart::canvasReleaseEvent( QMouseEvent * e )
|
||||
break;
|
||||
default:
|
||||
Q_ASSERT( !"invalid capture mode" );
|
||||
errorCode = 6;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -33,15 +33,15 @@ QgsMapToolAnnotation::QgsMapToolAnnotation( QgsMapCanvas* canvas ): QgsMapTool(
|
||||
|
||||
QgsMapToolAnnotation::~QgsMapToolAnnotation()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QgsAnnotationItem* QgsMapToolAnnotation::createItem( QMouseEvent* e )
|
||||
QgsAnnotationItem* QgsMapToolAnnotation::createItem( QMouseEvent *e )
|
||||
{
|
||||
Q_UNUSED( e );
|
||||
return 0;
|
||||
}
|
||||
|
||||
QDialog* QgsMapToolAnnotation::createItemEditor( QgsAnnotationItem* item )
|
||||
QDialog* QgsMapToolAnnotation::createItemEditor( QgsAnnotationItem *item )
|
||||
{
|
||||
if ( !item )
|
||||
{
|
||||
@ -63,8 +63,10 @@ QDialog* QgsMapToolAnnotation::createItemEditor( QgsAnnotationItem* item )
|
||||
return 0;
|
||||
}
|
||||
|
||||
void QgsMapToolAnnotation::canvasReleaseEvent( QMouseEvent * e )
|
||||
void QgsMapToolAnnotation::canvasReleaseEvent( QMouseEvent *e )
|
||||
{
|
||||
Q_UNUSED( e );
|
||||
|
||||
mCurrentMoveAction = QgsAnnotationItem::NoAction;
|
||||
mCanvas->setCursor( mCursor );
|
||||
}
|
||||
|
@ -124,8 +124,9 @@ void QgsMapToolCapture::canvasMoveEvent( QMouseEvent * e )
|
||||
} // mouseMoveEvent
|
||||
|
||||
|
||||
void QgsMapToolCapture::canvasPressEvent( QMouseEvent * e )
|
||||
void QgsMapToolCapture::canvasPressEvent( QMouseEvent *e )
|
||||
{
|
||||
Q_UNUSED( e );
|
||||
// nothing to be done
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ QgsMapToolChangeLabelProperties::~QgsMapToolChangeLabelProperties()
|
||||
{
|
||||
}
|
||||
|
||||
void QgsMapToolChangeLabelProperties::canvasPressEvent( QMouseEvent * e )
|
||||
void QgsMapToolChangeLabelProperties::canvasPressEvent( QMouseEvent *e )
|
||||
{
|
||||
deleteRubberBands();
|
||||
|
||||
@ -47,8 +47,9 @@ void QgsMapToolChangeLabelProperties::canvasPressEvent( QMouseEvent * e )
|
||||
createRubberBands();
|
||||
}
|
||||
|
||||
void QgsMapToolChangeLabelProperties::canvasReleaseEvent( QMouseEvent * e )
|
||||
void QgsMapToolChangeLabelProperties::canvasReleaseEvent( QMouseEvent *e )
|
||||
{
|
||||
Q_UNUSED( e );
|
||||
QgsVectorLayer* vlayer = currentLayer();
|
||||
if ( mLabelRubberBand && mCanvas && vlayer )
|
||||
{
|
||||
|
@ -32,12 +32,13 @@ QgsMapToolDeletePart::~QgsMapToolDeletePart()
|
||||
delete mCross;
|
||||
}
|
||||
|
||||
void QgsMapToolDeletePart::canvasMoveEvent( QMouseEvent * e )
|
||||
void QgsMapToolDeletePart::canvasMoveEvent( QMouseEvent *e )
|
||||
{
|
||||
Q_UNUSED( e );
|
||||
//nothing to do
|
||||
}
|
||||
|
||||
void QgsMapToolDeletePart::canvasPressEvent( QMouseEvent * e )
|
||||
void QgsMapToolDeletePart::canvasPressEvent( QMouseEvent *e )
|
||||
{
|
||||
delete mCross;
|
||||
mCross = 0;
|
||||
@ -64,8 +65,9 @@ void QgsMapToolDeletePart::canvasPressEvent( QMouseEvent * e )
|
||||
}
|
||||
}
|
||||
|
||||
void QgsMapToolDeletePart::canvasReleaseEvent( QMouseEvent * e )
|
||||
void QgsMapToolDeletePart::canvasReleaseEvent( QMouseEvent *e )
|
||||
{
|
||||
Q_UNUSED( e );
|
||||
delete mCross;
|
||||
mCross = 0;
|
||||
|
||||
@ -89,7 +91,7 @@ void QgsMapToolDeletePart::canvasReleaseEvent( QMouseEvent * e )
|
||||
}
|
||||
|
||||
|
||||
void QgsMapToolDeletePart::deletePart( int fId, int beforeVertexNr, QgsVectorLayer* vlayer )
|
||||
void QgsMapToolDeletePart::deletePart( QgsFeatureId fId, int beforeVertexNr, QgsVectorLayer* vlayer )
|
||||
{
|
||||
QgsFeature f;
|
||||
vlayer->featureAtId( fId, f );
|
||||
|
@ -42,7 +42,7 @@ class QgsMapToolDeletePart: public QgsMapToolVertexEdit
|
||||
QgsVertexMarker* mCross;
|
||||
|
||||
//! delete part of a geometry
|
||||
void deletePart( int fId, int beforeVertexNr, QgsVectorLayer* vlayer );
|
||||
void deletePart( QgsFeatureId fId, int beforeVertexNr, QgsVectorLayer* vlayer );
|
||||
|
||||
//! find out part number of geometry given the snapped vertex number
|
||||
int partNumberOfVertex( QgsGeometry* g, int beforeVertexNr );
|
||||
|
@ -32,12 +32,13 @@ QgsMapToolDeleteRing::~QgsMapToolDeleteRing()
|
||||
delete mCross;
|
||||
}
|
||||
|
||||
void QgsMapToolDeleteRing::canvasMoveEvent( QMouseEvent * e )
|
||||
void QgsMapToolDeleteRing::canvasMoveEvent( QMouseEvent *e )
|
||||
{
|
||||
Q_UNUSED( e );
|
||||
//nothing to do
|
||||
}
|
||||
|
||||
void QgsMapToolDeleteRing::canvasPressEvent( QMouseEvent * e )
|
||||
void QgsMapToolDeleteRing::canvasPressEvent( QMouseEvent *e )
|
||||
{
|
||||
delete mCross;
|
||||
mCross = 0;
|
||||
@ -64,8 +65,9 @@ void QgsMapToolDeleteRing::canvasPressEvent( QMouseEvent * e )
|
||||
}
|
||||
}
|
||||
|
||||
void QgsMapToolDeleteRing::canvasReleaseEvent( QMouseEvent * e )
|
||||
void QgsMapToolDeleteRing::canvasReleaseEvent( QMouseEvent *e )
|
||||
{
|
||||
Q_UNUSED( e );
|
||||
delete mCross;
|
||||
mCross = 0;
|
||||
|
||||
@ -89,7 +91,7 @@ void QgsMapToolDeleteRing::canvasReleaseEvent( QMouseEvent * e )
|
||||
}
|
||||
|
||||
|
||||
void QgsMapToolDeleteRing::deleteRing( int fId, int beforeVertexNr, QgsVectorLayer* vlayer )
|
||||
void QgsMapToolDeleteRing::deleteRing( QgsFeatureId fId, int beforeVertexNr, QgsVectorLayer* vlayer )
|
||||
{
|
||||
QgsFeature f;
|
||||
vlayer->featureAtId( fId, f );
|
||||
|
@ -42,7 +42,7 @@ class QgsMapToolDeleteRing : public QgsMapToolVertexEdit
|
||||
QgsVertexMarker* mCross;
|
||||
|
||||
//! delete inner ring from the geometry
|
||||
void deleteRing( int fId, int beforeVertexNr, QgsVectorLayer* vlayer );
|
||||
void deleteRing( QgsFeatureId fId, int beforeVertexNr, QgsVectorLayer* vlayer );
|
||||
|
||||
//! return ring number in polygon
|
||||
int ringNumInPolygon( QgsGeometry* g, int vertexNr );
|
||||
|
@ -31,13 +31,15 @@ QgsMapToolDeleteVertex::~QgsMapToolDeleteVertex()
|
||||
delete mCross;
|
||||
}
|
||||
|
||||
void QgsMapToolDeleteVertex::canvasMoveEvent( QMouseEvent * e )
|
||||
void QgsMapToolDeleteVertex::canvasMoveEvent( QMouseEvent *e )
|
||||
{
|
||||
Q_UNUSED( e );
|
||||
//nothing to do
|
||||
}
|
||||
|
||||
void QgsMapToolDeleteVertex::canvasPressEvent( QMouseEvent * e )
|
||||
void QgsMapToolDeleteVertex::canvasPressEvent( QMouseEvent *e )
|
||||
{
|
||||
Q_UNUSED( e );
|
||||
delete mCross;
|
||||
mCross = 0;
|
||||
|
||||
@ -63,8 +65,9 @@ void QgsMapToolDeleteVertex::canvasPressEvent( QMouseEvent * e )
|
||||
}
|
||||
}
|
||||
|
||||
void QgsMapToolDeleteVertex::canvasReleaseEvent( QMouseEvent * e )
|
||||
void QgsMapToolDeleteVertex::canvasReleaseEvent( QMouseEvent *e )
|
||||
{
|
||||
Q_UNUSED( e );
|
||||
delete mCross;
|
||||
mCross = 0;
|
||||
|
||||
|
@ -63,15 +63,17 @@ QgsIdentifyResults *QgsMapToolIdentify::results()
|
||||
return mResults;
|
||||
}
|
||||
|
||||
void QgsMapToolIdentify::canvasMoveEvent( QMouseEvent * e )
|
||||
void QgsMapToolIdentify::canvasMoveEvent( QMouseEvent *e )
|
||||
{
|
||||
Q_UNUSED( e );
|
||||
}
|
||||
|
||||
void QgsMapToolIdentify::canvasPressEvent( QMouseEvent * e )
|
||||
void QgsMapToolIdentify::canvasPressEvent( QMouseEvent *e )
|
||||
{
|
||||
Q_UNUSED( e );
|
||||
}
|
||||
|
||||
void QgsMapToolIdentify::canvasReleaseEvent( QMouseEvent * e )
|
||||
void QgsMapToolIdentify::canvasReleaseEvent( QMouseEvent *e )
|
||||
{
|
||||
if ( !mCanvas || mCanvas->isDrawing() )
|
||||
{
|
||||
@ -251,7 +253,7 @@ bool QgsMapToolIdentify::identifyVectorLayer( QgsVectorLayer *layer, int x, int
|
||||
{
|
||||
featureCount++;
|
||||
|
||||
int fid = f_it->id();
|
||||
QgsFeatureId fid = f_it->id();
|
||||
QMap<QString, QString> derivedAttributes;
|
||||
|
||||
// Calculate derived attributes and insert:
|
||||
@ -297,7 +299,7 @@ bool QgsMapToolIdentify::identifyVectorLayer( QgsVectorLayer *layer, int x, int
|
||||
derivedAttributes.insert( "Y", str );
|
||||
}
|
||||
|
||||
derivedAttributes.insert( tr( "feature id" ), fid < 0 ? tr( "new feature" ) : QString::number( fid ) );
|
||||
derivedAttributes.insert( tr( "feature id" ), fid < 0 ? tr( "new feature" ) : FID_TO_STRING( fid ) );
|
||||
|
||||
results()->addFeature( layer, *f_it, derivedAttributes );
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ void QgsMapToolMoveFeature::canvasReleaseEvent( QMouseEvent * e )
|
||||
double dx = stopPointLayerCoords.x() - startPointLayerCoords.x();
|
||||
double dy = stopPointLayerCoords.y() - startPointLayerCoords.y();
|
||||
vlayer->beginEditCommand( tr( "Feature moved" ) );
|
||||
foreach( int id, mMovedFeatures )
|
||||
foreach( QgsFeatureId id, mMovedFeatures )
|
||||
{
|
||||
vlayer->translateFeature( id, dx, dy );
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ void QgsMapToolNodeTool::currentLayerChanged( QgsMapLayer* layer )
|
||||
}
|
||||
|
||||
|
||||
void QgsMapToolNodeTool::featureDeleted( int featureId )
|
||||
void QgsMapToolNodeTool::featureDeleted( QgsFeatureId featureId )
|
||||
{
|
||||
//check if deleted feature is the one selected
|
||||
if ( mSelectionFeature != NULL && featureId == mSelectionFeature->featureId() )
|
||||
@ -111,17 +111,18 @@ void QgsMapToolNodeTool::featureDeleted( int featureId )
|
||||
//if it's delete selection and disconnect signals since tool is not used anymore
|
||||
delete mSelectionFeature;
|
||||
mSelectionFeature = NULL;
|
||||
disconnect( mCanvas->currentLayer(), SIGNAL( featureDeleted( int ) ) );
|
||||
disconnect( mCanvas->currentLayer(), SIGNAL( featureDeleted( QgsFeatureId ) ) );
|
||||
disconnect( mCanvas->currentLayer(), SIGNAL( layerModified( bool ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
void QgsMapToolNodeTool::layerModified( bool onlyGeometry )
|
||||
{
|
||||
Q_UNUSED( onlyGeometry );
|
||||
//handling modification of
|
||||
QgsFeature feat;
|
||||
QgsVectorLayer* vlayer = qobject_cast<QgsVectorLayer *>( mCanvas->currentLayer() );
|
||||
if ( mSelectionFeature != NULL && !mChangingGeometry && ( vlayer->featureAtId( mSelectionFeature->featureId(), feat, true, false ) ) )
|
||||
if ( mSelectionFeature && !mChangingGeometry && vlayer->featureAtId( mSelectionFeature->featureId(), feat, true, false ) )
|
||||
{
|
||||
if ( !feat.geometry()->isGeosEqual( *mSelectionFeature->feature()->geometry() ) )
|
||||
{
|
||||
@ -312,7 +313,7 @@ void QgsMapToolNodeTool::coordinatesChanged()
|
||||
//need to update vertex markers since coordinate systems have changed
|
||||
if ( mSelectionFeature != NULL )
|
||||
{
|
||||
mSelectionFeature->updateVertexMarkersPosition( mCanvas );
|
||||
mSelectionFeature->updateVertexMarkersPosition();
|
||||
}
|
||||
}
|
||||
|
||||
@ -445,7 +446,7 @@ void QgsMapToolNodeTool::canvasMoveEvent( QMouseEvent * e )
|
||||
|
||||
void QgsMapToolNodeTool::connectSignals( QgsVectorLayer* vlayer )
|
||||
{
|
||||
connect( vlayer, SIGNAL( featureDeleted( int ) ), this, SLOT( featureDeleted( int ) ) );
|
||||
connect( vlayer, SIGNAL( featureDeleted( QgsFeatureId ) ), this, SLOT( featureDeleted( QgsFeatureId ) ) );
|
||||
connect( vlayer, SIGNAL( layerModified( bool ) ), this, SLOT( layerModified( bool ) ) );
|
||||
}
|
||||
|
||||
@ -506,7 +507,8 @@ void QgsMapToolNodeTool::canvasPressEvent( QMouseEvent * e )
|
||||
}
|
||||
mSelectionFeature = new SelectionFeature();
|
||||
mSelectionFeature->setSelectedFeature( snapResults[0].snappedAtGeometry, vlayer, NULL, mCanvas );
|
||||
mIsPoint = (( vlayer->dataProvider()->geometryType() == QGis::WKBPoint ) || ( vlayer->dataProvider()->geometryType() == QGis::WKBMultiPoint ) );
|
||||
mIsPoint = vlayer->dataProvider()->geometryType() == QGis::WKBPoint
|
||||
|| vlayer->dataProvider()->geometryType() == QGis::WKBMultiPoint;
|
||||
connectSignals( vlayer );
|
||||
}
|
||||
else
|
||||
@ -563,7 +565,8 @@ void QgsMapToolNodeTool::canvasPressEvent( QMouseEvent * e )
|
||||
mMoving = true;
|
||||
QgsPoint point = mCanvas->getCoordinateTransform()->toMapPoint( e->pos().x(), e->pos().y() );
|
||||
mClosestVertex = getClosestVertex( toLayerCoordinates( vlayer, point ) );
|
||||
if ( !mSelectionFeature->isSelected( snapResult.beforeVertexNr ) || !mSelectionFeature->isSelected( snapResult.afterVertexNr ) )
|
||||
if ( !mSelectionFeature->isSelected( snapResult.beforeVertexNr ) ||
|
||||
!mSelectionFeature->isSelected( snapResult.afterVertexNr ) )
|
||||
{
|
||||
mSelectionFeature->deselectAllVertexes();
|
||||
mSelectionFeature->selectVertex( snapResult.afterVertexNr );
|
||||
@ -644,7 +647,8 @@ void QgsMapToolNodeTool::canvasReleaseEvent( QMouseEvent * e )
|
||||
{
|
||||
//select another feature (this should deselect current one ;-) )
|
||||
mSelectionFeature->setSelectedFeature( mAnother, vlayer, NULL, mCanvas );
|
||||
mIsPoint = (( vlayer->dataProvider()->geometryType() == QGis::WKBPoint ) || ( vlayer->dataProvider()->geometryType() == QGis::WKBMultiPoint ) );
|
||||
mIsPoint = vlayer->dataProvider()->geometryType() == QGis::WKBPoint ||
|
||||
vlayer->dataProvider()->geometryType() == QGis::WKBMultiPoint;
|
||||
mSelectAnother = false;
|
||||
}
|
||||
}
|
||||
@ -739,7 +743,7 @@ void QgsMapToolNodeTool::deactivate()
|
||||
removeRubberBands();
|
||||
delete mSelectionFeature;
|
||||
mSelectionFeature = NULL;
|
||||
disconnect( mCanvas->currentLayer(), SIGNAL( featureDeleted( int ) ) );
|
||||
disconnect( mCanvas->currentLayer(), SIGNAL( featureDeleted( QgsFeatureId ) ) );
|
||||
disconnect( mCanvas->currentLayer(), SIGNAL( layerModified( bool ) ) );
|
||||
|
||||
mQRubberBand = NULL;
|
||||
@ -918,7 +922,11 @@ void SelectionFeature::cleanRubberBandsData()
|
||||
}
|
||||
}
|
||||
|
||||
void SelectionFeature::setSelectedFeature( int featureId, QgsVectorLayer* vlayer, QgsRubberBand* rubberBand, QgsMapCanvas* canvas, QgsFeature* feature )
|
||||
void SelectionFeature::setSelectedFeature( QgsFeatureId featureId,
|
||||
QgsVectorLayer* vlayer,
|
||||
QgsRubberBand* rubberBand,
|
||||
QgsMapCanvas* canvas,
|
||||
QgsFeature* feature )
|
||||
{
|
||||
if ( mFeatureSelected )
|
||||
{
|
||||
@ -1397,7 +1405,7 @@ void SelectionFeature::invertVertexSelection( int vertexNr, bool invert )
|
||||
}
|
||||
|
||||
|
||||
void SelectionFeature::updateVertexMarkersPosition( QgsMapCanvas* canvas )
|
||||
void SelectionFeature::updateVertexMarkersPosition()
|
||||
{
|
||||
//function for on-line updating vertex markers without refresh of canvas
|
||||
for ( int i = 0; i < mVertexMap.size(); i++ )
|
||||
@ -1408,7 +1416,7 @@ void SelectionFeature::updateVertexMarkersPosition( QgsMapCanvas* canvas )
|
||||
}
|
||||
|
||||
|
||||
int SelectionFeature::featureId()
|
||||
QgsFeatureId SelectionFeature::featureId()
|
||||
{
|
||||
return mFeatureId;
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ class SelectionFeature: public QObject
|
||||
* @param canvas mapCanvas on which we are working
|
||||
* @param feature feature with which we work this parameter is not mandatory if it's not filled feature will be loaded
|
||||
*/
|
||||
void setSelectedFeature( int featureId, QgsVectorLayer* vlayer, QgsRubberBand* rubberBand, QgsMapCanvas* canvas, QgsFeature* feature = NULL );
|
||||
void setSelectedFeature( QgsFeatureId featureId, QgsVectorLayer* vlayer, QgsRubberBand* rubberBand, QgsMapCanvas* canvas, QgsFeature* feature = NULL );
|
||||
|
||||
/**
|
||||
* Function to select vertex with number
|
||||
@ -110,7 +110,7 @@ class SelectionFeature: public QObject
|
||||
* Updates vertex markers position accoording to changed feature geometry
|
||||
* @param canvas map canvas we are working with
|
||||
*/
|
||||
void updateVertexMarkersPosition( QgsMapCanvas* canvas );
|
||||
void updateVertexMarkersPosition();
|
||||
|
||||
/**
|
||||
* Tells if vertex is selected
|
||||
@ -123,7 +123,7 @@ class SelectionFeature: public QObject
|
||||
* Getting feature Id of feature selected
|
||||
* @return feature id of selected feature
|
||||
*/
|
||||
int featureId();
|
||||
QgsFeatureId featureId();
|
||||
|
||||
/**
|
||||
* Getting vertex map of vertexes
|
||||
@ -207,7 +207,7 @@ class SelectionFeature: public QObject
|
||||
void validateGeometry( QgsGeometry *g = NULL );
|
||||
|
||||
QgsFeature* mFeature;
|
||||
int mFeatureId;
|
||||
QgsFeatureId mFeatureId;
|
||||
bool mFeatureSelected;
|
||||
QgsVectorLayer* mVlayer;
|
||||
QgsRubberBand* mRubberBand;
|
||||
@ -258,7 +258,7 @@ class QgsMapToolNodeTool: public QgsMapToolVertexEdit
|
||||
* Processing incoming signal of deleted feature (for deletion of selected feature)
|
||||
* @param featureId id of deleted feature
|
||||
*/
|
||||
void featureDeleted( int featureId );
|
||||
void featureDeleted( QgsFeatureId featureId );
|
||||
|
||||
/**
|
||||
* Processing incoming signal of deleted feature (for deletion of selected feature)
|
||||
@ -328,10 +328,10 @@ class QgsMapToolNodeTool: public QgsMapToolVertexEdit
|
||||
QList<QgsRubberBand*> mTopologyRubberBand;
|
||||
|
||||
/** vertexes of rubberbands which are to be moved */
|
||||
QMap<int, Vertexes*> mTopologyMovingVertexes;
|
||||
QMap<QgsFeatureId, Vertexes*> mTopologyMovingVertexes;
|
||||
|
||||
/** vertexes of features with int id which were already added tu rubber bands */
|
||||
QMap<int, Vertexes*> mTopologyRubberBandVertexes;
|
||||
QMap<QgsFeatureId, Vertexes*> mTopologyRubberBandVertexes;
|
||||
|
||||
/** object containing selected feature and it's vertexes */
|
||||
SelectionFeature* mSelectionFeature;
|
||||
@ -352,7 +352,7 @@ class QgsMapToolNodeTool: public QgsMapToolVertexEdit
|
||||
bool mSelectAnother;
|
||||
|
||||
/** feature id of another feature where user clicked */
|
||||
int mAnother;
|
||||
QgsFeatureId mAnother;
|
||||
|
||||
/** stored position of last press down action to count how much vertexes should be moved */
|
||||
QgsPoint* mLastCoordinates;
|
||||
|
@ -36,7 +36,7 @@ QgsMapToolRotateLabel::~QgsMapToolRotateLabel()
|
||||
delete mRotationPreviewBox;
|
||||
}
|
||||
|
||||
void QgsMapToolRotateLabel::canvasPressEvent( QMouseEvent * e )
|
||||
void QgsMapToolRotateLabel::canvasPressEvent( QMouseEvent *e )
|
||||
{
|
||||
deleteRubberBands();
|
||||
|
||||
@ -83,7 +83,7 @@ void QgsMapToolRotateLabel::canvasPressEvent( QMouseEvent * e )
|
||||
}
|
||||
}
|
||||
|
||||
void QgsMapToolRotateLabel::canvasMoveEvent( QMouseEvent * e )
|
||||
void QgsMapToolRotateLabel::canvasMoveEvent( QMouseEvent *e )
|
||||
{
|
||||
if ( mLabelRubberBand )
|
||||
{
|
||||
@ -120,8 +120,10 @@ void QgsMapToolRotateLabel::canvasMoveEvent( QMouseEvent * e )
|
||||
}
|
||||
}
|
||||
|
||||
void QgsMapToolRotateLabel::canvasReleaseEvent( QMouseEvent * e )
|
||||
void QgsMapToolRotateLabel::canvasReleaseEvent( QMouseEvent *e )
|
||||
{
|
||||
Q_UNUSED( e );
|
||||
|
||||
if ( !mLabelRubberBand ) //no rubber band created (most likely because the current label cannot be rotated )
|
||||
{
|
||||
return;
|
||||
|
@ -66,7 +66,7 @@ bool QgsMapToolRotatePointSymbols::layerIsRotatable( QgsMapLayer* ml )
|
||||
return true;
|
||||
}
|
||||
|
||||
void QgsMapToolRotatePointSymbols::canvasPressEvent( QMouseEvent * e )
|
||||
void QgsMapToolRotatePointSymbols::canvasPressEvent( QMouseEvent *e )
|
||||
{
|
||||
if ( !mCanvas )
|
||||
{
|
||||
@ -133,7 +133,7 @@ void QgsMapToolRotatePointSymbols::canvasPressEvent( QMouseEvent * e )
|
||||
mRotating = true;
|
||||
}
|
||||
|
||||
void QgsMapToolRotatePointSymbols::canvasMoveEvent( QMouseEvent * e )
|
||||
void QgsMapToolRotatePointSymbols::canvasMoveEvent( QMouseEvent *e )
|
||||
{
|
||||
if ( !mRotating )
|
||||
{
|
||||
@ -178,8 +178,10 @@ void QgsMapToolRotatePointSymbols::canvasMoveEvent( QMouseEvent * e )
|
||||
setPixmapItemRotation( displayValue );
|
||||
}
|
||||
|
||||
void QgsMapToolRotatePointSymbols::canvasReleaseEvent( QMouseEvent * e )
|
||||
void QgsMapToolRotatePointSymbols::canvasReleaseEvent( QMouseEvent *e )
|
||||
{
|
||||
Q_UNUSED( e );
|
||||
|
||||
if ( mRotating && mActiveLayer )
|
||||
{
|
||||
mActiveLayer->beginEditCommand( tr( "Rotate symbol" ) );
|
||||
|
@ -42,7 +42,7 @@ class QgsMapToolRotatePointSymbols: public QgsMapToolEdit
|
||||
|
||||
private:
|
||||
QgsVectorLayer* mActiveLayer;
|
||||
int mFeatureNumber;
|
||||
QgsFeatureId mFeatureNumber;
|
||||
/**Last azimut between mouse and edited point*/
|
||||
double mCurrentMouseAzimut;
|
||||
/**Last feature rotation*/
|
||||
|
@ -38,14 +38,15 @@ QgsMapToolSelectRectangle::QgsMapToolSelectRectangle( QgsMapCanvas* canvas )
|
||||
}
|
||||
|
||||
|
||||
void QgsMapToolSelectRectangle::canvasPressEvent( QMouseEvent * e )
|
||||
void QgsMapToolSelectRectangle::canvasPressEvent( QMouseEvent *e )
|
||||
{
|
||||
Q_UNUSED( e );
|
||||
mSelectRect.setRect( 0, 0, 0, 0 );
|
||||
mRubberBand = new QgsRubberBand( mCanvas, true );
|
||||
}
|
||||
|
||||
|
||||
void QgsMapToolSelectRectangle::canvasMoveEvent( QMouseEvent * e )
|
||||
void QgsMapToolSelectRectangle::canvasMoveEvent( QMouseEvent *e )
|
||||
{
|
||||
if ( e->buttons() != Qt::LeftButton )
|
||||
return;
|
||||
@ -60,7 +61,7 @@ void QgsMapToolSelectRectangle::canvasMoveEvent( QMouseEvent * e )
|
||||
}
|
||||
|
||||
|
||||
void QgsMapToolSelectRectangle::canvasReleaseEvent( QMouseEvent * e )
|
||||
void QgsMapToolSelectRectangle::canvasReleaseEvent( QMouseEvent *e )
|
||||
{
|
||||
QgsVectorLayer* vlayer = QgsMapToolSelectUtils::getCurrentVectorLayer( mCanvas );
|
||||
if ( vlayer == NULL )
|
||||
|
@ -132,7 +132,7 @@ void QgsMapToolSelectUtils::setSelectFeatures( QgsMapCanvas* canvas,
|
||||
|
||||
QgsFeatureIds newSelectedFeatures;
|
||||
QgsFeature f;
|
||||
int closestFeatureId = 0;
|
||||
QgsFeatureId closestFeatureId = 0;
|
||||
bool foundSingleFeature = false;
|
||||
double closestFeatureDist = std::numeric_limits<double>::max();
|
||||
while ( vlayer->nextFeature( f ) )
|
||||
|
@ -121,8 +121,10 @@ void QgsMeasureDialog::mouseMove( QgsPoint &point )
|
||||
}
|
||||
}
|
||||
|
||||
void QgsMeasureDialog::addPoint( QgsPoint &point )
|
||||
void QgsMeasureDialog::addPoint( QgsPoint &p )
|
||||
{
|
||||
Q_UNUSED( p );
|
||||
|
||||
QSettings settings;
|
||||
int decimalPlaces = settings.value( "/qgis/measure/decimalplaces", "3" ).toInt();
|
||||
|
||||
|
@ -96,7 +96,7 @@ void QgsMergeAttributesDialog::createTableWidgetContents()
|
||||
|
||||
for ( int i = 0; i < mFeatureList.size(); ++i )
|
||||
{
|
||||
verticalHeaderLabels << QString::number( mFeatureList[i].id() );
|
||||
verticalHeaderLabels << FID_TO_STRING( mFeatureList[i].id() );
|
||||
|
||||
const QgsAttributeMap &attrs = mFeatureList[i].attributeMap();
|
||||
|
||||
@ -147,7 +147,8 @@ QComboBox* QgsMergeAttributesDialog::createMergeComboBox( QVariant::Type columnT
|
||||
newComboBox->addItem( tr( "Mean" ) );
|
||||
}
|
||||
|
||||
QObject::connect( newComboBox, SIGNAL( currentIndexChanged( const QString& ) ), this, SLOT( comboValueChanged( const QString& ) ) );
|
||||
QObject::connect( newComboBox, SIGNAL( currentIndexChanged( const QString& ) ),
|
||||
this, SLOT( comboValueChanged( const QString& ) ) );
|
||||
return newComboBox;
|
||||
}
|
||||
|
||||
@ -163,8 +164,9 @@ int QgsMergeAttributesDialog::findComboColumn( QComboBox* c ) const
|
||||
return -1;
|
||||
}
|
||||
|
||||
void QgsMergeAttributesDialog::comboValueChanged( const QString & text )
|
||||
void QgsMergeAttributesDialog::comboValueChanged( const QString &text )
|
||||
{
|
||||
Q_UNUSED( text );
|
||||
QComboBox* senderComboBox = qobject_cast<QComboBox *>( sender() );
|
||||
if ( !senderComboBox )
|
||||
{
|
||||
|
@ -166,10 +166,12 @@ void QgsPasteTransformations::addTransfer( const QString& sourceSelectedFieldNam
|
||||
|
||||
void QgsPasteTransformations::layerChanged( const QString& layerName, std::vector<QString>* fields )
|
||||
{
|
||||
Q_UNUSED( fields );
|
||||
Q_UNUSED( layerName );
|
||||
// Fetch the fields that will be populated into the Transfer rows.
|
||||
QgsDebugMsg( QString( "Layer changed to %1." ).arg( layerName ) );
|
||||
|
||||
restoreTransfers( sourceLayerComboBox ->currentText(),
|
||||
restoreTransfers( sourceLayerComboBox->currentText(),
|
||||
destinationLayerComboBox->currentText() );
|
||||
}
|
||||
|
||||
|
@ -163,9 +163,13 @@ void QgsPluginRegistry::unloadAll()
|
||||
it++ )
|
||||
{
|
||||
if ( it->plugin() )
|
||||
{
|
||||
it->plugin()->unload();
|
||||
}
|
||||
else
|
||||
{
|
||||
QgsDebugMsg( "warning: plugin is NULL:" + it.key() );
|
||||
}
|
||||
}
|
||||
|
||||
if ( mPythonUtils && mPythonUtils->isEnabled() )
|
||||
|
@ -273,8 +273,9 @@ void QgsRasterCalcDialog::on_mExpressionTextEdit_textChanged()
|
||||
mButtonBox->button( QDialogButtonBox::Ok )->setEnabled( false );
|
||||
}
|
||||
|
||||
void QgsRasterCalcDialog::on_mOutputLayerLineEdit_textChanged( const QString& text )
|
||||
void QgsRasterCalcDialog::on_mOutputLayerLineEdit_textChanged( const QString &text )
|
||||
{
|
||||
Q_UNUSED( text );
|
||||
setAcceptButtonState();
|
||||
}
|
||||
|
||||
|
@ -2288,6 +2288,8 @@ void QgsRasterLayerProperties::pixelSelected( const QgsPoint& canvasPoint )
|
||||
|
||||
void QgsRasterLayerProperties::sboxSingleBandStdDev_valueChanged( double theValue )
|
||||
{
|
||||
Q_UNUSED( theValue );
|
||||
|
||||
if ( !ignoreSpinBoxEvent )
|
||||
{
|
||||
leGrayMin->setText( "" );
|
||||
@ -2299,6 +2301,7 @@ void QgsRasterLayerProperties::sboxSingleBandStdDev_valueChanged( double theValu
|
||||
|
||||
void QgsRasterLayerProperties::sboxThreeBandStdDev_valueChanged( double theValue )
|
||||
{
|
||||
Q_UNUSED( theValue );
|
||||
if ( !ignoreSpinBoxEvent )
|
||||
{
|
||||
leRedMin->setText( "" );
|
||||
@ -2321,6 +2324,7 @@ void QgsRasterLayerProperties::sliderTransparency_valueChanged( int theValue )
|
||||
|
||||
void QgsRasterLayerProperties::userDefinedMinMax_textEdited( QString theString )
|
||||
{
|
||||
Q_UNUSED( theString );
|
||||
/*
|
||||
* If all min max values are set and valid, then reset stdDev to 0.0
|
||||
*/
|
||||
|
@ -44,8 +44,9 @@ class QgsMarkerListModel : public QAbstractListModel
|
||||
mMarkers = QgsMarkerCatalogue::instance()->list();
|
||||
}
|
||||
|
||||
int rowCount( const QModelIndex & parent = QModelIndex() ) const
|
||||
int rowCount( const QModelIndex &parent = QModelIndex() ) const
|
||||
{
|
||||
Q_UNUSED( parent );
|
||||
return mMarkers.size();
|
||||
}
|
||||
|
||||
@ -655,6 +656,8 @@ void QgsSingleSymbolDialog::setLabel( QString label )
|
||||
|
||||
void QgsSingleSymbolDialog::symbolChanged( const QModelIndex ¤t, const QModelIndex &previous )
|
||||
{
|
||||
Q_UNUSED( current );
|
||||
Q_UNUSED( previous );
|
||||
emit settingsChanged();
|
||||
}
|
||||
|
||||
|
@ -41,9 +41,10 @@ class QgsSnappingDock : public QDockWidget
|
||||
setObjectName( "Snapping and Digitizing Options" ); // set object name so the position can be saved
|
||||
}
|
||||
|
||||
virtual void closeEvent( QCloseEvent * ev )
|
||||
virtual void closeEvent( QCloseEvent *e )
|
||||
{
|
||||
//deleteLater();
|
||||
Q_UNUSED( e );
|
||||
// deleteLater();
|
||||
}
|
||||
|
||||
};
|
||||
|
@ -83,6 +83,8 @@ void QgsTileScaleWidget::layerChanged( QgsMapLayer *layer )
|
||||
|
||||
void QgsTileScaleWidget::scaleChanged( double scale )
|
||||
{
|
||||
Q_UNUSED( scale );
|
||||
|
||||
if ( mResolutions.size() == 0 )
|
||||
return;
|
||||
|
||||
@ -106,6 +108,7 @@ void QgsTileScaleWidget::scaleChanged( double scale )
|
||||
|
||||
void QgsTileScaleWidget::on_mSlider_valueChanged( int value )
|
||||
{
|
||||
Q_UNUSED( value );
|
||||
QgsDebugMsg( QString( "slider released at %1: %2" ).arg( mSlider->value() ).arg( mResolutions[mSlider->value()] ) );
|
||||
mMapCanvas->zoomByFactor( mResolutions[mSlider->value()] / mMapCanvas->mapUnitsPerPixel() );
|
||||
}
|
||||
|
@ -244,8 +244,10 @@ QgsTip QgsTipFactory::getGuiTip()
|
||||
QgsTip myTip = mGuiTips.at( myValue );
|
||||
return myTip;
|
||||
}
|
||||
|
||||
int QgsTipFactory::randomNumber( int theMax )
|
||||
{
|
||||
Q_UNUSED( theMax );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -68,6 +68,7 @@ void QgsUndoWidget::redoChanged( bool value )
|
||||
|
||||
void QgsUndoWidget::indexChanged( int value )
|
||||
{
|
||||
Q_UNUSED( value );
|
||||
//redoButton->setDisabled( !value );
|
||||
//canvas refresh
|
||||
mMapCanvas->refresh();
|
||||
|
@ -138,6 +138,7 @@ QString QgsNewSpatialiteLayerDialog::selectedType() const
|
||||
|
||||
void QgsNewSpatialiteLayerDialog::on_leLayerName_textChanged( QString text )
|
||||
{
|
||||
Q_UNUSED( text );
|
||||
bool created = leLayerName->text().length() > 0 && mAttributeView->topLevelItemCount() > 0 && createDb();
|
||||
buttonBox->button( QDialogButtonBox::Ok )->setEnabled( created );
|
||||
buttonBox->button( QDialogButtonBox::Apply )->setEnabled( created );
|
||||
|
@ -161,6 +161,7 @@ void QgsSpatiaLiteSourceSelect::on_mSearchColumnComboBox_currentIndexChanged( co
|
||||
|
||||
void QgsSpatiaLiteSourceSelect::on_mSearchModeComboBox_currentIndexChanged( const QString & text )
|
||||
{
|
||||
Q_UNUSED( text );
|
||||
on_mSearchTableEdit_textChanged( mSearchTableEdit->text() );
|
||||
}
|
||||
|
||||
@ -903,4 +904,5 @@ void QgsSpatiaLiteSourceSelect::setConnectionListPosition()
|
||||
|
||||
void QgsSpatiaLiteSourceSelect::setSearchExpression( const QString & regexp )
|
||||
{
|
||||
Q_UNUSED( regexp );
|
||||
}
|
||||
|
@ -525,9 +525,13 @@ void QgsBrowser::refresh( const QModelIndex& index )
|
||||
{
|
||||
QgsDataItem *item = mModel->dataItem( index );
|
||||
if ( item )
|
||||
{
|
||||
QgsDebugMsg( "path = " + item->path() );
|
||||
}
|
||||
else
|
||||
{
|
||||
QgsDebugMsg( "invalid item" );
|
||||
}
|
||||
}
|
||||
|
||||
mModel->refresh( index );
|
||||
|
@ -117,6 +117,7 @@ QVariant QgsBrowserModel::data( const QModelIndex &index, int role ) const
|
||||
|
||||
QVariant QgsBrowserModel::headerData( int section, Qt::Orientation orientation, int role ) const
|
||||
{
|
||||
Q_UNUSED( section );
|
||||
if ( orientation == Qt::Horizontal && role == Qt::DisplayRole )
|
||||
{
|
||||
return QVariant( "header" );
|
||||
@ -142,7 +143,7 @@ int QgsBrowserModel::rowCount( const QModelIndex &parent ) const
|
||||
}
|
||||
}
|
||||
|
||||
bool QgsBrowserModel::hasChildren( const QModelIndex & parent ) const
|
||||
bool QgsBrowserModel::hasChildren( const QModelIndex &parent ) const
|
||||
{
|
||||
if ( !parent.isValid() )
|
||||
return true; // root item: its children are top level items
|
||||
@ -151,8 +152,9 @@ bool QgsBrowserModel::hasChildren( const QModelIndex & parent ) const
|
||||
return item && item->hasChildren();
|
||||
}
|
||||
|
||||
int QgsBrowserModel::columnCount( const QModelIndex & parent ) const
|
||||
int QgsBrowserModel::columnCount( const QModelIndex &parent ) const
|
||||
{
|
||||
Q_UNUSED( parent );
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -58,8 +58,10 @@ void QgsComposerArrow::initGraphicsSettings()
|
||||
setBrush( QBrush( QColor( 255, 255, 255, 0 ) ) );
|
||||
}
|
||||
|
||||
void QgsComposerArrow::paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget )
|
||||
void QgsComposerArrow::paint( QPainter* painter, const QStyleOptionGraphicsItem *itemStyle, QWidget *pWidget )
|
||||
{
|
||||
Q_UNUSED( itemStyle );
|
||||
Q_UNUSED( pWidget );
|
||||
if ( !painter )
|
||||
{
|
||||
return;
|
||||
@ -108,16 +110,18 @@ void QgsComposerArrow::setSceneRect( const QRectF& rectangle )
|
||||
adaptItemSceneRect();
|
||||
}
|
||||
|
||||
void QgsComposerArrow::drawHardcodedMarker( QPainter* p, MarkerType type )
|
||||
void QgsComposerArrow::drawHardcodedMarker( QPainter *p, MarkerType type )
|
||||
{
|
||||
Q_UNUSED( type );
|
||||
QBrush arrowBrush = p->brush();
|
||||
arrowBrush.setColor( mArrowColor );
|
||||
p->setBrush( arrowBrush );
|
||||
drawArrowHead( p, mStopPoint.x() - transform().dx(), mStopPoint.y() - transform().dy(), angle( mStartPoint, mStopPoint ), mArrowHeadWidth );
|
||||
}
|
||||
|
||||
void QgsComposerArrow::drawSVGMarker( QPainter* p, MarkerType type, const QString& markerPath )
|
||||
void QgsComposerArrow::drawSVGMarker( QPainter* p, MarkerType type, const QString &markerPath )
|
||||
{
|
||||
Q_UNUSED( markerPath );
|
||||
double ang = angle( mStartPoint, mStopPoint );
|
||||
|
||||
double arrowHeadHeight;
|
||||
|
@ -180,6 +180,7 @@ bool QgsComposerItem::_writeXML( QDomElement& itemElem, QDomDocument& doc ) cons
|
||||
|
||||
bool QgsComposerItem::_readXML( const QDomElement& itemElem, const QDomDocument& doc )
|
||||
{
|
||||
Q_UNUSED( doc );
|
||||
if ( itemElem.isNull() )
|
||||
{
|
||||
return false;
|
||||
@ -479,8 +480,14 @@ QgsComposerItem::MouseMoveAction QgsComposerItem::mouseMoveActionForPosition( co
|
||||
return QgsComposerItem::MoveItem; //default
|
||||
}
|
||||
|
||||
void QgsComposerItem::changeItemRectangle( const QPointF& currentPosition, const QPointF& mouseMoveStartPos, const QGraphicsRectItem* originalItem, double dx, double dy, QGraphicsRectItem* changeItem )
|
||||
void QgsComposerItem::changeItemRectangle( const QPointF& currentPosition,
|
||||
const QPointF& mouseMoveStartPos,
|
||||
const QGraphicsRectItem* originalItem,
|
||||
double dx, double dy,
|
||||
QGraphicsRectItem* changeItem )
|
||||
{
|
||||
Q_UNUSED( dx );
|
||||
Q_UNUSED( dy );
|
||||
if ( !changeItem || !originalItem || !mComposition )
|
||||
{
|
||||
return;
|
||||
|
@ -105,6 +105,8 @@ void QgsComposerItemGroup::removeItems()
|
||||
|
||||
void QgsComposerItemGroup::paint( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget )
|
||||
{
|
||||
Q_UNUSED( option );
|
||||
Q_UNUSED( widget );
|
||||
drawFrame( painter );
|
||||
if ( isSelected() )
|
||||
{
|
||||
|
@ -48,13 +48,15 @@ class CORE_EXPORT QgsComposerItemGroup: public QgsComposerItem
|
||||
* @param elem is Dom element corresponding to 'Composer' tag
|
||||
* @param doc is the Dom document
|
||||
*/
|
||||
bool writeXML( QDomElement& elem, QDomDocument & doc ) const { return true; }
|
||||
bool writeXML( QDomElement& elem, QDomDocument & doc ) const
|
||||
{ Q_UNUSED( elem ); Q_UNUSED( doc ); return true; }
|
||||
|
||||
/** sets state from Dom document
|
||||
* @param itemElem is Dom node corresponding to item tag
|
||||
* @param doc is the Dom document
|
||||
*/
|
||||
bool readXML( const QDomElement& itemElem, const QDomDocument& doc ) { return true; }
|
||||
bool readXML( const QDomElement& itemElem, const QDomDocument& doc )
|
||||
{ Q_UNUSED( itemElem ); Q_UNUSED( doc ); return true; }
|
||||
|
||||
QSet<QgsComposerItem*> items() { return mItems; }
|
||||
|
||||
|
@ -33,6 +33,8 @@ QgsComposerLabel::~QgsComposerLabel()
|
||||
|
||||
void QgsComposerLabel::paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget )
|
||||
{
|
||||
Q_UNUSED( itemStyle );
|
||||
Q_UNUSED( pWidget );
|
||||
if ( !painter )
|
||||
{
|
||||
return;
|
||||
|
@ -62,6 +62,8 @@ QgsComposerLegend::~QgsComposerLegend()
|
||||
|
||||
void QgsComposerLegend::paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget )
|
||||
{
|
||||
Q_UNUSED( itemStyle );
|
||||
Q_UNUSED( pWidget );
|
||||
paintAndDetermineSize( painter );
|
||||
}
|
||||
|
||||
@ -346,6 +348,7 @@ void QgsComposerLegend::drawSymbol( QPainter* p, QgsSymbol* s, double currentYCo
|
||||
|
||||
void QgsComposerLegend::drawSymbolV2( QPainter* p, QgsSymbolV2* s, double currentYCoord, double& currentXPosition, double& symbolHeight, int layerOpacity ) const
|
||||
{
|
||||
Q_UNUSED( layerOpacity );
|
||||
if ( !p || !s )
|
||||
{
|
||||
return;
|
||||
|
@ -235,6 +235,8 @@ void QgsComposerMap::cache( void )
|
||||
|
||||
void QgsComposerMap::paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget )
|
||||
{
|
||||
Q_UNUSED( pWidget );
|
||||
|
||||
if ( !mComposition || !painter )
|
||||
{
|
||||
return;
|
||||
|
@ -45,6 +45,8 @@ QgsComposerPicture::~QgsComposerPicture()
|
||||
|
||||
void QgsComposerPicture::paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget )
|
||||
{
|
||||
Q_UNUSED( itemStyle );
|
||||
Q_UNUSED( pWidget );
|
||||
if ( !painter )
|
||||
{
|
||||
return;
|
||||
|
@ -41,6 +41,8 @@ QgsComposerScaleBar::~QgsComposerScaleBar()
|
||||
|
||||
void QgsComposerScaleBar::paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget )
|
||||
{
|
||||
Q_UNUSED( itemStyle );
|
||||
Q_UNUSED( pWidget );
|
||||
if ( !mStyle || !painter )
|
||||
{
|
||||
return;
|
||||
|
@ -38,6 +38,8 @@ QgsComposerShape::~QgsComposerShape()
|
||||
|
||||
void QgsComposerShape::paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget )
|
||||
{
|
||||
Q_UNUSED( itemStyle );
|
||||
Q_UNUSED( pWidget );
|
||||
if ( !painter )
|
||||
{
|
||||
return;
|
||||
|
@ -19,9 +19,13 @@
|
||||
#include "qgslogger.h"
|
||||
#include <QPainter>
|
||||
|
||||
QgsComposerTable::QgsComposerTable( QgsComposition* composition ): QgsComposerItem( composition ), mLineTextDistance( 1.0 ), mShowGrid( true ), mGridStrokeWidth( 0.5 ), mGridColor( QColor( 0, 0, 0 ) )
|
||||
QgsComposerTable::QgsComposerTable( QgsComposition* composition )
|
||||
: QgsComposerItem( composition )
|
||||
, mLineTextDistance( 1.0 )
|
||||
, mShowGrid( true )
|
||||
, mGridStrokeWidth( 0.5 )
|
||||
, mGridColor( QColor( 0, 0, 0 ) )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QgsComposerTable::~QgsComposerTable()
|
||||
@ -31,6 +35,8 @@ QgsComposerTable::~QgsComposerTable()
|
||||
|
||||
void QgsComposerTable::paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget )
|
||||
{
|
||||
Q_UNUSED( itemStyle );
|
||||
Q_UNUSED( pWidget );
|
||||
if ( !painter )
|
||||
{
|
||||
return;
|
||||
|
@ -74,7 +74,8 @@ class CORE_EXPORT QgsComposerTable: public QgsComposerItem
|
||||
QColor mGridColor;
|
||||
|
||||
/**Retrieves feature attributes*/
|
||||
virtual bool getFeatureAttributes( QList<QgsAttributeMap>& attributes ) {return false;} //= 0;
|
||||
virtual bool getFeatureAttributes( QList<QgsAttributeMap>& attributes )
|
||||
{ Q_UNUSED( attributes ); return false; } //= 0;
|
||||
virtual QMap<int, QString> getHeaderLabels() const { return QMap<int, QString>(); } //= 0;
|
||||
/**Calculate the maximum width values of the vector attributes*/
|
||||
virtual bool calculateMaxColumnWidths( QMap<int, double>& maxWidthMap, const QList<QgsAttributeMap>& attributeList ) const;
|
||||
|
@ -199,6 +199,7 @@ bool QgsComposition::writeXML( QDomElement& composerElem, QDomDocument& doc )
|
||||
|
||||
bool QgsComposition::readXML( const QDomElement& compositionElem, const QDomDocument& doc )
|
||||
{
|
||||
Q_UNUSED( doc );
|
||||
if ( compositionElem.isNull() )
|
||||
{
|
||||
return false;
|
||||
|
@ -485,6 +485,8 @@ bool QgsLegendModel::writeXML( QDomElement& composerLegendElem, QDomDocument& do
|
||||
|
||||
bool QgsLegendModel::readXML( const QDomElement& legendModelElem, const QDomDocument& doc )
|
||||
{
|
||||
Q_UNUSED( doc );
|
||||
|
||||
if ( legendModelElem.isNull() )
|
||||
{
|
||||
return false;
|
||||
@ -617,6 +619,9 @@ QStringList QgsLegendModel::mimeTypes() const
|
||||
|
||||
bool QgsLegendModel::dropMimeData( const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent )
|
||||
{
|
||||
Q_UNUSED( action );
|
||||
Q_UNUSED( column );
|
||||
|
||||
if ( !data->hasFormat( "text/xml" ) )
|
||||
{
|
||||
return false;
|
||||
|
@ -64,9 +64,12 @@ class CORE_EXPORT QgsLegendModel: public QStandardItemModel
|
||||
/**Updates the whole symbology of a layer*/
|
||||
void updateLayer( QStandardItem* layerItem );
|
||||
/**Tries to update a single classification item*/
|
||||
void updateVectorClassificationItem( QStandardItem* classificationItem, QgsSymbol* symbol, QString itemText ) {}
|
||||
void updateVectorV2ClassificationItem( QStandardItem* classificationItem, QgsSymbolV2* symbol, QString itemText ) {}
|
||||
void updateRasterClassificationItem( QStandardItem* classificationItem ) {}
|
||||
void updateVectorClassificationItem( QStandardItem* classificationItem, QgsSymbol* symbol, QString itemText )
|
||||
{ Q_UNUSED( classificationItem ); Q_UNUSED( symbol ); Q_UNUSED( itemText ); }
|
||||
void updateVectorV2ClassificationItem( QStandardItem* classificationItem, QgsSymbolV2* symbol, QString itemText )
|
||||
{ Q_UNUSED( classificationItem ); Q_UNUSED( symbol ); Q_UNUSED( itemText ); }
|
||||
void updateRasterClassificationItem( QStandardItem* classificationItem )
|
||||
{ Q_UNUSED( classificationItem ); }
|
||||
|
||||
bool writeXML( QDomElement& composerLegendElem, QDomDocument& doc ) const;
|
||||
bool readXML( const QDomElement& legendModelElem, const QDomDocument& doc );
|
||||
|
@ -42,6 +42,7 @@ QString QgsNumericScaleBarStyle::name() const
|
||||
|
||||
void QgsNumericScaleBarStyle::draw( QPainter* p, double xOffset ) const
|
||||
{
|
||||
Q_UNUSED( xOffset );
|
||||
if ( !p || !mScaleBar )
|
||||
{
|
||||
return;
|
||||
|
@ -40,6 +40,8 @@ QgsPaperItem::~QgsPaperItem()
|
||||
|
||||
void QgsPaperItem::paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget )
|
||||
{
|
||||
Q_UNUSED( itemStyle );
|
||||
Q_UNUSED( pWidget );
|
||||
if ( !painter )
|
||||
{
|
||||
return;
|
||||
@ -110,11 +112,15 @@ void QgsPaperItem::paint( QPainter* painter, const QStyleOptionGraphicsItem* ite
|
||||
|
||||
bool QgsPaperItem::writeXML( QDomElement& elem, QDomDocument & doc ) const
|
||||
{
|
||||
Q_UNUSED( elem );
|
||||
Q_UNUSED( doc );
|
||||
return true;
|
||||
}
|
||||
|
||||
bool QgsPaperItem::readXML( const QDomElement& itemElem, const QDomDocument& doc )
|
||||
{
|
||||
Q_UNUSED( itemElem );
|
||||
Q_UNUSED( doc );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -959,4 +959,5 @@ qint64 QextSerialPort::writeData(const char * data, qint64 maxSize)
|
||||
|
||||
void QextSerialPort::onWinEvent( HANDLE h )
|
||||
{
|
||||
Q_UNUSED(h);
|
||||
}
|
||||
|
@ -158,8 +158,8 @@ QString QextSerialPort::portName() const
|
||||
*/
|
||||
QByteArray QextSerialPort::readAll()
|
||||
{
|
||||
int avail = this->bytesAvailable();
|
||||
return (avail > 0) ? this->read(avail) : QByteArray();
|
||||
qint64 avail = bytesAvailable();
|
||||
return avail > 0 ? read(avail) : QByteArray();
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -49,5 +49,7 @@ void QgsGpsdConnection::error( QAbstractSocket::SocketError socketError )
|
||||
#if QGISDEBUG
|
||||
QTcpSocket *socket = qobject_cast< QTcpSocket * >( mSource );
|
||||
QgsDebugMsg( QString( "error: %1 %2" ).arg( socketError ).arg( socket->errorString() ) );
|
||||
#else
|
||||
Q_UNUSED( socketError );
|
||||
#endif
|
||||
}
|
||||
|
@ -145,7 +145,7 @@ void QgsGPSDetector::advance()
|
||||
|
||||
Q_ASSERT( gpsParams.size() >= 3 );
|
||||
|
||||
mConn = new QgsGpsdConnection( gpsParams[0], gpsParams[1].toInt(), gpsParams[2] );
|
||||
mConn = new QgsGpsdConnection( gpsParams[0], gpsParams[1].toShort(), gpsParams[2] );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -177,6 +177,8 @@ void QgsGPSDetector::advance()
|
||||
|
||||
void QgsGPSDetector::detected( const QgsGPSInformation& info )
|
||||
{
|
||||
Q_UNUSED( info );
|
||||
|
||||
if ( !mConn )
|
||||
{
|
||||
// advance if connection was destroyed
|
||||
|
@ -47,7 +47,7 @@ void QgsNMEAConnection::parseData()
|
||||
}
|
||||
|
||||
//print out the data as a test
|
||||
int numBytes = 0;
|
||||
qint64 numBytes = 0;
|
||||
if ( mSource->isSequential() ) //necessary because of a bug in QExtSerialPort
|
||||
{
|
||||
numBytes = mSource->size();
|
||||
|
@ -41,7 +41,7 @@ int nmea_calc_crc( const char *buff, int buff_sz )
|
||||
/**
|
||||
* \brief Convert string to number
|
||||
*/
|
||||
int nmea_atoi( const char *str, int str_sz, int radix )
|
||||
int nmea_atoi( const char *str, size_t str_sz, int radix )
|
||||
{
|
||||
char *tmp_ptr;
|
||||
char buff[NMEA_CONVSTR_BUF];
|
||||
|
@ -12,6 +12,7 @@
|
||||
#define __NMEA_TOK_H__
|
||||
|
||||
#include "config.h"
|
||||
#include "stdlib.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
@ -19,7 +20,7 @@ extern "C"
|
||||
#endif
|
||||
|
||||
int nmea_calc_crc( const char *buff, int buff_sz );
|
||||
int nmea_atoi( const char *str, int str_sz, int radix );
|
||||
int nmea_atoi( const char *str, size_t str_sz, int radix );
|
||||
double nmea_atof( const char *str, int str_sz );
|
||||
int nmea_printf( char *buff, int buff_sz, const char *format, ... );
|
||||
int nmea_scanf( const char *buff, int buff_sz, const char *format, ... );
|
||||
|
@ -38,6 +38,8 @@
|
||||
#include <iostream>
|
||||
#endif
|
||||
|
||||
#include <qglobal.h>
|
||||
|
||||
|
||||
#include <cmath>
|
||||
#include <cstring>
|
||||
@ -255,6 +257,8 @@ namespace pal
|
||||
|
||||
int FeaturePart::setPositionOverPoint( double x, double y, double scale, LabelPosition ***lPos, double delta_width )
|
||||
{
|
||||
Q_UNUSED( scale );
|
||||
Q_UNUSED( delta_width );
|
||||
int nbp = 3;
|
||||
*lPos = new LabelPosition *[nbp];
|
||||
|
||||
|
@ -343,6 +343,7 @@ namespace pal
|
||||
*/
|
||||
Problem* Pal::extract( int nbLayers, char **layersName, double *layersFactor, double lambda_min, double phi_min, double lambda_max, double phi_max, double scale, std::ofstream *svgmap )
|
||||
{
|
||||
Q_UNUSED( svgmap );
|
||||
// to store obstacles
|
||||
RTree<PointSet*, double, 2, double> *obstacles = new RTree<PointSet*, double, 2, double>();
|
||||
|
||||
|
@ -38,6 +38,8 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <qglobal.h>
|
||||
|
||||
#include "pointset.h"
|
||||
#include "util.h"
|
||||
|
||||
@ -197,6 +199,8 @@ namespace pal
|
||||
{
|
||||
#ifdef _DEBUG_
|
||||
std::cout << "splitPolygons: " << uid << std::endl;
|
||||
#else
|
||||
Q_UNUSED( uid );
|
||||
#endif
|
||||
int i, j;
|
||||
|
||||
|
@ -103,7 +103,7 @@ QString QgsAttributeAction::expandAction( QString action, const QgsAttributeMap
|
||||
// for the actual substitutions.
|
||||
|
||||
QString expanded_action;
|
||||
if ( clickedOnValue >= 0 && attributes.contains( clickedOnValue ) )
|
||||
if ( attributes.contains( clickedOnValue ) )
|
||||
expanded_action = action.replace( "%%", attributes[clickedOnValue].toString() );
|
||||
else
|
||||
expanded_action = action;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user