(The vec4 can hold "rgba" values if that's what you put in it - the example there just calls it "xyzw" because the data type generically handles any 4 floats.)
Basically, start from an example that draws an image with a simple glsl shader as a texture. Then hack on the shader until it flips around the colors like you want when it draws the texture. Then use your code that gets the image over the network to upload the image as the OpenGL texture every frame.
@VRonin Depends on what he wants to achieve.
Is it a widget, than I agree with you.
Is it some CAD-drawing (looks like a diagram symbol to me), then I would prefer drawing.
For the latter the Graphics View Framework would be more practical though.
Rather than going up-front with building your own GUI for a painting program, I'd recommend taking a look at what is currently existing like Krita or KolourPaint. Painting is a vast subject that can cover many aspects. Just take a look at Qt's examples on the subject.
You should also take the time to look at QtQuick for the GUI design part.
Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.