What are the marks of quality shares?

In the long term, the quality of a company is also reflected in its share price. But what characterises quality and how can it be measured? And how can you invest in quality shares?