Qt 4.8
Public Types | Public Functions | Static Public Functions | Private Types | Private Functions | Static Private Functions | Properties | Static Private Attributes | List of all members
QVistaHelper Class Reference

#include <qwizard_win_p.h>

Inheritance diagram for QVistaHelper:
QObject

Public Types

enum  TitleBarChangeType { NormalTitleBar, ExtendedTitleBar }
 
enum  VistaState { VistaAero, VistaBasic, Classic, Dirty }
 

Public Functions

QVistaBackButtonbackButton () const
 
QColor basicWindowFrameColor ()
 
void disconnectBackButton ()
 
bool handleWinEvent (MSG *message, long *result)
 
void hideBackButton ()
 
void mouseEvent (QEvent *event)
 
void paintEvent (QPaintEvent *event)
 
 QVistaHelper (QWizard *wizard)
 
void resizeEvent (QResizeEvent *event)
 
bool setDWMTitleBar (TitleBarChangeType type)
 
void setTitleBarIconAndCaptionVisible (bool visible)
 
void setWindowPosHack ()
 
 ~QVistaHelper ()
 
- Public Functions inherited from QObject
bool blockSignals (bool b)
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). More...
 
const QObjectListchildren () const
 Returns a list of child objects. More...
 
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
 
bool disconnect (const QObject *receiver, const char *member=0)
 
void dumpObjectInfo ()
 Dumps information about signal connections, etc. More...
 
void dumpObjectTree ()
 Dumps a tree of children to the debug output. More...
 
QList< QByteArraydynamicPropertyNames () const
 Returns the names of all properties that were dynamically added to the object using setProperty(). More...
 
virtual bool event (QEvent *)
 This virtual function receives events to an object and should return true if the event e was recognized and processed. More...
 
template<typename T >
findChild (const QString &aName=QString()) const
 Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. More...
 
template<typename T >
QList< T > findChildren (const QString &aName=QString()) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. More...
 
template<typename T >
QList< T > findChildren (const QRegExp &re) const
 
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false. More...
 
void installEventFilter (QObject *)
 Installs an event filter filterObj on this object. More...
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false. More...
 
void killTimer (int id)
 Kills the timer with timer identifier, id. More...
 
virtual const QMetaObjectmetaObject () const
 Returns a pointer to the meta-object of this object. More...
 
void moveToThread (QThread *thread)
 Changes the thread affinity for this object and its children. More...
 
QString objectName () const
 
QObjectparent () const
 Returns a pointer to the parent object. More...
 
QVariant property (const char *name) const
 Returns the value of the object's name property. More...
 
Q_INVOKABLE QObject (QObject *parent=0)
 Constructs an object with parent object parent. More...
 
void removeEventFilter (QObject *)
 Removes an event filter object obj from this object. More...
 
void setObjectName (const QString &name)
 
void setParent (QObject *)
 Makes the object a child of parent. More...
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value. More...
 
void setUserData (uint id, QObjectUserData *data)
 
bool signalsBlocked () const
 Returns true if signals are blocked; otherwise returns false. More...
 
int startTimer (int interval)
 Starts a timer and returns a timer identifier, or returns zero if it could not start a timer. More...
 
QThreadthread () const
 Returns the thread in which the object lives. More...
 
QObjectUserDatauserData (uint id) const
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects. More...
 

Static Public Functions

static int titleBarSize ()
 
static int topOffset ()
 
static int topPadding ()
 
static VistaState vistaState ()
 
- Static Public Functions inherited from QObject
static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 Creates a connection of the given type from the signal in the sender object to the method in the receiver object. More...
 
static bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 Disconnects signal in object sender from method in object receiver. More...
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static uint registerUserData ()
 
static QString tr (const char *sourceText, const char *comment=0, int n=-1)
 
static QString trUtf8 (const char *sourceText, const char *comment=0, int n=-1)
 

Private Types

enum  Changes { resizeTop, movePosition, noChange }
 

Private Functions

void collapseTopFrameStrut ()
 
void drawTitleBar (QPainter *painter)
 
bool drawTitleText (QPainter *painter, const QString &text, const QRect &rect, HDC hdc)
 
bool eventFilter (QObject *obj, QEvent *event)
 Filters events if this object has been installed as an event filter for the watched object. More...
 
int leftMargin ()
 
void mouseMoveEvent (QMouseEvent *event)
 
void mousePressEvent (QMouseEvent *event)
 
void mouseReleaseEvent (QMouseEvent *event)
 
bool resolveSymbols ()
 
void setMouseCursor (QPoint pos)
 
int titleOffset ()
 
bool winEvent (MSG *message, long *result)
 

Static Private Functions

static int backButtonSize ()
 
static int captionSize ()
 
static bool drawBlackRect (const QRect &rect, HDC hdc)
 
static int frameSize ()
 
static HFONT getCaptionFont (HANDLE hTheme)
 
static int glowSize ()
 
static int iconSize ()
 
static bool isCompositionEnabled ()
 
static bool isThemeActive ()
 

Properties

QVistaBackButtonbackButton_
 
enum QVistaHelper::Changes change
 
int iconSpacing
 
bool pressed
 
QPoint pressedPos
 
QRect rtTitle
 
QRect rtTop
 
int textSpacing
 
int titleBarOffset
 
QWizardwizard
 

Static Private Attributes

static VistaState cachedVistaState = QVistaHelper::Dirty
 
static int instanceCount = 0
 
static bool is_vista = false
 

Additional Inherited Members

- Public Slots inherited from QObject
void deleteLater ()
 Schedules this object for deletion. More...
 
- Signals inherited from QObject
void destroyed (QObject *=0)
 This signal is emitted immediately before the object obj is destroyed, and can not be blocked. More...
 
- Static Public Variables inherited from QObject
static const QMetaObject staticMetaObject
 This variable stores the meta-object for the class. More...
 
- Protected Functions inherited from QObject
virtual void childEvent (QChildEvent *)
 This event handler can be reimplemented in a subclass to receive child events. More...
 
virtual void connectNotify (const char *signal)
 This virtual function is called when something has been connected to signal in this object. More...
 
virtual void customEvent (QEvent *)
 This event handler can be reimplemented in a subclass to receive custom events. More...
 
