QT class default access modifier
-
wrote on 31 Aug 2020, 20:30 last edited by
Hi,
This is a quick question, when a class is defined, what would be the default access modifier if there is none used after Q_OBJECT macro?
class mainW : public QMAinWIndow
{
Q_OBJECT
static const size_t var = 10;
...
public:
...
} -
Hi and welcome to devnet,
That's basic C++, everything that is above your "public:" is private.
-
wrote on 31 Aug 2020, 20:50 last edited by
Thanks.. I thought for QT was different... I am looking at the code and still there are many times the developer used "private" word many times inside the same class. I am not talking about private slots but some pointers and functions. Is it normal to find this kind of coding habit in QT world?
-
That's unrelated to Qt.
I have the habit of keeping things in order together by type.
All public methods together, then the protected and then the private. And then again with the variables.
1/4