Stick it to THE MAN
Stick it to THE MAN

Reputation: 5701

QT (4) equivalent macros/methods/constants for their Win32 API counterparts?

I am converting some GUI code I originally wrote using the win32 API, to use QT.

I have come accross some items for which I cant find any direct equivalents. They are:

  1. GetRValue
  2. GetGValue
  3. GetBValue
  4. PS_SOLID PS_DASH
  5. PS_DOT
  6. PS_DASH_DOT
  7. PS_NULL
  8. MulDiv
  9. HBITMAP

Any help?

[Edit]

I am building on Ubuntu 9.10

Upvotes: 2

Views: 367

Answers (2)

Viesturs
Viesturs

Reputation: 1691

If you are not very concerned about performance, implement MulDiv using 64 bit integers:

 long MulDiv(long v1, long v2, long v3)
 {
     return (long)(((long long)v1*(long long)v2) / v3);
 }

Upvotes: 1

Nikola Smiljanić
Nikola Smiljanić

Reputation: 26873

QColor class has methods red(), green(), blue().

BrushStyle enum defines different brush patterns.

You can code MulDiv yourself, it just "multiplies two 32-bit values and then divides the 64-bit result by a third 32-bit value"

QBitmap is Qt bitmap class.

Upvotes: 2

Related Questions