Qt Tutorials For Beginners – QColorDialog Example

QT Color Dialog Demo

In this lesson we will learn how to use QColorDialog in qt.

The QColorDialog class provides a dialog widget for specifying colors.

File->New File or Project…

Applications->Qt Gui Application->Choose…

We keep the class as MainWindow as given by default.

Now write the code shown below in main.cpp


Now run the code and see the output.

QColorDialog Output
QColorDialog Output


On terminal you will see the chosen color code