[Interest] C++11 enum class and QSettings

Bob Hood bhood2 at comcast.net
Mon Dec 5 15:46:03 CET 2016


On 12/5/2016 12:48 AM, Michael Sué wrote:
> Hi,
>
> with a enum class you'll need to give the type explicitly, as there is no auto-conversion to int:
>
>       settings.setValue("report.stacking", QVariant::fromValue<ReportStacking>(report_stacking));
>
> The same with QVariant::value: var.value<ReportStacking>();

Thanks, Michael (and everybody else who answered).  Your solution worked 
perfectly with the least amount of changes.👍



More information about the Interest mailing list