virtual void disconnectNotify (const char *signal)
 This virtual function is called when something has been disconnected from signal in this object. More...
 
 QObject (QObjectPrivate &dd, QObject *parent=0)
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal. More...
 
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. More...
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *)
 This event handler can be reimplemented in a subclass to receive timer events for the object. More...
 
- Protected Variables inherited from QObject
QScopedPointer< QObjectDatad_ptr
 
- Static Protected Variables inherited from QObject
static const QMetaObject staticQtMetaObject
 

Detailed Description

Definition at line 84 of file qwizard_win_p.h.

Enumerations

◆ Changes

enum QVistaHelper::Changes
private
Enumerator
resizeTop 
movePosition 
noChange 

Definition at line 139 of file qwizard_win_p.h.

◆ TitleBarChangeType

Enumerator
NormalTitleBar 
ExtendedTitleBar 

Definition at line 89 of file qwizard_win_p.h.

◆ VistaState

Enumerator
VistaAero 
VistaBasic 
Classic 
Dirty 

Definition at line 101 of file qwizard_win_p.h.

Constructors and Destructors

◆ QVistaHelper()

QVistaHelper::QVistaHelper ( QWizard wizard)

Definition at line 245 of file qwizard_win.cpp.

246  : QObject(wizard)
247  , pressed(false)
248  , wizard(wizard)
249  , backButton_(0)
250 {
252  if (instanceCount++ == 0)
254  if (is_vista)
255  backButton_ = new QVistaBackButton(wizard);
256 
257  // Handle diff between Windows 7 and Vista
261 }
QVistaBackButton * backButton_
static VistaState cachedVistaState
static const WinVersion WindowsVersion
the version of the Windows operating system on which the application is run (Windows only) ...
Definition: qglobal.h:1613
static bool is_vista
qreal dpiScaled(qreal value)
Q_INVOKABLE QObject(QObject *parent=0)
Constructs an object with parent object parent.
Definition: qobject.cpp:753
bool resolveSymbols()
static int instanceCount
QWizard * wizard

◆ ~QVistaHelper()

QVistaHelper::~QVistaHelper ( )

Definition at line 263 of file qwizard_win.cpp.

264 {
265  --instanceCount;
266 }
static int instanceCount

Functions

◆ backButton()

QVistaBackButton* QVistaHelper::backButton ( ) const
inline

Definition at line 96 of file qwizard_win_p.h.

96 { return backButton_; }
QVistaBackButton * backButton_

◆ backButtonSize()

static int QVistaHelper::backButtonSize ( )
inlinestaticprivate

Definition at line 118 of file qwizard_win_p.h.

118 { return int(QStyleHelper::dpiScaled(30)); }
qreal dpiScaled(qreal value)

◆ basicWindowFrameColor()

QColor QVistaHelper::basicWindowFrameColor ( )

Definition at line 300 of file qwizard_win.cpp.

301 {
302  DWORD rgb;
303  HANDLE hTheme = pOpenThemeData(QApplication::desktop()->winId(), L"WINDOW");
305  hTheme, WIZ_WP_CAPTION, WIZ_CS_ACTIVE,
307  &rgb);
308  BYTE r = GetRValue(rgb);
309  BYTE g = GetGValue(rgb);
310  BYTE b = GetBValue(rgb);
311  return QColor(r, g, b);
312 }
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition: qcolor.h:67
#define BYTE
bool isActiveWindow() const
#define WIZ_TMT_BORDERCOLORHINT
#define WIZ_CS_ACTIVE
void * HANDLE
Definition: qnamespace.h:1671
#define rgb(r, g, b)
Definition: qcolor_p.cpp:130
static QDesktopWidget * desktop()
Returns the desktop widget (also called the root window).
static PtrGetThemeColor pGetThemeColor
#define WIZ_WP_CAPTION
QWizard * wizard
#define WIZ_TMT_FILLCOLORHINT
static PtrOpenThemeData pOpenThemeData

◆ captionSize()

int QVistaHelper::captionSize ( )
staticprivate

Definition at line 762 of file qwizard_win.cpp.

Referenced by resizeEvent().

763 {
764  return GetSystemMetrics(SM_CYCAPTION);
765 }

◆ collapseTopFrameStrut()

void QVistaHelper::collapseTopFrameStrut ( )
private

Definition at line 483 of file qwizard_win.cpp.

Referenced by handleWinEvent().

484 {
485  QTLWExtra *top = ((QHackWidget *)wizard)->d_func()->topData();
486  int x1, y1, x2, y2;
487  top->frameStrut.getCoords(&x1, &y1, &x2, &y2);
488  top->frameStrut.setCoords(x1, 0, x2, y2);
489 }
QRect frameStrut
Definition: qwidget_p.h:180
void getCoords(int *x1, int *y1, int *x2, int *y2) const
Extracts the position of the rectangle&#39;s top-left corner to *x1 and *y1, and the position of the bott...
Definition: qrect.h:408
void setCoords(int x1, int y1, int x2, int y2)
Sets the coordinates of the rectangle&#39;s top-left corner to (x1, y1), and the coordinates of its botto...
Definition: qrect.h:416
QWizard * wizard

◆ disconnectBackButton()

void QVistaHelper::disconnectBackButton ( )

Definition at line 294 of file qwizard_win.cpp.

295 {
296  if (backButton_) // Leave QStyleSheetStyle's connections on destroyed() intact.
297  backButton_->disconnect(SIGNAL(clicked()));
298 }
QVistaBackButton * backButton_
#define SIGNAL(a)
Definition: qobjectdefs.h:227
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
Disconnects signal in object sender from method in object receiver.
Definition: qobject.cpp:2895

◆ drawBlackRect()

bool QVistaHelper::drawBlackRect ( const QRect rect,
HDC  hdc 
)
staticprivate

Definition at line 711 of file qwizard_win.cpp.

Referenced by drawTitleBar().

