Hey everybody, this is Brian and welcome to the 60th tutorial in Qt programming with C++. Um, wow, yeah, 60 videos. We've been, uh, we've been really making these things. So today we're going to cover the, what's this? If you don't know what this is, well, we're going to cover it. So let's just make a dialogue and let's just throw a push button out here. Pretty simple little dialogue we've got here. In our dialogue, we'll say UI, push button, set what's this. And if you watch the tooltip tutorial, you know exactly what I'm doing here. Just showing you that the, uh, the rendering is HTML aware. Now compile and build. Now tooltips will show when you mouse over and notice we don't have a tooltip here so nothing happens. This little question mark here is the, what's this? So if you click that and then notice how the icon changes and then you click this button, you get the, what's this help? It helps new users identify what's going on. So let's just say, you know, we've got a highly specialized program here and instead of okay or cancel, this says, uh, you know, release the, release the hounds. Well, what's that mean? What's that do? No idea. So it's just helpful for the user to, you know, be able to select the, what's this and then get a detailed description of what that button is supposed to be. So instead of hello world, we could say, uh, let the dogs out for a walk. Something very simple just to, you know, let the user know what's going on here. Now, excuse me, I don't always do this, but I want to use an example from the cute foundations or I should say foundations of cute development by, uh, Johan felon. I'm sorry if I'm mispronouncing your name. Excellent book. Um, it's one of my favorite books on cute so far. And what he does is actually say, let's put a link in here so the user can click. So we'll just say, well, that didn't work as planned. Let's delete that. And then we'll say, uh, href, single quotes, and we'll just say, and we'll say Google.com, save and run. And when you click this and then you do what's this, you notice there's a hyperlink. Now when you click that hyperlink, unfortunately nothing happens. Well, what this tutorial is going to aim to do is actually make that link work. So when you click it, it does something. So first thing we need to do is create what's called an event filter and we're going to do that. So let's go new class and we'll call this link filter, taking this straight out of the book if you own it. The base class for this is the queue object. Make sure that it has the queue object macro here and make sure that it is the in actual descendant of queue object, which it is. Now what we want to do is add a signal. So we were going to say, void link clicked, help effect it's about clicked, and we want to add protected. And we're going to say, bull event filter. And if you're wondering how I got that to magically appear, you hit control space and it'll give you a list. All right, so there's our header. Not a very complex class, but very, very efficient on the list. So let's actually just make it a little pretty here. Now we go into the implementation file for link filter. And we want to say, bull, filter, and we want the event filter. We need to fill these in here. So we're going to say, object in our event, we'll just call it event. Now what this does is we're going to install this class as an event filter in our form. So whenever an event is fired, it's going to go through this function called event filter, which is going to give us a pointer to an object and a pointer to an event. So we're going to say, very simply, now we need to filter them if event, did I spell event wrong? I did. Sorry about that. I'm still not wearing my glasses. My vision's getting better, but as you can see, I still spell horribly. Why is that not working? Let me pause this for a minute and let me figure this out. Okay, I'm back. I'm sorry about that. I figured out what the problem was. Go back into here and I added a reference to cute core and cute GUI. For whatever reason, it just wasn't picking it up. So let's go back into link filter. Now we can say if event type and we want to know if the type is equal to Q event and we want to know if it's a what's this clicked, meaning that they link inside what's this was clicked. And then we're going to say return true. And if it wasn't, then we're just going to return false. Now as you guessed, we need to perform some type of special voodoo magic in here. So we're going to actually create events. We're going to say Q, what's this clicked event? And we're going to call this WTC event straight out of the book equal and we're going to make a static cast, static cast, not a static case. I want to say Q, what's this event and let's actually go over here because we're not finished yet. I apologize. It's very hard to get the screen real estate and still be able to post these on YouTube because my bandwidth is rather limited at the moment. All right. So let's sign on. It's a big line. So it's Q, what's this clicked event with a pointer called WTC event equals static cast. Q, what's this clicked event pointer? That's actually a type and we're going to use the event. Now what we need to do now that we've created that is actually emit the event. So we're going to say emit and we're going to say, well, I don't know what that was. Link click and we want the WTC event href. So basically what we want to do here is we want to emit link clicked using our Q, what's this clicked event and we want the address or the href reference. And then we're just returning true indicating that something indeed was clicked. Pretty pretty pretty difficult to understand if you're new to this, but really all you need to understand is we're going to be, we haven't done it yet, we're going to be installing an event filter. So every time an event is fired, this class is going to have this function called called event filter. We're going to get a reference to the object or I shouldn't say we're going to get a pointer to the object and a pointer to the event. Then we need to filter and say if the event type is Q, what's this clicked then we're going to get the clicked event out of the event and then we're going to emit the address that was clicked. Let's close that, let's close that. And we are back in dialogue.cpp and as you can see we've just got our what's this. So if you save and run this, nothing's going to happen because we haven't installed the event filter yet. Let's just prove that by running this real quick. So nothing happens but it's good to compile and run just to make sure you didn't have any boo-boos and you're going to want to fix those if you do. Alright, now first thing we need to do is install our event filter. So what we're going to do here is we're going to say, whoops we have to add a reference in here. A little scatter brand today and reference into link filter I should say add and include not a reference and let's just go ahead and include Qt Core while we're at it. Now we can go ahead and we'll say link filter and we'll just create a pointer called filter and we're going to give it this as the parent and we're going to say this install event filter and notice how it takes a Q object. So this is where you're going to hand it off the filter and that effectively installs our filter. Now that the filter is installed we need to set up the signals and slots. So what we're going to do is say connect and the object is filter and the signal we want, we'll say signal, the signal we want for this is the linked clicked event or I should say the linked clicked signal sorry and we want to add a slot here. I don't think we've done that yet have we? No we have not. So let's just say and we want a slot called void show link and we want a const queue string and there's our slot. Flip back in here and where were we oh yes we need to set up our slot here. So we'll say this and we want the slot we just set up. It's not finding it for some reason. What did we do wrong? Oh yes sorry show link not link click silly me it's been a long day show link with our queue string and then we need to implement that and then we can go ahead and just do whatever magic we want to happen when that link is clicked. We'll say queue message box and we'll just do information this and we want a the title to say linked clicked. I apologize for the choppiness of this tutorial I'm kind of following along in the book as I'm doing this because I did not write this tutorial and we want to actually get the link out of here. So what we want to do is just say link whoops and make sure we have our semicolon at the end compile and run and if all goes as planned it's kind of a learning experience for both of us. I read this tutorial and said I really want to do a video on this and I haven't actually done it so this is the first time for me to click what's this there and then when you click your link there is your event filter popping up the message box. Pretty neat just shows you how powerful you can get with Qt. Now notice how if you do this you go here and you don't click the link you just click somewhere else it just disappears that's how you know that filter is really really working. So this is Brian this was our 60th tutorial. I thank you for watching I hope you found this video educational and entertaining and remember this tutorial came out of the Foundations of Qt Development from Johan Felin I'm sorry if I'm mispronouncing your name. Excellent book I have learned a lot from this book I recommend you run to the store not walk run as fast as you can as fast as your little feet will carry you and buy this book it was well worth the cost.


