Custom Visibility Modifiers in C++ -
i reading signals & slots | qt core 5.4 , had following code snipped.
#include <qobject> class counter : public qobject { q_object public: counter() { m_value = 0; } int value() const { return m_value; } public slots: void setvalue(int value); signals: void valuechanged(int newvalue); private: int m_value; };
i have seen private
, public
, , protected
before never this.
what going on whole
public slots:
,signals:
visibility modifiers (is called)?what mean , in standard talk this?
when can / should use these in own code?
slots
signals
evaluate empty strings or modifiers , defined implicitly including qobject.h
. these markers qt moc
(meta object compiler). q_object
being expanded generic qt-class interface.
the moc
generate code header , these macros provide information 'these methods slots' or 'this going qt-ified class'
you should use them in qt-projects , case develop class 'become' , deal qt objects. examples own qt-widgets or object should able send/receive signals.
you won't find in standard these macros because not part of it. it's extension qt-framework , able compile classes when include appropriate qt header files.
Comments
Post a Comment