mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
The *Location classes can now be used with QVariant, QHash and signals/slots.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1487 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -18,6 +18,9 @@
|
|||||||
#include "elementslocation.h"
|
#include "elementslocation.h"
|
||||||
#include "qetapp.h"
|
#include "qetapp.h"
|
||||||
|
|
||||||
|
// make this class usable with QVariant
|
||||||
|
int ElementsLocation::MetaTypeId = qRegisterMetaType<ElementsLocation>("ElementsLocation");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Constructeur par defaut
|
Constructeur par defaut
|
||||||
*/
|
*/
|
||||||
@@ -205,3 +208,11 @@ ElementsLocation ElementsLocation::locationFromString(const QString &string) {
|
|||||||
location.fromString(string);
|
location.fromString(string);
|
||||||
return(location);
|
return(location);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@param location A standard element location
|
||||||
|
@return a hash identifying this location
|
||||||
|
*/
|
||||||
|
uint qHash(const ElementsLocation &location) {
|
||||||
|
return(qHash(location.toString()));
|
||||||
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef ELEMENTS_LOCATION_H
|
#ifndef ELEMENTS_LOCATION_H
|
||||||
#define ELEMENTS_LOCATION_H
|
#define ELEMENTS_LOCATION_H
|
||||||
|
#include <QtCore>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
class QETProject;
|
class QETProject;
|
||||||
/**
|
/**
|
||||||
@@ -52,5 +53,10 @@ class ElementsLocation {
|
|||||||
private:
|
private:
|
||||||
QString path_;
|
QString path_;
|
||||||
QETProject *project_;
|
QETProject *project_;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static int MetaTypeId; ///< Id of the corresponding Qt meta type
|
||||||
};
|
};
|
||||||
|
Q_DECLARE_METATYPE(ElementsLocation)
|
||||||
|
uint qHash(const ElementsLocation &);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
#include "qetapp.h"
|
#include "qetapp.h"
|
||||||
|
|
||||||
// make this class usable with QVariant
|
// make this class usable with QVariant
|
||||||
int t = qRegisterMetaType<TitleBlockTemplateLocation>("TitleBlockTemplateLocation");
|
int TitleBlockTemplateLocation::MetaTypeId = qRegisterMetaType<TitleBlockTemplateLocation>("TitleBlockTemplateLocation");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Constructor
|
Constructor
|
||||||
@@ -162,3 +162,10 @@ bool TitleBlockTemplateLocation::operator==(const TitleBlockTemplateLocation &lo
|
|||||||
return(location.collection_ == collection_ && location.name_ == name_);
|
return(location.collection_ == collection_ && location.name_ == name_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@param location A standard title block template location
|
||||||
|
@return a hash identifying this location
|
||||||
|
*/
|
||||||
|
uint qHash(const TitleBlockTemplateLocation &location) {
|
||||||
|
return(qHash(location.toString()));
|
||||||
|
}
|
||||||
|
|||||||
@@ -60,4 +60,6 @@ class TitleBlockTemplateLocation {
|
|||||||
public:
|
public:
|
||||||
static int MetaTypeId; ///< Id of the corresponding Qt meta type
|
static int MetaTypeId; ///< Id of the corresponding Qt meta type
|
||||||
};
|
};
|
||||||
|
Q_DECLARE_METATYPE(TitleBlockTemplateLocation)
|
||||||
|
uint qHash(const TitleBlockTemplateLocation &);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user