Welcome to Toffy TV. Mi yn Andy are going to talk about Hames Rodríguez. Ola, to all of our Spanish viewers. That's all the Spanish you're getting, I'm afraid. Andy, Hames Rodríguez, an Everton player at the club announced it last night. Obviously, we saw him in Liverpool last week. We saw only the stuff the fanfare that's gone with it reveals on in Lime Street and images in Bogota on buildings and everything else. And it's created quite a bus. Yeah, it's different for everyone, isn't it, I suppose? When we brought Rooney back, that was quite a feel, a good moment. This seems more of a global sort of push. Obviously, the stories about us opening offices in America. I think it's exciting really, as in Everton. I'm glad we did it later in the day because it allowed for the Colombian television to pick up as they wanted to. So, at the end of the day, I think it's going to be a real positive for Evan, off the pitch and hopefully obviously on the pitch as well. He's obviously a world global superstar, isn't he? I think we mentioned that yesterday, but on Twitter alone, he's got more followers than 19 Premier League clubs. I think he's the sixth most part of the eighth and the top eight most popular sport in the world. It's incredible, really. I mean, he wasn't aware he was that big. Obviously, he's a superstar footballer, where he wasn't aware he was that big, but just coming to Everton and seeing the reveal, and seeing even players like Thomas Muller, wishing them well and things like that. I see the funniest reply. Someone's saying, he knows who we are, something like that, which I thought was quite funny. But it shows the impact, doesn't it, of having a player who attracts this much interest all on a global scale? I think that's a quarter of the real value for Hamers to us in the fact that he's such a globally well-renowned superstar. He puts Evan on the front pages of South American newspapers. In America as well, Latin part of America is such a big star, and that's why Evan opened up offices in America. I think it's a win-win on that front. On this pitch, obviously, we hope it's an even more of a win-win, because that's what counts, but it's a big deal for Evan. The big billboard in the city, the other stuff that the Southern Boggots are. It's exciting. I think for editorians as well, it's nice to be, that we've got this. Obviously we want to win trophies and stuff, but it's nice that we've got this recognition for signing a player, and we wouldn't have been able to do that, without Carlo Ancelotti being our manager, also in his own right to star, I guess. Exactly, that's the key thing with this transfer, isn't it? As much as us as editorians, we're the biggest club in the world to us. Without Carlo Ancelotti, a superstar like James Rodriguez wouldn't be coming to Evan. Ffarr hapus here, obviously, back in the deal as well. So, it is exciting times. Let's talk about the actual football. The man himself here. The profile, which is fantastic, and it's everywhere. We look great in the kit, and someone put it at the most perfect set of teeth they've ever seen on football, and everything else we know all that. He's a good looking lad. But actually his footballing ability is, you know, when he's fit, and when he's at the top of his game, he's an incredible footballer, isn't he? Oh, yeah. You know, Everton Avanad, you know, Andrew Kinshawskis, maybe, when he was at his best was probably the last footballer of this level of talent, but we were wrong, Romelu La Carcha, when others were good players, but we're talking about a player at his best when he's at his fit as being amongst the top ten players in the world. You can flip-flop wherever you want in the top ten where he is. You know, just an incredible skill, incredible intelligence, vision. You know, we haven't had... You know, if you can play, obviously, into that level, then, you know, John McArthur, Llewyn, Richard, something I'm going to really benefit from around there. I think, you know, I'm excited from that point, to know, obviously, I raise some concerns about certain things, but at the end of the day, he's here now, so he gets my full support as an Evertonian. And I think I'm excited to see what he does on the pitch, because, you know, as a passer of the ball, never mind Scor's wonderful goals, but as a passer, I love a good passer of the ball, and he can do anything with the ball really, he can shape it however he wants, feeds. So, Gary Llynych. Well, we've got two of them in the books now, I think. Tottenham and another club, we've got the only clubs that've got two in the league. It's good, isn't it? It's so incredible. Obviously, he's come to every bot, most people's attention in that 2014 World Cup, when he won the gold, but they've got the volley. It's the luck, isn't it? The luck where the keeper is on the left foot, in off the underside of the bar, which makes it even better. And he was obviously fantastic at that World Cup, and he got a move to rail on the grid from it, because he done so well. Obviously, that's where Eamon Carlaw anti-lotties pat across. He had a great season with anti-lotties there. He's in goals there, he's in assists. If you did that here, you'd put in 26 goal contributions that I put near the top of the league. That's what we need. I'm not saying we can expect that from him, but that level of output, unbelievable, he'd never even had anyone in the field who could do that last season. No, not at all. On his left foot, I would suggest the best, probably the best left footer player we will have had since Kevin Sheedy without it. Bains is fantastic left foot, but... As I said, on his day, in terms of passing, he's probably just, because De Bruyne has obviously been fit playing the last couple of years, probably just behind De Bruyne in the Premier League, in terms of talent and how to pass the ball, that's how good he is. Absolutely incredible. There is numbers for games, competitive games played there, 138 games, 104 goals, 124 assists, 76 times by Columbia and scored 22 international goals. So, 338 games and contributing to 228 goals. It's more than one and two, isn't it? That's an incredible output, really. It's more assist in goals when he's still scored 100 goals. It's incredible, really. He's coming in, obviously, as he's looked at evidence midfield, it's a problem that we've had last season. We've all identified it. There was no escaping it. Anyone could have identified it. And he's really made, you know, adjustments to that midfield. Obviously, Alan came in at the Leidecorei. He's about to be, you know, unveiled. And obviously, Hamers-Rodrigus. And there's been a lot of chat about Hamers-Rodrigus and where he would play. He's obviously vers a tile he can play. You know, I've got my own ideas where I think he might play. But these are the positions in which he's played the majority of his games, really, in certain positions. So, right wing. So, high up the pitch. 77 appearances. 28 goals and 27 assists, which again, aren't bad numbers at all. So, this is in his first season under Anschlacht, with Real Madrid. In his position, obviously, with Benzema and Ronaldo in the wing. Not bad at all. So, he can play there. It would be best to use him in the 4-3-3 in that situation, you know, our guess, where he would be the third, obviously with Charleston, and we would go to the left and down to Calverton would be centre point of the three. But, yeah, that's a position he can play well. He'll be able to cut and sign, his left foot then, cross shoot, which is obviously where he can score his goals. You could use him in the 4-4-2, I guess, because what, you'd have the same under the side, so then there was a 4-2-2, which we've seen, we haven't really had success with. I guess it depends what car he wants to do and what he's been doing in pre-season, in terms of training and formations. But I think, as a right winger, I think he would offer us an option there. Obviously, he's against his house, so we can play other positions then. Interesting to see whether that's where he goes. Left wing, which some people have talked about with the left wing, we've got 59 appearances, 20 goals and 20 assists when he's played in that position. The impression that he doesn't really fail anywhere he plays, doesn't he really? He looks quite good, doesn't he? So, no, with left wing, I think in a 4-4-2 is the left side in the ffielder. I think Carlo's system, the left side in the ffielder, shows it comes inside as you turn. That's where he'd be thriving, that would be his position, of course. And that would be great, because he could then, and then he'd... The problem is, we probably haven't got the right winger yet, we'll see what happens later in the window, but we probably need the right winger, and then we'll see what happens versus how it allows us to change our system. Yeah, definitely. From there we go to a deeper position in the left midfielder, where he's been used four times, no goals, no assists there, so Carlo swayed that position. We've got here, when he's playing in a more central role, 30 appearances, 7 goals, 17 assists. So, this is the position you play for Bayern Munich, for Carlo, it was an 8 and a 3, so the 3 would be either Alan... And this is the position I think you would like to see. Yes, I would really like to see. I like a 4-3-3 with 8. Simsal Coutinho used to play for Liverpool in the 3. You have him driving from the field, creating things and pulling teams apart, which we didn't have this season. We haven't really had the creates, and this is where I'd like to see him play. I think it saves his leg somewhat as well from not playing on the wing. You can then drift in between the lines, and obviously now having to call right now, and we've got people who can actually pass forward too, and find them their positions, which is key. So, I'd like to see that. Again, we probably need the right side, the right winger. So, we can't really play on the right side. You can Bernard, you look at your walk-up then. So, a right winger would be key to that. But again, this is the position I want him to play because I think overall, this is where it's suiting best for everyone. You've got Alan to Corey, and hopefully when Gabamon Gomes can play in that position as well. When Gabamon gets back, you've got a proper 6 behind them. You can allow them to play then. That's a lot of versatility. This is just my preference because I think he caused the most damage in this position. In that position, with that left foot. He's also played up front as a striker in one game. Didn't have a rarity for him, never scored a goal. He plays a false man. And then obviously this position is the number 10 role, which again, I've seen people talking about whether Evan would play a 4-3-1-2 and have him in the 10. I think he'd go 4-2-3-1. I know people don't love that formation, but you know, Guilffy Sigarton, Hamers Rodriguez, you've got a player who's much more creative and open-played when you're on Guilffy. Then again though, for me personally, then we need the right winger, don't we? It will be all Bernardo Gordon who can play the left side role because Bernardo played left in the 4-2-3-1 for Schalke. It will be left on the 4-2-3-1 for Arsenal. And I think Gordon will be fine when they're cut in Simon's right foot. But having them as the number 10, like the Calamay style playmaker, I think that's another position. So there you go. There's three systems, Evan Gray, 4-3-3, 4-4-2. The diamond, as you said, 4-1-2-1. You know, there's options, 4-3-1-2. There's options, there's four systems there that Carlo can play, which means depending on the opponent and depending on what weaknesses they discover in that team, it gives us the option to play it. Now you've got your fielders, you've got different things. You've got Takori, who obviously can get forward in the box, so he's active off the ball. Allen, who can either destroy it or he can sit as well, or he can play a box-to-box player. You've got a barman who can play as a six or a box-to-box player.  Because you can then do that, you can have Takori bombing on into the box as the eight. When you can have Gomez as more, he takes it off, Allen wins the ball back, he gives it to Gomez, Gomez links it around the pitch. It gives us a plethora, a plethora of options, that's what he wants. I think it adds face to the squad. Do me wrong, I think Carlo will enjoy playing the 4-4-2, he still wants to play the 4-4-2, but I think we'd be better with a three in the field for me. It's options, isn't it? Hamers has played 119 games at that number ten, 31 goals, 37 assists. Just from looking at it, his numbers are absolutely incredible, Andy, and that's quite clearly what whatever they'll be looking to do anyway with them is to create that versatility, to be able to change through systems. He's a fantastic footballer. It'll be key to keep him fit. I think he's the type of... He's a difference maker. I don't think you can have too many difference makers, but he's also a left footer as well. That's fantastic.  He's seen what that goal and the well cut way, he just knew where the goalkeeper was. The sweetest folly you'll see. Things like that, it's not a corner or a weakness. He's not super fast over five yards. What he is, though, is he's clever. He doesn't use his dribble and to beat like multiple people. He uses his crease angles and half a yard to create a score. That's why I think we still need the right winger because we still lack a tiny bit of penetration pace on that right-hand side, but hey, biggest can't be choosers, I guess. It's going to be very interesting to see where he plays. There's no denying it, his numbers have proved there. He's an absolutely fantastic footballer and it's key for Evan. I think you've got to manage your nose as I'm using them. That's the thing, isn't it? He's trust the manager. The manager is trusting him and hopefully, hopefully, Everton and Columbia will benefit from him playing regularly and staying fit and he can have a fantastic impact on and Everton said that, let's be honest, last season was the void of creativity of time, so a huge upgrade. I'm really, really excited to see him playing for Evan. I can't wait to see him and see him getting on the ball with that left foot and scoring and creating goals for us. It's going to be exciting, that's for sure, isn't it? It brings excitement to the fan base. As I said last season, we need someone who's going to get us off our seats. Is the player who's going to get the fans off the seats again in the Gladys Street? Let's get back in the Gladys Street. Let us know what you think about where James Rodriguez fit in at Evan and what position would you like to see him. You've seen all the numbers there, the majority of them proves that he can play anywhere. You think James Rodriguez will be best suited. Any Colombian watchers, we've had loads of Colombian viewers over there. Where in your opinion is James best suited for Evan? Where can Evan get the most out of him? Big thanks to him. Make sure you subscribe, give the video a thumbs up and if you want more videos, join us over on Patreon. See you later.