From 3d7430106b28d88c1cdaa9e94b152b6ab7de14f7 Mon Sep 17 00:00:00 2001 From: feiyangqingyun Date: Tue, 30 Jun 2020 17:53:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0painterpath=E5=A4=B4=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=BC=95=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qwtdemo/qwt/qwt_compass_rose.cpp | 5 +++-- qwtdemo/qwt/qwt_graphic.h | 3 ++- qwtdemo/qwt/qwt_null_paintdevice.h | 3 ++- qwtdemo/qwt/qwt_painter.cpp | 3 ++- qwtdemo/qwt/qwt_painter_command.cpp | 3 ++- qwtdemo/qwt/qwt_plot_panner.cpp | 3 ++- qwtdemo/qwt/qwt_plot_renderer.cpp | 3 ++- qwtdemo/qwt/qwt_symbol.h | 4 ++-- qwtdemo/qwt/qwt_widget_overlay.cpp | 3 ++- videowidget/videowidget.cpp | 1 + 10 files changed, 20 insertions(+), 11 deletions(-) diff --git a/qwtdemo/qwt/qwt_compass_rose.cpp b/qwtdemo/qwt/qwt_compass_rose.cpp index 21a35f2..03e4365 100644 --- a/qwtdemo/qwt/qwt_compass_rose.cpp +++ b/qwtdemo/qwt/qwt_compass_rose.cpp @@ -1,4 +1,4 @@ -/* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** +/* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** * Qwt Widget Library * Copyright (C) 1997 Josef Wilgen * Copyright (C) 2002 Uwe Rathmann @@ -10,7 +10,8 @@ #include "qwt_compass_rose.h" #include "qwt_point_polar.h" #include "qwt_painter.h" -#include +#include "qpainter.h" +#include "qpainterpath.h" static QPointF qwtIntersection( QPointF p11, QPointF p12, QPointF p21, QPointF p22 ) diff --git a/qwtdemo/qwt/qwt_graphic.h b/qwtdemo/qwt/qwt_graphic.h index e1a08eb..744ccb7 100644 --- a/qwtdemo/qwt/qwt_graphic.h +++ b/qwtdemo/qwt/qwt_graphic.h @@ -1,4 +1,4 @@ -/* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** +/* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** * Qwt Widget Library * Copyright (C) 1997 Josef Wilgen * Copyright (C) 2002 Uwe Rathmann @@ -15,6 +15,7 @@ #include #include #include +#include "qpainterpath.h" class QwtPainterCommand; diff --git a/qwtdemo/qwt/qwt_null_paintdevice.h b/qwtdemo/qwt/qwt_null_paintdevice.h index d7f03be..320e619 100644 --- a/qwtdemo/qwt/qwt_null_paintdevice.h +++ b/qwtdemo/qwt/qwt_null_paintdevice.h @@ -1,4 +1,4 @@ -/* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** +/* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** * Qwt Widget Library * Copyright (C) 1997 Josef Wilgen * Copyright (C) 2002 Uwe Rathmann @@ -13,6 +13,7 @@ #include "qwt_global.h" #include #include +#include "qpainterpath.h" /*! \brief A null paint device doing nothing diff --git a/qwtdemo/qwt/qwt_painter.cpp b/qwtdemo/qwt/qwt_painter.cpp index 55171db..8cd3e2d 100644 --- a/qwtdemo/qwt/qwt_painter.cpp +++ b/qwtdemo/qwt/qwt_painter.cpp @@ -1,4 +1,4 @@ -/* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** +/* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** * Qwt Widget Library * Copyright (C) 1997 Josef Wilgen * Copyright (C) 2002 Uwe Rathmann @@ -27,6 +27,7 @@ #include #include #include +#include "qpainterpath.h" #if QT_VERSION >= 0x050000 #include diff --git a/qwtdemo/qwt/qwt_painter_command.cpp b/qwtdemo/qwt/qwt_painter_command.cpp index f6affae..71afb63 100644 --- a/qwtdemo/qwt/qwt_painter_command.cpp +++ b/qwtdemo/qwt/qwt_painter_command.cpp @@ -1,4 +1,4 @@ -/* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** +/* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** * Qwt Widget Library * Copyright (C) 1997 Josef Wilgen * Copyright (C) 2002 Uwe Rathmann @@ -8,6 +8,7 @@ *****************************************************************************/ #include "qwt_painter_command.h" +#include "qpainterpath.h" //! Construct an invalid command QwtPainterCommand::QwtPainterCommand(): diff --git a/qwtdemo/qwt/qwt_plot_panner.cpp b/qwtdemo/qwt/qwt_plot_panner.cpp index 62a75a2..2c5cbc6 100644 --- a/qwtdemo/qwt/qwt_plot_panner.cpp +++ b/qwtdemo/qwt/qwt_plot_panner.cpp @@ -1,4 +1,4 @@ -/* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** +/* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** * Qwt Widget Library * Copyright (C) 1997 Josef Wilgen * Copyright (C) 2002 Uwe Rathmann @@ -14,6 +14,7 @@ #include #include #include +#include "qpainterpath.h" static QBitmap qwtBorderMask( const QWidget *canvas, const QSize &size ) { diff --git a/qwtdemo/qwt/qwt_plot_renderer.cpp b/qwtdemo/qwt/qwt_plot_renderer.cpp index 3416f98..0f72ab6 100644 --- a/qwtdemo/qwt/qwt_plot_renderer.cpp +++ b/qwtdemo/qwt/qwt_plot_renderer.cpp @@ -1,4 +1,4 @@ -/* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** +/* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** * Qwt Widget Library * Copyright (C) 1997 Josef Wilgen * Copyright (C) 2002 Uwe Rathmann @@ -18,6 +18,7 @@ #include "qwt_text_label.h" #include "qwt_math.h" #include +#include "qpainterpath.h" #include #include #include diff --git a/qwtdemo/qwt/qwt_symbol.h b/qwtdemo/qwt/qwt_symbol.h index ea16d88..81f16e0 100644 --- a/qwtdemo/qwt/qwt_symbol.h +++ b/qwtdemo/qwt/qwt_symbol.h @@ -1,4 +1,4 @@ -/* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** +/* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** * Qwt Widget Library * Copyright (C) 1997 Josef Wilgen * Copyright (C) 2002 Uwe Rathmann @@ -12,6 +12,7 @@ #include "qwt_global.h" #include +#include "qpainterpath.h" class QPainter; class QRect; @@ -21,7 +22,6 @@ class QPen; class QColor; class QPointF; class QPolygonF; -class QPainterPath; class QPixmap; class QByteArray; class QwtGraphic; diff --git a/qwtdemo/qwt/qwt_widget_overlay.cpp b/qwtdemo/qwt/qwt_widget_overlay.cpp index d2b4220..c7a41e4 100644 --- a/qwtdemo/qwt/qwt_widget_overlay.cpp +++ b/qwtdemo/qwt/qwt_widget_overlay.cpp @@ -1,4 +1,4 @@ -/* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** +/* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** * Qwt Widget Library * Copyright (C) 1997 Josef Wilgen * Copyright (C) 2002 Uwe Rathmann @@ -13,6 +13,7 @@ #include #include #include +#include "qpainterpath.h" static QImage::Format qwtMaskImageFormat() { diff --git a/videowidget/videowidget.cpp b/videowidget/videowidget.cpp index 43e99f5..44d8123 100644 --- a/videowidget/videowidget.cpp +++ b/videowidget/videowidget.cpp @@ -276,6 +276,7 @@ void VideoWidget::drawBg(QPainter *painter) //背景图片为空则绘制文字,否则绘制背景图片 if (bgImage.isNull()) { + painter->setFont(this->font()); painter->setPen(palette().foreground().color()); painter->drawText(rect(), Qt::AlignCenter, bgText); } else {