 One common question I always see out in the forums is how do I work with different data types? It's so confusing casting and converting and trying to figure out what goes where and if this is compatible and that's compatible Well, Qt actually helps you simplify that even further. So we're gonna say include And you're gonna include something called Q variant. Now Q variant is Pretty awesome. Let's go ahead and check it out Q variants a data type. So we're gonna say Q variant and let's call this value equal 1 and Let's go ahead and say Q variant And let's call this value 2 What witchcraft is this? Look at this. This isn't even generics. This is just you're shoving any value you want right into this thing So we just put an integer in here. We just put a string in here Let's go ahead and test this out and see how to work with Q variant So we're gonna say void test Q variant. Let's call this value We're just gonna print it out whatever it is and we're gonna just simply do a test try to convert this into an integer I'll say in test equals zero and If you press the letter t or even to you'll see that you have all these different conversions that you can do To bull bite array care date, I mean just about every basic Q type is in here. This is just nuts So we're gonna try to int so as we're gonna convert this to an int Notice how it gives us a pointer to a boolean. There's our callback right there. So we can figure out if this thing actually worked That's not book. It's bool. That would have been really bad. All right. There we go So really what we're doing here is we say we've got this integer We're gonna take our Q variant called to int and then we've got a callback right here where we're saying hey Modify this notice how we're passing that by reference So I shouldn't call it a callback. It's really by reference So we're gonna say if okay, then Actually, you know, we could just get rid of that and say not number Save and run this Hmm probably help if we call the actual function. There we go. There we go So we have our Q variant notice how it wraps it in these parentheses So we know what's going on here. It has an internal type. So it knows what it's storing So there's our Q variant. It is convertible to an int. Here's our Q variant, which is a Q string And there's the actual data here and it is not a number Q variant is extremely handy and extremely powerful if you're working with unknown data types Where you can just simply shove the value in a Q variant pass the Q variant over and just move on in life You don't have to worry about it and it can actually do all the converting for you I hope you enjoyed the video you just watched that was a preview of one of the videos out in the Cute core for beginners with C++ course. I have out on Udemy I am going to be making an intermediate in advance and then we're gonna start working on GUI technologies For example showing buttons lists tree views you name it and then moving on to things like QML The reason why I've restarted this whole thing is if you're watching these videos out on YouTube They are a little old this one was done in 2011 and the technology has changed over time So because the technology has changed some of these videos as good as they are Really don't line up with the current cute technology stack anymore. So I wanted to start from scratch I hope to see you out on Udemy and also in the voidrums Facebook group. See you there