O'Reilly logo

OpenCV By Example by Vinícius Godoy, David Millán Escrivá, Prateek Joshi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding buttons to a user interface

In the previous chapter, we learned how to create normal or QT interfaces and interact with them with a mouse and slider, but we can create different types of buttons as well.

Note

Buttons are only supported in QT Windows.

The types of buttons supported are as follows:

  • The push button
  • The checkbox
  • The radiobox

The buttons only appear in the control panel. The control panel is an independent window per program, where we can attach buttons and track bars.

To show the control panel, we can push the last toolbar button, right-click on any part of the QT window, and select the Display properties window or the Ctrl + P shortcut.

Let's see how to create a basic sample with buttons. The code is large, and we will first explain ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required