Table Of Contents

Previous topic

7.9. Estimating the mask of a polygon shape with Qt tools

Next topic

7.11. Deleting already displayed shapes

Download

7.10. Editing the color of shapes

Very few instructions because very few things to actually do!

  • As for when you added the ellipse, circle, ... buttons in the DrawQt interface, add a new button which will act as a color selector. An icon is available in the directory data/icons: Colors.bmp

  • Connect this button to the action:

    void Visu2D::SelectColor();
    

    which you’ll implement so as to display a color selector and retrieve the chosen value.

    Note

    To display a color selector, use the QColordialog class. If your SelectColor() is bigger than 3 lines then you probably are heeding toward the wrong direction...

  • Now, it’s up to you to make sure the shapes’ selection is painted with the right color.

../_images/validate-step1.jpg

Validate this step