Qt 4.8
Public Functions | Static Public Functions | Properties | List of all members
QWindowsVistaStylePrivate Class Reference

#include <qwindowsvistastyle_p.h>

Inheritance diagram for QWindowsVistaStylePrivate:
QWindowsXPStylePrivate QWindowsStylePrivate QCommonStylePrivate QStylePrivate QObjectPrivate QObjectData

Public Functions

 QWindowsVistaStylePrivate ()
 
void startAnimation (QWindowsVistaAnimation *)
 
void stopAnimation (const QWidget *)
 
void timerEvent ()
 
bool transitionsEnabled () const
 
QWidgettreeViewHelper ()
 
QWindowsVistaAnimationwidgetAnimation (const QWidget *) const
 
 ~QWindowsVistaStylePrivate ()
 
- Public Functions inherited from QWindowsXPStylePrivate
HBITMAP buffer (int w=0, int h=0)
 Returns a native buffer (DIB section) of at least the size of ( x , y ). More...
 
HDC bufferHDC ()
 
void cleanup (bool force=false)
 
void cleanupHandleMap ()
 
void drawBackground (XPThemeData &themeData)
 Main theme drawing function. More...
 
void drawBackgroundDirectly (XPThemeData &themeData)
 This function draws the theme parts directly to the paintengines HDC. More...
 
void drawBackgroundThruNativeBuffer (XPThemeData &themeData)
 This function uses a secondary Native doublebuffer for painting parts. More...
 
bool fixAlphaChannel (const QRect &rect)
 When the theme engine paints both a true alpha pixmap and a glyph into our buffer, the glyph might not contain a proper alpha value. More...
 
bool hasAlphaChannel (const QRect &rect)
 Returns true if the native doublebuffer contains pixels with varying alpha value. More...
 
bool hasAnyData (const QRect &rect)
 Returns true if the native doublebuffer contains a pixel which has a non-0xFF alpha value. More...
 
void init (bool force=false)
 
bool isTransparent (XPThemeData &themeData)
 Returns true if the part contains any transparency at all. More...
 
 QWindowsXPStylePrivate ()
 
QRegion region (XPThemeData &themeData)
 
void setTransparency (QWidget *widget, XPThemeData &themeData)
 Sets the parts region on a window. More...
 
bool swapAlphaChannel (const QRect &rect, bool allPixels=false)
 Swaps the alpha values on certain pixels: 0xFF?????? -> 0x00?????? 0x00?????? -> 0xFF?????? Used to determin the mask of a non-alpha transparent pixmap in the native doublebuffer, and swap the alphas so we may paint the image as a Premultiplied QImage with drawImage(), and obtain the mask transparency. More...
 
const QPixmaptabBody (QWidget *widget)
 Returns the pointer to a tab widgets body pixmap, scaled to the height of the screen. More...
 
 ~QWindowsXPStylePrivate ()
 
- Public Functions inherited from QWindowsStylePrivate
bool altDown () const
 
bool hasSeenAlt (const QWidget *widget) const
 
 QWindowsStylePrivate ()
 
void startAnimation (QObject *o, QProgressBar *bar)
 
void stopAnimation (QObject *o, QProgressBar *bar)
 
- Public Functions inherited from QCommonStylePrivate
bool isViewItemCached (const QStyleOptionViewItemV4 &option) const
 
 QCommonStylePrivate ()
 
void tabLayout (const QStyleOptionTabV3 *opt, const QWidget *widget, QRect *textRect, QRect *pixmapRect) const
 
void viewItemDrawText (QPainter *p, const QStyleOptionViewItemV4 *option, const QRect &rect) const
 
void viewItemLayout (const QStyleOptionViewItemV4 *opt, QRect *checkRect, QRect *pixmapRect, QRect *textRect, bool sizehint) const
 Set sizehint to false to layout the elements inside opt->rect. More...
 
