ealione
ealione

Reputation: 1636

How to inherit from my custom class

I have created a class in Qt that has a number of public properties lets say

class items
{
public:
    QString name;
    QString description;

How can I create a new class that inherits all the variables and methods from this class?

Upvotes: 1

Views: 283

Answers (1)

Ali Mofrad
Ali Mofrad

Reputation: 318

Your question is about c++ not Qt. You can search c++ documents to learn about c++ inheritance.

You can inherit another class in this way:

class myClass : public items
{
    myClass() : Item()
    {
       //
    }
}

Upvotes: 0

Related Questions