Из-за периодической блокировки нашего сайта РКН сервисами, просим воспользоваться резервным адресом:
Загрузить через ClipSaver.ruУ нас вы можете посмотреть бесплатно Understanding QFontMetrics::bounding rect или скачать в максимальном доступном качестве, которое было загружено на ютуб. Для скачивания выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса savevideohd.ru
Sometimes the simple questions come with a super complex answer. Question: How do you draw a rectangle around a piece of text? Answer: Uh ohh, hold my beer (or coffee or ...) ..... QFontMetrics::width() doesn't exists anymore, instead it suggest to call QFontMetrics:::horizontalAdvance. That, however, returns a too tight box. Then there is QFontMetrics::boundingRect, but at first sight that just return something really weird. Then there is QPainter::boundingRect, but just like horizontalAdvance, that is too tight too... But in the end Jesper, untangles it all and succeeds! Chapters 0:00 Intro 0:30 What triggered this episode 01:22 QFontMetrics::width is depreciated 02:24 QFontMetrics::horizontalAdvance draws outside the box 3:22 documentation for horitontalAdvance 6:36 QFontMetrics::boundingRect 9:58 OK, lets try and translate the boundingRect to (0,0) 10:47 Let's try and translate by (leftBerring, accent) 12:50 QPainter::boundingRect 14:25 Lets just try and add some space... 17:00 QFontMetrics::tightBoundingRect 17:36 Finally, I think I understood it! 22:45 Let me know your thoughts on this. The example code showcased in this video is available here: https://github.com/KDABLabs/kdabtv/tr... Link to Episode 41 - Module 6 - Introduction to Qt Widgets series: • Introduction to Qt Widgets (Part 41) ... The video is presented by Jesper Pedersen, who started with Qt back when Qt was widgets only and the version was 1.44, which gives him 21 years of experience with Qt. Since 2000 he has taught almost 100 Qt classes, ranging from Qt Widgets to QML. Heck, Jesper even taught a few classes on QTopia Core — Trolltech's initial attempt at creating a phone stack. Today Jesper holds a fancy business title, but that doesn't prevent him from coding both in his job and in his spare time. Every month our newsletter is featuring technical blogs on Qt, C++ and 3D topics: https://www.kdab.com/development-reso... About KDAB: KDAB offers experienced software experts to help you deliver functional, high-performing and innovative software across embedded, mobile and desktop platforms for projects using C++, Qt, QML/Qt Quick, OpenGL, Qt 3D and more. https://www.kdab.com/software-services KDAB experts regularly take time out to deliver KDAB’s world class training, in-house or at open enrolment courses around the world. We are the market leaders for training in Qt, OpenGL and C++. Contact us to find out more at [email protected] or visit our website: https://www.kdab.com/software-service... We are over 100 people, located all around the world. Our Head Office is in Sweden and we have other offices in Germany, France, the UK and the USA. https://www.kdab.com/about/contact/