QSize viewItemSize (const QStyleOptionViewItemV4 *option, int role) const
 
 ~QCommonStylePrivate ()
 
- Public Functions inherited from QStylePrivate
 QStylePrivate ()
 
- Public Functions inherited from QObjectPrivate
void _q_reregisterTimers (void *pointer)
 
void addConnection (int signal, Connection *c)
 
void cleanConnectionLists ()
 
void connectNotify (const char *signal)
 
void deleteChildren ()
 
void disconnectNotify (const char *signal)
 
bool isSender (const QObject *receiver, const char *signal) const
 
bool isSignalConnected (uint signalIdx) const
 Returns true if the signal with index signal_index from object sender is connected. More...
 
void moveToThread_helper ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
QObjectList receiverList (const char *signal) const
 
QObjectList senderList () const
 
void setParent_helper (QObject *)
 
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData)
 
int signalIndex (const char *signalName) const
 Returns the signal index used in the internal connectionLists vector. More...
 
virtual ~QObjectPrivate ()
 
- Public Functions inherited from QObjectData
virtual ~QObjectData ()=0
 

Static Public Functions

static bool resolveSymbols ()
 Returns true if all the necessary theme engine symbols were resolved. More...
 
static bool useVista ()
 
- Static Public Functions inherited from QWindowsXPStylePrivate
static bool isItemViewDelegateLineEdit (const QWidget *widget)
 
static bool resolveSymbols ()
 Returns true if all the necessary theme engine symbols were resolved. More...
 
static bool useXP (bool update=false)
 
static HWND winId (const QWidget *widget)
 This function will always return a valid window handle, and might create a limbo widget to do so. More...
 
- Static Public Functions inherited from QObjectPrivate
static void clearGuards (QObject *)
 
static QObjectPrivateget (QObject *o)
 
static void resetCurrentSender (QObject *receiver, Sender *currentSender, Sender *previousSender)
 
static SendersetCurrentSender (QObject *receiver, Sender *sender)
 
static void signalSignature (const QMetaMethod &signal, QVarLengthArray< char > *result)
 

Properties

QList< QWindowsVistaAnimation * > animations
 
QBasicTimer animationTimer
 
QWidgetm_treeViewHelper
 

Additional Inherited Members

- Public Types inherited from QWindowsStylePrivate
enum  {
  windowsItemFrame = 2, windowsSepHeight = 9, windowsItemHMargin = 3, windowsItemVMargin = 2,
  windowsArrowHMargin = 6, windowsRightBorder = 15, windowsCheckMarkWidth = 12
}
 
- Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
 
- Public Variables inherited from QWindowsXPStylePrivate
QIcon dockClose
 
QIcon dockFloat
 
QRgb groupBoxTextColor
 
QRgb groupBoxTextColorDisabled
 
bool hasInitColors
 
QRgb sliderTickColor
 
- Public Variables inherited from QWindowsStylePrivate
QColor activeCaptionColor
 
QColor activeGradientCaptionColor
 
bool alt_down
 
QList< QProgressBar * > animatedProgressBars
 
int animateStep
 
int animateTimer
 
int animationFps
 
QColor inactiveCaptionColor
 
QColor inactiveCaptionText
 
QColor inactiveGradientCaptionColor
 
int menuBarTimer
 
QList< const QWidget * > seenAlt
 
QElapsedTimer startTime
 
- Public Variables inherited from QCommonStylePrivate
QStyleOptionViewItemV4cachedOption
 
QRect checkRect
 
QRect decorationRect
 
QRect displayRect
 
QIcon tabBarcloseButtonIcon
 
- Public Variables inherited from QStylePrivate
int layoutSpacingIndex
 
QStyleproxyStyle
 
- Public Variables inherited from QObjectPrivate
union {
   QObject *   currentChildBeingDeleted
 
   QAbstractDeclarativeData *   declarativeData
 
}; 
 
quint32 connectedSignals [2]
 
QObjectConnectionListVectorconnectionLists
 
