Round sip house12/9/2023 ![]() Other code that is available in the public API. It is required to write API documentation for every class, method, enum and QgsAbstractGeometry *geometry() const ( QgsAbstractGeometry isĪbstract and will probably need to be casted) QgsVectorLayer *layer() const ( QgsVectorLayer inherits QObject) QList layers() const ( QList is implicitly shared) QString title() const ( QString is implicitly shared) QObject or subclassed objects as pointers. Is implicitly shared objects, which are always returned by value. Return small and trivially copied objects as values. setTitle( const QString& title ) instead of With the Qt API, even implicitly shared objects are passed by const ![]() Objects), they should be passed by const reference. Unless argument objects are small and trivially copied (such as QPoint Pay careful attention to when arguments should be passed by reference. setColor( const QColor& color ) instead of setXml insteadįunction arguments should use descriptive names. setDestinationSize instead of setDestSize,Īcronyms should also be camel cased for consistency. The function name should convey something about the purpose of the function.įor consistency with the existing QGIS API and with the Qt API, abbreviations This may require that cached value type member variables are marked withįunction names begin with a lowercase letter and are formed using mixed case. Accessor functions for theĮnsure that accessors are correctly marked with const. Theįunction should be named without a get prefix. Mutable static class member names should begin with a lower case s,īut constant static class member names should be all caps:Ĭlass member values should be obtained through accesssor functions. Since protected members cannot be used from the Python bindings. Protected members shouldīe avoided when the member may need to be accessed from Python subclasses, Public class members are STRONGLY discouraged. Names Ĭlass in QGIS begin with Qgs and are formed using camel case.Ĭlass member names begin with a lower case m and are formed using mixed These standards should be followed by all QGIS developers. Prefer Having Constants First in Predicates Getting up and running with QtCreator and QGIS QGIS Desktop User Guide/Manual (QGIS 3.28).
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |