Home

qwinhost.h

This is the verbatim text of the qwinhost.h include file. It is provided only for illustration; the copyright remains with Trolltech.


/****************************************************************************
** $Id: $
**
** Declaration of the QWinHost classes
**
** Copyright (C) 2002-2003 Trolltech AS.  All rights reserved.
**
** This file is part of the MFC/Win32 migration framework.
**
** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
** licenses for Windows may use this file in accordance with the Qt Commercial
** License Agreement provided with the Software.
**
** This file is not available for use under any other license without
** express written permission from the copyright holder.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
**   information about Qt Commercial License Agreements.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/

#ifndef QWINHOST_H
#define QWINHOST_H

#include <qwidget.h>

#if defined(Q_WS_WIN)
#  if !defined(QT_QTWINMIGRATE_EXPORT) && !defined(QT_QTWINMIGRATE_IMPORT)
#    define QT_QTWINMIGRATE_EXPORT
#  elif defined(QT_QTWINMIGRATE_IMPORT)
#    if defined(QT_QTWINMIGRATE_EXPORT)
#      undef QT_QTWINMIGRATE_EXPORT
#    endif
#    define QT_QTWINMIGRATE_EXPORT __declspec(dllimport)
#  elif defined(QT_QTWINMIGRATE_EXPORT)
#    undef QT_QTWINMIGRATE_EXPORT
#    define QT_QTWINMIGRATE_EXPORT __declspec(dllexport)
#  endif
#else
#  define QT_QTWINMIGRATE_EXPORT
#endif

class QT_QTWINMIGRATE_EXPORT QWinHost : public QWidget
{
public:
    QWinHost( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
    ~QWinHost();

    void setWindow( HWND );
    HWND window() const;

    void polish();

protected:
    virtual HWND createWindow( HWND parent, HINSTANCE instance );

    bool event(QEvent *e);
    void showEvent( QShowEvent * );
    void focusInEvent( QFocusEvent* );
    void resizeEvent( QResizeEvent* );

private:
    friend void* getWindowProc(QWinHost*);

    void *wndproc;
    bool own_hwnd;
    HWND hwnd;
};

#endif // QWINHOST_H

Copyright © 2003-2005 TrolltechTrademarks
Qt Solutions