SendercurrentSender
 
QList< QPointer< QObject > > eventFilters
 
ExtraDataextraData
 
QString objectName
 
Connectionsenders
 
QAtomicPointer< QtSharedPointer::ExternalRefCountData > sharedRefcount
 
QThreadDatathreadData
 
void * unused
 
- Public Variables inherited from QObjectData
uint blockSig: 1
 
QObjectList children
 
uint hasGuards: 1
 
uint inEventHandler: 1
 
uint inThreadChangeEvent: 1
 
uint isWidget: 1
 
QMetaObjectmetaObject
 
uint ownObjectName: 1
 
QObjectparent
 
uint pendTimer: 1
 
int postedEvents
 
QObjectq_ptr
 
uint receiveChildEvents: 1
 
uint sendChildEvents: 1
 
uint unused: 22
 
uint wasDeleted: 1
 
- Static Public Variables inherited from QWindowsXPStylePrivate
static QMap< QString, HTHEME > * handleMap = 0
 

Detailed Description

Definition at line 194 of file qwindowsvistastyle_p.h.

Constructors and Destructors

◆ QWindowsVistaStylePrivate()

QWindowsVistaStylePrivate::QWindowsVistaStylePrivate ( )

Definition at line 2499 of file qwindowsvistastyle.cpp.

2499  :
2501 {
2502  resolveSymbols();
2503 }
static bool resolveSymbols()
Returns true if all the necessary theme engine symbols were resolved.

◆ ~QWindowsVistaStylePrivate()

QWindowsVistaStylePrivate::~QWindowsVistaStylePrivate ( )

Definition at line 2505 of file qwindowsvistastyle.cpp.

2506 {
2508  delete m_treeViewHelper;
2509 }
QList< QWindowsVistaAnimation * > animations
Q_OUTOFLINE_TEMPLATE void qDeleteAll(ForwardIterator begin, ForwardIterator end)
Definition: qalgorithms.h:319

Functions

◆ resolveSymbols()

bool QWindowsVistaStylePrivate::resolveSymbols ( )
static

Returns true if all the necessary theme engine symbols were resolved.

Warning
This function is not part of the public interface.

Definition at line 2585 of file qwindowsvistastyle.cpp.

Referenced by QWindowsVistaStylePrivate().

2586 {
2587  static bool tried = false;
2588  if (!tried) {
2589  QSystemLibrary themeLib(QLatin1String("uxtheme"));
2590  pSetWindowTheme = (PtrSetWindowTheme )themeLib.resolve("SetWindowTheme");
2591  pIsThemePartDefined = (PtrIsThemePartDefined )themeLib.resolve("IsThemePartDefined");
2592  pGetThemePartSize = (PtrGetThemePartSize )themeLib.resolve("GetThemePartSize");
2593  pOpenThemeData = (PtrOpenThemeData )themeLib.resolve("OpenThemeData");
2594  pCloseThemeData = (PtrCloseThemeData )themeLib.resolve("CloseThemeData");
2595  pDrawThemeBackground = (PtrDrawThemeBackground )themeLib.resolve("DrawThemeBackground");
2596  pDrawThemeBackgroundEx = (PtrDrawThemeBackgroundEx )themeLib.resolve("DrawThemeBackgroundEx");
2597  pGetCurrentThemeName = (PtrGetCurrentThemeName )themeLib.resolve("GetCurrentThemeName");
2598  pGetThemeBool = (PtrGetThemeBool )themeLib.resolve("GetThemeBool");
2599  pGetThemeColor = (PtrGetThemeColor )themeLib.resolve("GetThemeColor");
2600  pGetThemeEnumValue = (PtrGetThemeEnumValue )themeLib.resolve("GetThemeEnumValue");
2601  pGetThemeFilename = (PtrGetThemeFilename )themeLib.resolve("GetThemeFilename");
2602  pGetThemeFont = (PtrGetThemeFont )themeLib.resolve("GetThemeFont");
2603  pGetThemeInt = (PtrGetThemeInt )themeLib.resolve("GetThemeInt");
2604  pGetThemeIntList = (PtrGetThemeIntList )themeLib.resolve("GetThemeIntList");
2605  pGetThemeMargins = (PtrGetThemeMargins )themeLib.resolve("GetThemeMargins");
2606  pGetThemeMetric = (PtrGetThemeMetric )themeLib.resolve("GetThemeMetric");
2607  pGetThemePartSize = (PtrGetThemePartSize )themeLib.resolve("GetThemePartSize");
2608  pGetThemePosition = (PtrGetThemePosition )themeLib.resolve("GetThemePosition");
2609  pGetThemeRect = (PtrGetThemeRect )themeLib.resolve("GetThemeRect");
2610  pGetThemeString = (PtrGetThemeString )themeLib.resolve("GetThemeString");
2611  pGetThemeTransitionDuration = (PtrGetThemeTransitionDuration)themeLib.resolve("GetThemeTransitionDuration");
2612  pGetThemePropertyOrigin = (PtrGetThemePropertyOrigin)themeLib.resolve("GetThemePropertyOrigin");
2613  tried = true;
2614  }
2615  return pGetThemeTransitionDuration != 0;
2616 }
static PtrGetThemeBool pGetThemeBool
static PtrGetThemeTransitionDuration pGetThemeTransitionDuration
static PtrGetThemeFilename pGetThemeFilename
HRESULT(WINAPI * PtrDrawThemeBackground)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, OPTIONAL const RECT *pClipRect)
HRESULT(WINAPI * PtrGetThemeColor)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, OUT COLORREF *pColor)
HRESULT(WINAPI * PtrCloseThemeData)(HTHEME hTheme)
static PtrGetThemeRect pGetThemeRect
HRESULT(WINAPI * PtrSetWindowTheme)(HWND hwnd, LPCWSTR pszSubAppName, LPCWSTR pszSubIdList)
static PtrGetThemeInt pGetThemeInt
HTHEME(WINAPI * PtrOpenThemeData)(HWND hwnd, LPCWSTR pszClassList)
HRESULT(WINAPI * PtrDrawThemeBackgroundEx)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, OPTIONAL const DTBGOPTS *pOptions)
static PtrOpenThemeData pOpenThemeData
static PtrDrawThemeBackground pDrawThemeBackground
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
static PtrIsThemePartDefined pIsThemePartDefined
static PtrGetCurrentThemeName pGetCurrentThemeName
HRESULT(WINAPI * PtrGetThemeBool)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, OUT BOOL *pfVal)
HRESULT(WINAPI * PtrGetThemeFilename)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, OUT LPWSTR pszThemeFileName, int cchMaxBuffChars)
HRESULT(WINAPI * PtrIsThemePartDefined)(HTHEME hTheme, int iPartId, int iStateId)
static PtrDrawThemeBackgroundEx pDrawThemeBackgroundEx
HRESULT(WINAPI * PtrGetThemePosition)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, OUT POINT *pPoint)
HRESULT(WINAPI * PtrGetThemeString)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, OUT LPWSTR pszBuff, int cchMaxBuffChars)
HRESULT(WINAPI * PtrGetThemeMargins)(HTHEME hTheme, OPTIONAL HDC hdc, int iPartId, int iStateId, int iPropId, OPTIONAL RECT *prc, OUT MARGINS *pMargins)
HRESULT(WINAPI * PtrGetCurrentThemeName)(OUT LPWSTR pszThemeFileName, int cchMaxNameChars, OUT OPTIONAL LPWSTR pszColorBuff, int cchMaxColorChars, OUT OPTIONAL LPWSTR pszSizeBuff, int cchMaxSizeChars)
HRESULT(WINAPI * PtrGetThemePropertyOrigin)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, OUT enum PROPERTYORIGIN *pOrigin)
HRESULT(WINAPI * PtrGetThemeTransitionDuration)(HTHEME hTheme, int iPartId, int iStateFromId, int iStateToId, int iPropId, int *pDuration)
static PtrGetThemeFont pGetThemeFont
HRESULT(WINAPI * PtrGetThemeIntList)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, OUT INTLIST *pIntList)
static PtrGetThemeString pGetThemeString
static PtrGetThemeEnumValue pGetThemeEnumValue
static PtrGetThemeColor pGetThemeColor
static PtrCloseThemeData pCloseThemeData
static PtrGetThemePropertyOrigin pGetThemePropertyOrigin
HRESULT(WINAPI * PtrGetThemeInt)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, OUT int *piVal)
HRESULT(WINAPI * PtrGetThemeEnumValue)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, OUT int *piVal)
static PtrSetWindowTheme pSetWindowTheme
static PtrGetThemeMetric pGetThemeMetric
HRESULT(WINAPI * PtrGetThemePartSize)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, OPTIONAL RECT *prc, enum THEMESIZE eSize, OUT SIZE *psz)
HRESULT(WINAPI * PtrGetThemeMetric)(HTHEME hTheme, OPTIONAL HDC hdc, int iPartId, int iStateId, int iPropId, OUT int *piVal)
static PtrGetThemeMargins pGetThemeMargins
HRESULT(WINAPI * PtrGetThemeRect)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, OUT RECT *pRect)
static PtrGetThemePartSize pGetThemePartSize
static PtrGetThemeIntList pGetThemeIntList
HRESULT(WINAPI * PtrGetThemeFont)(HTHEME hTheme, OPTIONAL HDC hdc, int iPartId, int iStateId, int iPropId, OUT LOGFONT *pFont)
static PtrGetThemePosition pGetThemePosition

◆ startAnimation()

void QWindowsVistaStylePrivate::startAnimation ( QWindowsVistaAnimation t)

Definition at line 2544 of file qwindowsvistastyle.cpp.

Referenced by QWindowsVistaStyle::drawComplexControl(), QWindowsVistaStyle::drawControl(), and QWindowsVistaStyle::drawPrimitive().

2545 {
2547  stopAnimation(t->widget());
2548  animations.append(t);
2549  if (animations.size() > 0 && !animationTimer.isActive()) {
2550  animationTimer.start(45, q);
2551  }
2552 }
The QWindowsVistaStyle class provides a look and feel suitable for applications on Microsoft Windows ...
bool isActive() const
Returns true if the timer is running and has not been stopped; otherwise returns false.
Definition: qbasictimer.h:62
void stopAnimation(const QWidget *)
#define Q_Q(Class)
Definition: qglobal.h:2483
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QList< QWindowsVistaAnimation * > animations
void start(int msec, QObject *obj)
Starts (or restarts) the timer with a msec milliseconds timeout.

◆ stopAnimation()

void QWindowsVistaStylePrivate::stopAnimation ( const QWidget w)

Definition at line 2533 of file qwindowsvistastyle.cpp.

Referenced by QWindowsVistaStyle::drawComplexControl(), QWindowsVistaStyle::drawControl(), QWindowsVistaStyle::drawPrimitive(), startAnimation(), and QWindowsVistaStyle::unpolish().

2534 {
2535  for (int i = animations.size() - 1 ; i >= 0 ; --i) {
2536  if (animations[i]->widget() == w) {
2538  delete a;
2539  break;
2540  }
2541  }
2542 }
QPointer< QWidget > widget
long ASN1_INTEGER_get ASN1_INTEGER * a
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
T takeAt(int i)
Removes the item at index position i and returns it.
Definition: qlist.h:484
QList< QWindowsVistaAnimation * > animations

◆ timerEvent()

void QWindowsVistaStylePrivate::timerEvent ( )

Definition at line 2511 of file qwindowsvistastyle.cpp.

2512 {
2513  for (int i = animations.size() - 1 ; i >= 0 ; --i) {
2514 
2515  if (animations[i]->widget())
2516  animations[i]->widget()->update();
2517 
2518  if (!animations[i]->widget() ||
2519  !animations[i]->widget()->isVisible() ||
2520  animations[i]->widget()->window()->isMinimized() ||
2521  !animations[i]->running() ||
2523  {
2525  delete a;
2526  }
2527  }
2528  if (animations.size() == 0 && animationTimer.isActive()) {
2529  animationTimer.stop();
2530  }
2531 }
QPointer< QWidget > widget
bool isActive() const
Returns true if the timer is running and has not been stopped; otherwise returns false.
Definition: qbasictimer.h:62
long ASN1_INTEGER_get ASN1_INTEGER * a
void update()
Updates the widget unless updates are disabled or the widget is hidden.
Definition: qwidget.cpp:10883
NSWindow * window
void stop()
Stops the timer.
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
T takeAt(int i)
Removes the item at index position i and returns it.
Definition: qlist.h:484
QList< QWindowsVistaAnimation * > animations

◆ transitionsEnabled()

bool QWindowsVistaStylePrivate::transitionsEnabled ( ) const

Definition at line 2554 of file qwindowsvistastyle.cpp.

Referenced by QWindowsVistaStyle::drawComplexControl(), QWindowsVistaStyle::drawControl(), and QWindowsVistaStyle::drawPrimitive().

2555 {
2556  BOOL animEnabled = false;
2557  if (SystemParametersInfo(SPI_GETCLIENTAREAANIMATION, 0, &animEnabled, 0))
2558  {
2559  if (animEnabled)
2560  return true;
2561  }
2562  return false;
2563 }
#define SPI_GETCLIENTAREAANIMATION

◆ treeViewHelper()

QWidget * QWindowsVistaStylePrivate::treeViewHelper ( )

Definition at line 2622 of file qwindowsvistastyle.cpp.

Referenced by QWindowsVistaStyle::drawPrimitive().

2623 {
2624  if (!m_treeViewHelper) {
2625  m_treeViewHelper = new QWidget(0);
2626  pSetWindowTheme(m_treeViewHelper->winId(), L"explorer", NULL);
2627  }
2628  return m_treeViewHelper;
2629 }
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
static PtrSetWindowTheme pSetWindowTheme
WId winId() const
Returns the window system identifier of the widget.
Definition: qwidget.cpp:2557

◆ useVista()

bool QWindowsVistaStylePrivate::useVista ( )
inlinestatic

◆ widgetAnimation()

QWindowsVistaAnimation * QWindowsVistaStylePrivate::widgetAnimation ( const QWidget widget) const

Definition at line 2566 of file qwindowsvistastyle.cpp.

Referenced by QWindowsVistaStyle::drawComplexControl(), QWindowsVistaStyle::drawControl(), and QWindowsVistaStyle::drawPrimitive().

2567 {
2568  if (!widget)
2569  return 0;
2570  foreach (QWindowsVistaAnimation *a, animations) {
2571  if (a->widget() == widget)
2572  return a;
2573  }
2574  return 0;
2575 }
QPointer< QWidget > widget
long ASN1_INTEGER_get ASN1_INTEGER * a
QList< QWindowsVistaAnimation * > animations

Properties

◆ animations

QList<QWindowsVistaAnimation*> QWindowsVistaStylePrivate::animations
private

◆ animationTimer

QBasicTimer QWindowsVistaStylePrivate::animationTimer
private

Definition at line 212 of file qwindowsvistastyle_p.h.

Referenced by startAnimation(), and timerEvent().

◆ m_treeViewHelper

QWidget* QWindowsVistaStylePrivate::m_treeViewHelper
private

Definition at line 213 of file qwindowsvistastyle_p.h.

Referenced by treeViewHelper(), and ~QWindowsVistaStylePrivate().


The documentation for this class was generated from the following files: