本文整理汇总了C++中Viewport::GetViewportSize方法的典型用法代码示例。如果您正苦于以下问题:C++ Viewport::GetViewportSize方法的具体用法?C++ Viewport::GetViewportSize怎么用?C++ Viewport::GetViewportSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Viewport
的用法示例。
在下文中一共展示了Viewport::GetViewportSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawTool
void RotateLayerTool::DrawTool(QPaintDevicePtr dc)
{
QWidget* main_win = GetMapViewer()->GetWidget();
Viewport view = GetMapViewer()->GetViewport();
QSize size = view.GetViewportSize();
RebuildLayer(dc);
QPainter painter(dc.get());
painter.save();
painter.translate(size.width() / 2, size.height() / 2);
painter.rotate(rotate_deg);
painter.translate(-size.width() / 2, -size.height() / 2);
painter.drawPixmap(0, 0, *(QPixmap*)rotate_layer.get());
painter.restore();
for (int row = 0; row < size.width(); row += 60)
for (int col = 0; col < size.height(); col += 60) {
painter.drawLine(QPoint(0, col), QPoint(size.width(), col));
painter.drawLine(QPoint(row, 0), QPoint(row, size.height()));
}
painter.setPen(QPen(QBrush(Qt::red), 3));
painter.drawLine(QPoint(0, size.height() / 2), QPoint(size.width(), size.height() / 2));
painter.drawLine(QPoint(size.width() / 2, 0), QPoint(size.width() / 2, size.height()));
MapTool::DrawTool(dc);
}