How to return more than two value in QT?
-
wrote on 18 Jul 2018, 09:57 last edited by
I want to return more than two value in QT. For knowing if I want to return two value, I will use QPair<t1,t2>. But now I want to return more than two value?
-
I want to return more than two value in QT. For knowing if I want to return two value, I will use QPair<t1,t2>. But now I want to return more than two value?
@amarism
return a struct -
I want to return more than two value in QT. For knowing if I want to return two value, I will use QPair<t1,t2>. But now I want to return more than two value?
-
@amarism
... or a class (instance), depending on how lightweight/heavyweight is appropriate.
Or pass in a reference to a struct/class instead of returning one.
Lots of possibilities.@JonB
class, struct ..... tomayto, tomahto
¯\(ツ)/¯ -
wrote on 18 Jul 2018, 10:41 last edited by
-
I want to return more than two value in QT. For knowing if I want to return two value, I will use QPair<t1,t2>. But now I want to return more than two value?
@amarism said in How to return more than two value in QT?:
QPair<t1,t2>. But now I want to return more than two value?
QVector<...>, QList<...>, std::array
-
@amarism said in How to return more than two value in QT?:
QPair<t1,t2>. But now I want to return more than two value?
QVector<...>, QList<...>, std::array
wrote on 18 Jul 2018, 11:50 last edited by@jsulm said in How to return more than two value in QT?:
QVector<...>, QList<...>, std::array
Thta only works if all the returned items are of the same type
-
wrote on 18 Jul 2018, 14:12 last edited by
@amarism said in How to return more than two value in QT?:
But now I want to return more than two value?
If the types of values you want to return are supported by QVariant, QVariantList or QVariantMap can be a solution.
1/12