I guess my question is more about C++ then Qt, but I'm not sure.
I have a class, and it has a member that is a QVector<type>
I want to initialize it inside the Class Constructor. After some tries, I got one working:
variableName = QVector<type>::QVector<type>(0);
.h
class Protocol
{
...
typedef int second;
typedef QVector<second> conj_seconds;
...
Private:
conj_seconds list_seconds;
...
}
.cpp
Protocol::Protocol()
{
...
list_seconds = QVector<second>::QVector<second>(0);
...
}
.h
class Protocol
{
...
typedef int second;
typedef QVector<second> conj_seconds;
...
Private:
conj_seconds list_seconds;
...
}
.cpp
Protocol::Protocol()
{
...
list_seconds = QVector<second>::QVector<second>(0);
...
}
To copy to clipboard, switch view to plain text mode
Is there a more... efficient way? elegant way? It seems so... brute to me 
and,
another question,
I can't seem to be able to use "conj_seconds" as a return parameter for my methods. Any ideas why?
(yes, I included "protocol.h", and <QVector>)
thank you!
*Edit*
actually, No typedef name can be used as a return parameter, but they work fine as other parameters...
Bookmarks