712 {
713  bool value = false;
714  if (vistaState() == VistaAero) {
715  // Set up a memory DC and bitmap that we'll draw into
716  HDC dcMem;
717  HBITMAP bmp;
718  BITMAPINFO dib = {{0}};
719  dcMem = CreateCompatibleDC(hdc);
720 
721  dib.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
722  dib.bmiHeader.biWidth = rect.width();
723  dib.bmiHeader.biHeight = -rect.height();
724  dib.bmiHeader.biPlanes = 1;
725  dib.bmiHeader.biBitCount = 32;
726  dib.bmiHeader.biCompression = BI_RGB;
727 
728  bmp = CreateDIBSection(hdc, &dib, DIB_RGB_COLORS, NULL, NULL, 0);
729  HBITMAP hOldBmp = (HBITMAP)SelectObject(dcMem, (HGDIOBJ) bmp);
730 
731  BitBlt(hdc, rect.left(), rect.top(), rect.width(), rect.height(), dcMem, 0, 0, SRCCOPY);
732  SelectObject(dcMem, (HGDIOBJ) hOldBmp);
733 
734  DeleteObject(bmp);
735  DeleteDC(dcMem);
736  }
737  return value;
738 }
static VistaState vistaState()
int left() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:240
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
int top() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:243

◆ drawTitleBar()

void QVistaHelper::drawTitleBar ( QPainter painter)
private

Definition at line 329 of file qwizard_win.cpp.

Referenced by paintEvent().

330 {
331  HDC hdc = painter->paintEngine()->getDC();
332 
333  if (vistaState() == VistaAero)
334  drawBlackRect(QRect(0, 0, wizard->width(),
335  titleBarSize() + topOffset()), hdc);
337  const int btnTop = backButton_->mapToParent(QPoint()).y();
338  const int btnHeight = backButton_->size().height();
339  const int verticalCenter = (btnTop + btnHeight / 2) - 1;
340 
341  const QString text = wizard->window()->windowTitle();
342  const QFont font = QApplication::font("QWorkspaceTitleBar");
343  const QFontMetrics fontMetrics(font);
344  const QRect brect = fontMetrics.boundingRect(text);
345  int textHeight = brect.height();
346  int textWidth = brect.width();
347  int glowOffset = 0;
348 
349  if (vistaState() == VistaAero) {
350  textHeight += 2 * glowSize();
351  textWidth += 2 * glowSize();
352  glowOffset = glowSize();
353  }
354 
355  const int titleLeft = (wizard->layoutDirection() == Qt::LeftToRight
356  ? titleOffset() - glowOffset
357  : wizard->width() - titleOffset() - textWidth + glowOffset);
358 
360  painter, text,
361  QRect(titleLeft, verticalCenter - textHeight / 2, textWidth, textHeight),
362  hdc);
363 
364  if (!wizard->windowIcon().isNull()) {
365  const int iconLeft = (wizard->layoutDirection() == Qt::LeftToRight
366  ? leftMargin()
367  : wizard->width() - leftMargin() - iconSize());
368 
369  QRect rect(iconLeft, verticalCenter - iconSize() / 2, iconSize(), iconSize());
370  HICON hIcon = wizard->windowIcon().pixmap(iconSize()).toWinHICON();
371  DrawIconEx(hdc, rect.left(), rect.top(), hIcon, 0, 0, 0, NULL, DI_NORMAL | DI_COMPAT);
372  DestroyIcon(hIcon);
373  }
374 }
The QFontMetrics class provides font metrics information.
Definition: qfontmetrics.h:65
QSize size() const
QVistaBackButton * backButton_
static VistaState vistaState()
static bool drawBlackRect(const QRect &rect, HDC hdc)
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
static int topOffset()
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
The QString class provides a Unicode character string.
Definition: qstring.h:83
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
bool drawTitleText(QPainter *painter, const QString &text, const QRect &rect, HDC hdc)
static QFont font()
Returns the default application font.
QIcon windowIcon() const
virtual HDC getDC() const
Empty default implementation.
static int titleBarSize()
int width() const
bool isNull() const
Returns true if the icon is empty; otherwise returns false.
Definition: qicon.cpp:769
static int iconSize()
QString windowTitle
the window title (caption)
Definition: qwidget.h:198
QPaintEngine * paintEngine() const
Returns the paint engine that the painter is currently operating on if the painter is active; otherwi...
Definition: qpainter.cpp:1991
Qt::LayoutDirection layoutDirection() const
HICON toWinHICON() const
Returns the HICON handle.
The QFont class specifies a font used for drawing text.
Definition: qfont.h:64
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
QPoint mapToParent(const QPoint &) const
Translates the widget coordinate pos to a coordinate in the parent widget.
Definition: qwidget.cpp:4459
int height() const
Returns the height.
Definition: qsize.h:129
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
int y() const
Returns the y coordinate of this point.
Definition: qpoint.h:131
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492
QPixmap pixmap(const QSize &size, Mode mode=Normal, State state=Off) const
Returns a pixmap with the requested size, mode, and state, generating one if necessary.
Definition: qicon.cpp:693
QWizard * wizard
static int glowSize()
#define text
Definition: qobjectdefs.h:80

◆ drawTitleText()

bool QVistaHelper::drawTitleText ( QPainter painter,
const QString text,
const QRect rect,
HDC  hdc 
)
private

Definition at line 663 of file qwizard_win.cpp.

Referenced by drawTitleBar().

664 {
665  bool value = false;
666  if (vistaState() == VistaAero) {
667  HANDLE hTheme = pOpenThemeData(QApplication::desktop()->winId(), L"WINDOW");
668  if (!hTheme) return false;
669  // Set up a memory DC and bitmap that we'll draw into
670  HDC dcMem;
671  HBITMAP bmp;
672  BITMAPINFO dib = {{0}};
673  dcMem = CreateCompatibleDC(hdc);
674 
675  dib.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
676  dib.bmiHeader.biWidth = rect.width();
677  dib.bmiHeader.biHeight = -rect.height();
678  dib.bmiHeader.biPlanes = 1;
679  dib.bmiHeader.biBitCount = 32;
680  dib.bmiHeader.biCompression = BI_RGB;
681 
682  bmp = CreateDIBSection(hdc, &dib, DIB_RGB_COLORS, NULL, NULL, 0);
683 
684  // Set up the DC
685  HFONT hCaptionFont = getCaptionFont(hTheme);
686  HBITMAP hOldBmp = (HBITMAP)SelectObject(dcMem, (HGDIOBJ) bmp);
687  HFONT hOldFont = (HFONT)SelectObject(dcMem, (HGDIOBJ) hCaptionFont);
688 
689  // Draw the text!
690  WIZ_DTTOPTS dto = { sizeof(WIZ_DTTOPTS) };
692  RECT rctext ={0,0, rect.width(), rect.height()};
693 
695  dto.iGlowSize = glowSize();
696 
697  pDrawThemeTextEx(hTheme, dcMem, 0, 0, (LPCWSTR)text.utf16(), -1, uFormat, &rctext, &dto );
698  BitBlt(hdc, rect.left(), rect.top(), rect.width(), rect.height(), dcMem, 0, 0, SRCCOPY);
699  SelectObject(dcMem, (HGDIOBJ) hOldBmp);
700  SelectObject(dcMem, (HGDIOBJ) hOldFont);
701  DeleteObject(bmp);
702  DeleteObject(hCaptionFont);
703  DeleteDC(dcMem);
704  //ReleaseDC(hwnd, hdc);
705  } else if (vistaState() == VistaBasic) {
706  painter->drawText(rect, text);
707  }
708  return value;
709 }
static PtrDrawThemeTextEx pDrawThemeTextEx
static VistaState vistaState()
int left() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:240
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
#define WIZ_DT_SINGLELINE
#define WIZ_DT_VCENTER
#define WIZ_DT_CENTER
#define WIZ_DTT_COMPOSITED
void drawText(const QPointF &p, const QString &s)
Draws the given text with the currently defined text direction, beginning at the given position...
Definition: qpainter.cpp:6231
#define WIZ_DTT_GLOWSIZE
void * HANDLE
Definition: qnamespace.h:1671
static QDesktopWidget * desktop()
Returns the desktop widget (also called the root window).
int top() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:243
#define WIZ_DT_NOPREFIX
static HFONT getCaptionFont(HANDLE hTheme)
static int glowSize()
static PtrOpenThemeData pOpenThemeData
const ushort * utf16() const
Returns the QString as a &#39;\0\&#39;-terminated array of unsigned shorts.
Definition: qstring.cpp:5290

◆ eventFilter()

bool QVistaHelper::eventFilter ( QObject ,
QEvent  
)
privatevirtual

Filters events if this object has been installed as an event filter for the watched object.

In your reimplementation of this function, if you want to filter the event out, i.e. stop it being handled further, return true; otherwise return false.

Example:

class MainWindow : public QMainWindow
{
public:
MainWindow();
protected:
bool eventFilter(QObject *obj, QEvent *ev);
private:
QTextEdit *textEdit;
};
MainWindow::MainWindow()
{
textEdit = new QTextEdit;
setCentralWidget(textEdit);
textEdit->installEventFilter(this);
}
bool MainWindow::eventFilter(QObject *obj, QEvent *event)
{
if (obj == textEdit) {
if (event->type() == QEvent::KeyPress) {
QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
qDebug() << "Ate key press" << keyEvent->key();
return true;
} else {
return false;
}
} else {
// pass the event on to the parent class
return QMainWindow::eventFilter(obj, event);
}
}

Notice in the example above that unhandled events are passed to the base class's eventFilter() function, since the base class might have reimplemented eventFilter() for its own internal purposes.

Warning
If you delete the receiver object in this function, be sure to return true. Otherwise, Qt will forward the event to the deleted object and the program might crash.
See also
installEventFilter()

Reimplemented from QObject.

Definition at line 596 of file qwizard_win.cpp.

597 {
598  if (obj != wizard)
599  return QObject::eventFilter(obj, event);
600 
601  if (event->type() == QEvent::MouseMove) {
602  QMouseEvent *mouseEvent = static_cast<QMouseEvent*>(event);
603  long result;
604  MSG msg;
605  msg.message = WM_NCHITTEST;
606  msg.wParam = 0;
607  msg.lParam = MAKELPARAM(mouseEvent->globalX(), mouseEvent->globalY());
608  msg.hwnd = wizard->winId();
609  winEvent(&msg, &result);
610  msg.wParam = result;
611  msg.message = WM_NCMOUSEMOVE;
612  winEvent(&msg, &result);
613  } else if (event->type() == QEvent::MouseButtonPress) {
614  QMouseEvent *mouseEvent = static_cast<QMouseEvent*>(event);
615 
616  if (mouseEvent->button() == Qt::LeftButton) {
617  long result;
618  MSG msg;
619  msg.message = WM_NCHITTEST;
620  msg.wParam = 0;
621  msg.lParam = MAKELPARAM(mouseEvent->globalX(), mouseEvent->globalY());
622  msg.hwnd = wizard->winId();
623  winEvent(&msg, &result);
624  msg.wParam = result;
625  msg.message = WM_NCLBUTTONDOWN;
626  winEvent(&msg, &result);
627  }
628  } else if (event->type() == QEvent::MouseButtonRelease) {
629  QMouseEvent *mouseEvent = static_cast<QMouseEvent*>(event);
630 
631  if (mouseEvent->button() == Qt::LeftButton) {
632  long result;
633  MSG msg;
634  msg.message = WM_NCHITTEST;
635  msg.wParam = 0;
636  msg.lParam = MAKELPARAM(mouseEvent->globalX(), mouseEvent->globalY());
637  msg.hwnd = wizard->winId();
638  winEvent(&msg, &result);
639  msg.wParam = result;
640  msg.message = WM_NCLBUTTONUP;
641  winEvent(&msg, &result);
642  }
643  }
644 
645  return false;
646 }
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
Definition: qobject.cpp:1200
bool winEvent(MSG *message, long *result)
int globalX() const
Returns the global x position of the mouse cursor at the time of the event.
Definition: qevent.h:99
Qt::MouseButton button() const
Returns the button that caused the event.
Definition: qevent.h:101
virtual bool eventFilter(QObject *, QEvent *)
Filters events if this object has been installed as an event filter for the watched object...
Definition: qobject.cpp:1375
The QMouseEvent class contains parameters that describe a mouse event.
Definition: qevent.h:85
struct tagMSG MSG
int globalY() const
Returns the global y position of the mouse cursor at the time of the event.
Definition: qevent.h:100
WId winId() const
Returns the window system identifier of the widget.
Definition: qwidget.cpp:2557
QWizard * wizard
void mouseEvent(QEvent *event)

◆ frameSize()

int QVistaHelper::frameSize ( )
staticprivate

Definition at line 757 of file qwizard_win.cpp.

Referenced by resizeEvent().

758 {
759  return getWindowBottomMargin();
760 }
static int getWindowBottomMargin()

◆ getCaptionFont()

HFONT QVistaHelper::getCaptionFont ( HANDLE  hTheme)
staticprivate

Definition at line 648 of file qwizard_win.cpp.

Referenced by drawTitleText().

649 {
650  LOGFONT lf = {0};
651 
652  if (!hTheme)
654  else
655  {
656  NONCLIENTMETRICS ncm = {sizeof(NONCLIENTMETRICS)};
657  SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, false);
658  lf = ncm.lfMessageFont;
659  }
660  return CreateFontIndirect(&lf);
661 }
#define WIZ_TMT_CAPTIONFONT
static PtrGetThemeSysFont pGetThemeSysFont

◆ glowSize()

static int QVistaHelper::glowSize ( )
inlinestaticprivate

Definition at line 120 of file qwizard_win_p.h.

Referenced by drawTitleBar(), and drawTitleText().

120 { return 10; }

◆ handleWinEvent()

bool QVistaHelper::handleWinEvent ( MSG message,
long *  result 
)

Definition at line 491 of file qwizard_win.cpp.

492 {
493  if (message->message == WIZ_WM_THEMECHANGED || message->message == WIZ_WM_DWMCOMPOSITIONCHANGED)
495 
496  bool status = false;
498  status = winEvent(message, result);
499  if (message->message == WM_NCCALCSIZE) {
500  if (status)
502  } else if (message->message == WM_NCPAINT) {
503  wizard->update();
504  }
505  }
506  return status;
507 }
static VistaState vistaState()
static VistaState cachedVistaState
static LibLoadStatus status
Definition: qlocale_icu.cpp:69
WizardStyle wizardStyle
the look and feel of the wizard
Definition: qwizard.h:64
void update()
Updates the widget unless updates are disabled or the widget is hidden.
Definition: qwidget.cpp:10883
bool winEvent(MSG *message, long *result)
#define WIZ_WM_DWMCOMPOSITIONCHANGED
Definition: qwizard_win.cpp:98
void collapseTopFrameStrut()
#define WIZ_WM_THEMECHANGED
Definition: qwizard_win.cpp:97
QWizard * wizard

◆ hideBackButton()

void QVistaHelper::hideBackButton ( )
inline

Definition at line 98 of file qwizard_win_p.h.

98 { if (backButton_) backButton_->hide(); }
QVistaBackButton * backButton_
void hide()
Hides the widget.
Definition: qwidget.h:501

◆ iconSize()

static int QVistaHelper::iconSize ( )
inlinestaticprivate

Definition at line 119 of file qwizard_win_p.h.

Referenced by drawTitleBar(), and titleOffset().

119 { return 16; } // Standard Aero

◆ isCompositionEnabled()

bool QVistaHelper::isCompositionEnabled ( )
staticprivate

Definition at line 268 of file qwizard_win.cpp.

Referenced by vistaState().

269 {
270  bool value = is_vista;
271  if (is_vista) {
272  HRESULT hr;
273  BOOL bEnabled;
274 
275  hr = pDwmIsCompositionEnabled(&bEnabled);
276  value = (SUCCEEDED(hr) && bEnabled);
277  }
278  return value;
279 }
static bool is_vista
long HRESULT
static PtrDwmIsCompositionEnabled pDwmIsCompositionEnabled

◆ isThemeActive()

bool QVistaHelper::isThemeActive ( )
staticprivate

Definition at line 281 of file qwizard_win.cpp.

Referenced by vistaState().

282 {
283  return is_vista && pIsThemeActive();
284 }
static PtrIsThemeActive pIsThemeActive
static bool is_vista

◆ leftMargin()

int QVistaHelper::leftMargin ( )
inlineprivate

Definition at line 121 of file qwizard_win_p.h.

Referenced by drawTitleBar(), and titleOffset().

121 { return backButton_->isVisible() ? backButtonSize() + iconSpacing : 0; }
QVistaBackButton * backButton_
bool isVisible() const
Definition: qwidget.h:1005
static int backButtonSize()

◆ mouseEvent()

void QVistaHelper::mouseEvent ( QEvent event)

Definition at line 443 of file qwizard_win.cpp.

Referenced by eventFilter().

444 {
445  switch (event->type()) {
446  case QEvent::MouseMove:
447  mouseMoveEvent(static_cast<QMouseEvent *>(event));
448  break;
450  mousePressEvent(static_cast<QMouseEvent *>(event));
451  break;
453  mouseReleaseEvent(static_cast<QMouseEvent *>(event));
454  break;
455  default:
456  break;
457  }
458 }
void mouseMoveEvent(QMouseEvent *event)
void mousePressEvent(QMouseEvent *event)
void mouseReleaseEvent(QMouseEvent *event)
Type type() const
Returns the event type.
Definition: qcoreevent.h:303

◆ mouseMoveEvent()

void QVistaHelper::mouseMoveEvent ( QMouseEvent event)
private

Definition at line 526 of file qwizard_win.cpp.

Referenced by mouseEvent().

