E
E
Egorithm2017-02-01 15:03:04
Qt
Egorithm, 2017-02-01 15:03:04

Qt. How to define a static QStringList?

This is how it doesn't work:

class MyClass
{
private:
    static QStringList MyString;
};

QStringList MyClass::MyString << "1" << "2" << "3";

This also doesn't work:
QStringList MyClass::MyString = { "1", "2", "3" };

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly, 2017-02-01
@EgoRusMarch

QStringList MyClass::MyString = { "1", "2", "3" };

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question