File indexing completed on 2024-05-05 03:49:48

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2010 Bastian Holst <bastianholst@gmx.de>
0004 //
0005 
0006 #ifndef MARBLE_WIDGETGRAPHICSITEM_H
0007 #define MARBLE_WIDGETGRAPHICSITEM_H
0008 
0009 // Marble
0010 #include "ScreenGraphicsItem.h"
0011 #include "marble_export.h"
0012 
0013 class QWidget;
0014 
0015 namespace Marble
0016 {
0017 
0018 class WidgetGraphicsItemPrivate;
0019 
0020 class MARBLE_EXPORT WidgetGraphicsItem : public ScreenGraphicsItem
0021 {
0022  public:
0023     explicit WidgetGraphicsItem( MarbleGraphicsItem *parent = nullptr );
0024 
0025     ~WidgetGraphicsItem() override;
0026 
0027     void setWidget( QWidget *widget );
0028     QWidget *widget() const;
0029 
0030  protected:
0031     /**
0032      * Paints the item in item coordinates.
0033      */
0034     void paint( QPainter *painter ) override;
0035 
0036     bool eventFilter( QObject *, QEvent * ) override;
0037 
0038  private:
0039     Q_DISABLE_COPY( WidgetGraphicsItem )
0040     Q_DECLARE_PRIVATE(WidgetGraphicsItem)
0041 };
0042 
0043 } // Namespace Marble
0044 
0045 #endif