527 {
529  event->ignore();
530  return;
531  }
532 
533  QRect rect = wizard->geometry();
534  if (pressed) {
535  switch (change) {
536  case resizeTop:
537  {
538  const int dy = event->pos().y() - pressedPos.y();
539  if ((dy > 0 && rect.height() > wizard->minimumHeight())
540  || (dy < 0 && rect.height() < wizard->maximumHeight()))
541  rect.setTop(rect.top() + dy);
542  }
543  break;
544  case movePosition: {
545  QPoint newPos = event->pos() - pressedPos;
546  rect.moveLeft(rect.left() + newPos.x());
547  rect.moveTop(rect.top() + newPos.y());
548  break; }
549  default:
550  break;
551  }
552  wizard->setGeometry(rect);
553 
554  } else if (vistaState() == VistaAero) {
555  setMouseCursor(event->pos());
556  }
557  event->ignore();
558 }
int minimumHeight() const
Qt::WindowStates windowState() const
Returns the current window state.
Definition: qwidget.cpp:3086
void moveLeft(int pos)
Moves the rectangle horizontally, leaving the rectangle&#39;s left edge at the given x coordinate...
Definition: qrect.h:350
static VistaState vistaState()
int left() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:240
void setGeometry(int x, int y, int w, int h)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qwidget.h:1017
enum QVistaHelper::Changes change
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
const QPoint & pos() const
Returns the position of the mouse cursor, relative to the widget that received the event...
Definition: qevent.h:95
void setTop(int pos)
Sets the top edge of the rectangle to the given y coordinate.
Definition: qrect.h:261
void setMouseCursor(QPoint pos)
int top() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:243
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
QPoint pressedPos
int maximumHeight() const
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
int y() const
Returns the y coordinate of this point.
Definition: qpoint.h:131
int x() const
Returns the x coordinate of this point.
Definition: qpoint.h:128
void moveTop(int pos)
Moves the rectangle vertically, leaving the rectangle&#39;s top edge at the given y coordinate.
Definition: qrect.h:353
const QRect & geometry() const
QWizard * wizard

◆ mousePressEvent()

void QVistaHelper::mousePressEvent ( QMouseEvent event)
private

Definition at line 560 of file qwizard_win.cpp.

Referenced by mouseEvent().

561 {
562  change = noChange;
563 
564  if (event->button() != Qt::LeftButton || wizard->windowState() & Qt::WindowMaximized) {
565  event->ignore();
566  return;
567  }
568 
569  if (rtTitle.contains(event->pos())) {
571  } else if (rtTop.contains(event->pos()))
573 
574  if (change != noChange) {
575  if (vistaState() == VistaAero)
576  setMouseCursor(event->pos());
577  pressed = true;
578  pressedPos = event->pos();
579  } else {
580  event->ignore();
581  }
582 }
Qt::WindowStates windowState() const
Returns the current window state.
Definition: qwidget.cpp:3086
static VistaState vistaState()
enum QVistaHelper::Changes change
const QPoint & pos() const
Returns the position of the mouse cursor, relative to the widget that received the event...
Definition: qevent.h:95
void setMouseCursor(QPoint pos)
Qt::MouseButton button() const
Returns the button that caused the event.
Definition: qevent.h:101
bool contains(const QPoint &p, bool proper=false) const
Returns true if the given point is inside or on the edge of the rectangle, otherwise returns false...
Definition: qrect.cpp:1101
QPoint pressedPos
QWizard * wizard

◆ mouseReleaseEvent()

void QVistaHelper::mouseReleaseEvent ( QMouseEvent event)
private

Definition at line 584 of file qwizard_win.cpp.

Referenced by mouseEvent().

585 {
586  change = noChange;
587  if (pressed) {
588  pressed = false;
589  wizard->releaseMouse();
590  if (vistaState() == VistaAero)
591  setMouseCursor(event->pos());
592  }
593  event->ignore();
594 }
static VistaState vistaState()
enum QVistaHelper::Changes change
const QPoint & pos() const
Returns the position of the mouse cursor, relative to the widget that received the event...
Definition: qevent.h:95
void releaseMouse()
Releases the mouse grab.
void setMouseCursor(QPoint pos)
QWizard * wizard

◆ paintEvent()

void QVistaHelper::paintEvent ( QPaintEvent event)

Definition at line 519 of file qwizard_win.cpp.

520 {
521  Q_UNUSED(event);
522  QPainter painter(wizard);
523  drawTitleBar(&painter);
524 }
The QPainter class performs low-level painting on widgets and other paint devices.
Definition: qpainter.h:86
void drawTitleBar(QPainter *painter)
QWizard * wizard
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ resizeEvent()

void QVistaHelper::resizeEvent ( QResizeEvent event)

Definition at line 509 of file qwizard_win.cpp.

510 {
511  Q_UNUSED(event);
512  rtTop = QRect (0, 0, wizard->width(), frameSize());
513  int height = captionSize() + topOffset();
514  if (vistaState() == VistaBasic)
515  height -= titleBarSize();
516  rtTitle = QRect (0, frameSize(), wizard->width(), height);
517 }
static VistaState vistaState()
static int topOffset()
static int frameSize()
static int titleBarSize()
int width() const
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
static int captionSize()
QWizard * wizard
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ resolveSymbols()

bool QVistaHelper::resolveSymbols ( )
private

Definition at line 767 of file qwizard_win.cpp.

Referenced by QVistaHelper().

