zoukankan      html  css  js  c++  java
  • 2d graphics GIS

    QPainter can draw
    geometric shapes (points, lines, rectangles, ellipses, arcs, chords, pie segments,
    polygons, and Bézier curves), as well as pixmaps, images, and text. Furthermore,
    QPainter supports advanced features such as antialiasing (for text and
    shape edges), alpha blending, gradient filling, and vector paths. QPainter also
    supports linear transformations, such as translation, rotation, shearing, and
    scaling.

    By reimplementing QWidget::paintEvent(), we can create custom widgets andexercise complete control over their appearance, as we saw in Chapter 5.

    Forcustomizing the look and feel of predefined Qt widgets, we can also specify astyle sheet or create a QStyle subclass; we cover both of these approaches in

    使用QPainter 画graphics 必须给他一个a paint device (typically a widget),

    void MyWidget::paintEvent(QPaintEvent *event)
    {
    QPainter painter(this); //THIS IS  A widget
    ...
    }

    QPainter painter(this);
    painter.setRenderHint(QPainter::Antialiasing, true);
    painter.setPen(QPen(Qt::black, 12, Qt::DashDotLine, Qt::RoundCap));
    painter.setBrush(QBrush(Qt::green, Qt::SolidPattern));
    painter.drawEllipse(80, 80, 400, 240);

  • 相关阅读:
    个人介绍
    实验三
    第二次实验
    实验一
    ATM管理系统
    第二次作业
    实验四 决策树算法及应用
    实验三 朴素贝叶斯算法及应用
    实验二 K-近邻算法及应用
    实验一 感知器及其应用
  • 原文地址:https://www.cnblogs.com/gisbeginner/p/2800936.html
Copyright © 2011-2022 走看看