Reader small image

You're reading from  Qt 5 and OpenCV 4 Computer Vision Projects

Product typeBook
Published inJun 2019
Reading LevelIntermediate
PublisherPackt
ISBN-139781789532586
Edition1st Edition
Languages
Right arrow
Author (1)
Zhuo Qingliang
Zhuo Qingliang
author image
Zhuo Qingliang

Zhuo Qingliang (a.k.a. KDr2 online) is presently working at Beijing Paoding Technology Co. LTD., a start-up Fintech company in China that is dedicated to improving the financial industry by using artificial intelligence technologies. He has over 10 years experience in Linux, C, C++, Python, Perl, and Java development. He is interested in programming, doing consulting work, participating in and contributing to the open source community (of course, includes the Julia community).
Read more about Zhuo Qingliang

Right arrow

Chapter 1, Building an Image Viewer

  1. We use a message box to tell users that they are already viewing the first or last image as they attempt to view the image prior to the first image, or the image following the last image. However, there is another way to handle this: disable prevAction when users are viewing the first image, and disable nextAction when users are viewing the last image. How do we go about this?

The QAction class has a bool enabled property and, hence, a setEnabled(bool) method, and we call it to enable or disable the corresponding action in the prevImage and nextImage methods.

  1. There is only text on our menu items or tool buttons. How can we add an icon image to them?

The QAction class has a QIcon icon property and, hence, a setIcon method, and you can create and set an icon for the action. To create a QIcon object, please refer to its corresponding documentation...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Qt 5 and OpenCV 4 Computer Vision Projects
Published in: Jun 2019Publisher: PacktISBN-13: 9781789532586

Author (1)

author image
Zhuo Qingliang

Zhuo Qingliang (a.k.a. KDr2 online) is presently working at Beijing Paoding Technology Co. LTD., a start-up Fintech company in China that is dedicated to improving the financial industry by using artificial intelligence technologies. He has over 10 years experience in Linux, C, C++, Python, Perl, and Java development. He is interested in programming, doing consulting work, participating in and contributing to the open source community (of course, includes the Julia community).
Read more about Zhuo Qingliang