768 {
769  static bool tried = false;
770  if (!tried) {
771  QSystemLibrary dwmLib(L"dwmapi");
773  (PtrDwmIsCompositionEnabled)dwmLib.resolve("DwmIsCompositionEnabled");
775  pDwmDefWindowProc = (PtrDwmDefWindowProc)dwmLib.resolve("DwmDefWindowProc");
777  (PtrDwmExtendFrameIntoClientArea)dwmLib.resolve("DwmExtendFrameIntoClientArea");
778  }
779  QSystemLibrary themeLib(L"uxtheme");
780  pIsAppThemed = (PtrIsAppThemed)themeLib.resolve("IsAppThemed");
781  if (pIsAppThemed) {
782  pDrawThemeBackground = (PtrDrawThemeBackground)themeLib.resolve("DrawThemeBackground");
783  pGetThemePartSize = (PtrGetThemePartSize)themeLib.resolve("GetThemePartSize");
784  pGetThemeColor = (PtrGetThemeColor)themeLib.resolve("GetThemeColor");
785  pIsThemeActive = (PtrIsThemeActive)themeLib.resolve("IsThemeActive");
786  pOpenThemeData = (PtrOpenThemeData)themeLib.resolve("OpenThemeData");
787  pCloseThemeData = (PtrCloseThemeData)themeLib.resolve("CloseThemeData");
788  pGetThemeSysFont = (PtrGetThemeSysFont)themeLib.resolve("GetThemeSysFont");
789  pDrawThemeTextEx = (PtrDrawThemeTextEx)themeLib.resolve("DrawThemeTextEx");
790  pSetWindowThemeAttribute = (PtrSetWindowThemeAttribute)themeLib.resolve("SetWindowThemeAttribute");
791  }
792  tried = true;
793  }
794 
795  return (
797  && pDwmDefWindowProc != 0
799  && pIsAppThemed != 0
800  && pDrawThemeBackground != 0
801  && pGetThemePartSize != 0
802  && pGetThemeColor != 0
803  && pIsThemeActive != 0
804  && pOpenThemeData != 0
805  && pCloseThemeData != 0
806  && pGetThemeSysFont != 0
807  && pDrawThemeTextEx != 0
809  );
810 }
static PtrIsThemeActive pIsThemeActive
static PtrDrawThemeBackground pDrawThemeBackground
static PtrDrawThemeTextEx pDrawThemeTextEx
static PtrDwmDefWindowProc pDwmDefWindowProc
bool(WINAPI * PtrIsAppThemed)()
static PtrGetThemePartSize pGetThemePartSize
HRESULT(WINAPI * PtrGetThemeColor)(HANDLE hTheme, int iPartId, int iStateId, int iPropId, OUT COLORREF *pColor)
HRESULT(WINAPI * PtrSetWindowThemeAttribute)(HWND hwnd, enum WIZ_WINDOWTHEMEATTRIBUTETYPE eAttribute, PVOID pvAttribute, DWORD cbAttribute)
bool(WINAPI * PtrIsThemeActive)()
static PtrCloseThemeData pCloseThemeData
HRESULT(WINAPI * PtrCloseThemeData)(HANDLE hTheme)
HRESULT(WINAPI * PtrGetThemePartSize)(HANDLE hTheme, HDC hdc, int iPartId, int iStateId, OPTIONAL RECT *prc, enum THEMESIZE eSize, OUT SIZE *psz)
static PtrIsAppThemed pIsAppThemed
HRESULT(WINAPI * PtrDrawThemeTextEx)(HANDLE hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int cchText, DWORD dwTextFlags, LPRECT pRect, const WIZ_DTTOPTS *pOptions)
HRESULT(WINAPI * PtrDwmExtendFrameIntoClientArea)(HWND hWnd, const WIZ_MARGINS *pMarInset)
static PtrSetWindowThemeAttribute pSetWindowThemeAttribute
HANDLE(WINAPI * PtrOpenThemeData)(HWND hwnd, LPCWSTR pszClassList)
HRESULT(WINAPI * PtrDwmIsCompositionEnabled)(BOOL *pfEnabled)
static PtrGetThemeSysFont pGetThemeSysFont
static PtrDwmExtendFrameIntoClientArea pDwmExtendFrameIntoClientArea
static PtrGetThemeColor pGetThemeColor
HRESULT(WINAPI * PtrGetThemeSysFont)(HANDLE hTheme, int iFontId, LOGFONTW *plf)
HRESULT(WINAPI * PtrDrawThemeBackground)(HANDLE hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, OPTIONAL const RECT *pClipRect)
static PtrOpenThemeData pOpenThemeData
BOOL(WINAPI * PtrDwmDefWindowProc)(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, LRESULT *plResult)
static PtrDwmIsCompositionEnabled pDwmIsCompositionEnabled

◆ setDWMTitleBar()

bool QVistaHelper::setDWMTitleBar ( TitleBarChangeType  type)

Definition at line 314 of file qwizard_win.cpp.

315 {
316  bool value = false;
317  if (vistaState() == VistaAero) {
318  WIZ_MARGINS mar = {0};
319  if (type == NormalTitleBar)
320  mar.cyTopHeight = 0;
321  else
322  mar.cyTopHeight = titleBarSize() + topOffset();
324  value = SUCCEEDED(hr);
325  }
326  return value;
327 }
int type
Definition: qmetatype.cpp:239
static VistaState vistaState()
static int topOffset()
static int titleBarSize()
long HRESULT
static PtrDwmExtendFrameIntoClientArea pDwmExtendFrameIntoClientArea
WId winId() const
Returns the window system identifier of the widget.
Definition: qwidget.cpp:2557
QWizard * wizard

◆ setMouseCursor()

void QVistaHelper::setMouseCursor ( QPoint  pos)
private

Definition at line 433 of file qwizard_win.cpp.

Referenced by mouseMoveEvent(), mousePressEvent(), and mouseReleaseEvent().

434 {
435 #ifndef QT_NO_CURSOR
436  if (rtTop.contains(pos))
438  else
440 #endif
441 }
void setCursor(const QCursor &)
Definition: qwidget.cpp:5290
bool contains(const QPoint &p, bool proper=false) const
Returns true if the given point is inside or on the edge of the rectangle, otherwise returns false...
Definition: qrect.cpp:1101
QWizard * wizard

◆ setTitleBarIconAndCaptionVisible()

void QVistaHelper::setTitleBarIconAndCaptionVisible ( bool  visible)

Definition at line 376 of file qwizard_win.cpp.

377 {
378  if (is_vista) {
379  WIZ_WTA_OPTIONS opt;
381  if (visible)
382  opt.dwMask = 0;
383  else
386  }
387 }
#define WIZ_WTNCA_NODRAWCAPTION
#define WIZ_WTNCA_NODRAWICON
static bool is_vista
static PtrSetWindowThemeAttribute pSetWindowThemeAttribute
WId winId() const
Returns the window system identifier of the widget.
Definition: qwidget.cpp:2557
QWizard * wizard

◆ setWindowPosHack()

void QVistaHelper::setWindowPosHack ( )

Definition at line 464 of file qwizard_win.cpp.

465 {
466  const int x = wizard->geometry().x(); // ignored by SWP_NOMOVE
467  const int y = wizard->geometry().y(); // ignored by SWP_NOMOVE
468  const int w = wizard->width();
469  const int h = wizard->height();
470  SetWindowPos(wizard->winId(), 0, x, y, w, h, SWP_NOMOVE | SWP_NOZORDER | SWP_FRAMECHANGED);
471 }
int height() const
int width() const
int y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:255
int x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:252
WId winId() const
Returns the window system identifier of the widget.
Definition: qwidget.cpp:2557
const QRect & geometry() const
QWizard * wizard

◆ titleBarSize()

static int QVistaHelper::titleBarSize ( )
inlinestatic

Definition at line 103 of file qwizard_win_p.h.

Referenced by drawTitleBar(), resizeEvent(), setDWMTitleBar(), topOffset(), and winEvent().

103 { return frameSize() + captionSize(); }
static int frameSize()
static int captionSize()

◆ titleOffset()

int QVistaHelper::titleOffset ( )
private

Definition at line 812 of file qwizard_win.cpp.

Referenced by drawTitleBar().

813 {
814  int iconOffset = wizard ->windowIcon().isNull() ? 0 : iconSize() + textSpacing;
815  return leftMargin() + iconOffset;
816 }
QIcon windowIcon() const
bool isNull() const
Returns true if the icon is empty; otherwise returns false.
Definition: qicon.cpp:769
static int iconSize()
QWizard * wizard

◆ topOffset()

int QVistaHelper::topOffset ( )
static

Definition at line 818 of file qwizard_win.cpp.

Referenced by drawTitleBar(), QWizard::paintEvent(), resizeEvent(), and setDWMTitleBar().

819 {
820  if (vistaState() != VistaAero)
821  return titleBarSize() + 3;
822  static const int aeroOffset =
825  return aeroOffset + titleBarSize();
826 }
static VistaState vistaState()
static const WinVersion WindowsVersion
the version of the Windows operating system on which the application is run (Windows only) ...
Definition: qglobal.h:1613
static int titleBarSize()
qreal dpiScaled(qreal value)

◆ topPadding()

static int QVistaHelper::topPadding ( )
inlinestatic

Definition at line 104 of file qwizard_win_p.h.

104  { // padding under text
105  return int(QStyleHelper::dpiScaled(
107  }
static const WinVersion WindowsVersion
the version of the Windows operating system on which the application is run (Windows only) ...
Definition: qglobal.h:1613
qreal dpiScaled(qreal value)

◆ vistaState()

QVistaHelper::VistaState QVistaHelper::vistaState ( )
static

◆ winEvent()

bool QVistaHelper::winEvent ( MSG message,
long *  result 
)
private

Definition at line 389 of file qwizard_win.cpp.

Referenced by eventFilter(), and handleWinEvent().

390 {
391  switch (msg->message) {
392  case WM_NCHITTEST: {
393  LRESULT lResult;
394  // Perform hit testing using DWM
395  if (pDwmDefWindowProc(msg->hwnd, msg->message, msg->wParam, msg->lParam, &lResult)) {
396  // DWM returned a hit, no further processing necessary
397  *result = lResult;
398  } else {
399  // DWM didn't return a hit, process using DefWindowProc
400  lResult = DefWindowProc(msg->hwnd, msg->message, msg->wParam, msg->lParam);
401  // If DefWindowProc returns a window caption button, just return HTCLIENT (client area).
402  // This avoid unnecessary hits to Windows NT style caption buttons which aren't visible but are
403  // located just under the Aero style window close button.
404  if (lResult == HTCLOSE || lResult == HTMAXBUTTON || lResult == HTMINBUTTON || lResult == HTHELP)
405  *result = HTCLIENT;
406  else
407  *result = lResult;
408  }
409  break;
410  }
411  case WM_NCCALCSIZE:
412  if (vistaState() == VistaAero) {
413  NCCALCSIZE_PARAMS* lpncsp = (NCCALCSIZE_PARAMS*)msg->lParam;
414  *result = DefWindowProc(msg->hwnd, msg->message, msg->wParam, msg->lParam);
415  lpncsp->rgrc[0].top -= titleBarSize();
416  } else {
417  return false;
418  }
419  break;
420  default:
421  LRESULT lResult;
422  // Pass to DWM to handle
423  if (pDwmDefWindowProc(msg->hwnd, msg->message, msg->wParam, msg->lParam, &lResult))
424  *result = lResult;
425  // If the message wasn't handled by DWM, continue processing it as normal
426  else
427  return false;
428  }
429 
430  return true;
431 }
static VistaState vistaState()
static PtrDwmDefWindowProc pDwmDefWindowProc
static int titleBarSize()

Properties

◆ backButton_

QVistaBackButton* QVistaHelper::backButton_
private

Definition at line 145 of file qwizard_win_p.h.

Referenced by disconnectBackButton(), drawTitleBar(), and QVistaHelper().

◆ cachedVistaState

QVistaHelper::VistaState QVistaHelper::cachedVistaState = QVistaHelper::Dirty
staticprivate

Definition at line 136 of file qwizard_win_p.h.

Referenced by handleWinEvent(), QVistaHelper(), and vistaState().

◆ change

enum QVistaHelper::Changes QVistaHelper::change
private

◆ iconSpacing

int QVistaHelper::iconSpacing
private

Definition at line 148 of file qwizard_win_p.h.

Referenced by QVistaHelper().

◆ instanceCount

int QVistaHelper::instanceCount = 0
staticprivate

Definition at line 134 of file qwizard_win_p.h.

Referenced by QVistaHelper(), vistaState(), and ~QVistaHelper().

◆ is_vista

bool QVistaHelper::is_vista = false
staticprivate

◆ pressed

bool QVistaHelper::pressed
private

Definition at line 141 of file qwizard_win_p.h.

Referenced by mouseMoveEvent(), mousePressEvent(), and mouseReleaseEvent().

◆ pressedPos

QPoint QVistaHelper::pressedPos
private

Definition at line 140 of file qwizard_win_p.h.

Referenced by mouseMoveEvent(), and mousePressEvent().

◆ rtTitle

QRect QVistaHelper::rtTitle
private

Definition at line 143 of file qwizard_win_p.h.

Referenced by mousePressEvent(), and resizeEvent().

◆ rtTop

QRect QVistaHelper::rtTop
private

Definition at line 142 of file qwizard_win_p.h.

Referenced by mousePressEvent(), resizeEvent(), and setMouseCursor().

◆ textSpacing

int QVistaHelper::textSpacing
private

Definition at line 149 of file qwizard_win_p.h.

Referenced by QVistaHelper(), and titleOffset().

◆ titleBarOffset

int QVistaHelper::titleBarOffset
private

Definition at line 147 of file qwizard_win_p.h.

◆ wizard

QWizard* QVistaHelper::wizard
private

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