|
@@ -263,7 +263,7 @@ ADCIntelligentVehicle::ADCIntelligentVehicle(QWidget *parent)
|
|
|
|
|
|
|
|
myview = new MyView(ui->stackedWidget->widget(1));
|
|
myview = new MyView(ui->stackedWidget->widget(1));
|
|
|
myview->setObjectName(QStringLiteral("graphicsView"));
|
|
myview->setObjectName(QStringLiteral("graphicsView"));
|
|
|
- myview->setGeometry(QRect(0, 100, 900, 900)); //从屏幕上(0,100)位置开始(即为最左上角的点),显示一个900*900的界面(宽900,高900)
|
|
|
|
|
|
|
+ myview->setGeometry(QRect(0, 100, 900, 750)); //从屏幕上(0,100)位置开始(即为最左上角的点),显示一个900*900的界面(宽900,高900)
|
|
|
|
|
|
|
|
#if 0
|
|
#if 0
|
|
|
myview_small = new MyView(ui->stackedWidget->widget(1));
|
|
myview_small = new MyView(ui->stackedWidget->widget(1));
|
|
@@ -274,17 +274,17 @@ ADCIntelligentVehicle::ADCIntelligentVehicle(QWidget *parent)
|
|
|
// myview_small->scale(0.7,0.7);
|
|
// myview_small->scale(0.7,0.7);
|
|
|
//myview_small->centerOn(-200,-200);
|
|
//myview_small->centerOn(-200,-200);
|
|
|
|
|
|
|
|
- image = new QImage(900 * 2, 900 * 2, QImage::Format_RGB32);//画布的初始化大小设为600*500,使用32位颜色
|
|
|
|
|
|
|
+ image = new QImage(900 , 750 , QImage::Format_RGB32);//画布的初始化大小设为600*500,使用32位颜色
|
|
|
//QImage的32、24、8位图。 图像格式:QImage::Format_RGB32 ,QImage::Format_RGB888,QImage::Format_Indexed8。
|
|
//QImage的32、24、8位图。 图像格式:QImage::Format_RGB32 ,QImage::Format_RGB888,QImage::Format_Indexed8。
|
|
|
//QImage myImage2 = QImage(width, height, QImage::Format_…); 根据图像宽高来构造一幅图像,程序会自动根据图像格式对齐图像数据。
|
|
//QImage myImage2 = QImage(width, height, QImage::Format_…); 根据图像宽高来构造一幅图像,程序会自动根据图像格式对齐图像数据。
|
|
|
- image_small = new QImage(1800,1800,QImage::Format_RGB32);
|
|
|
|
|
|
|
+// image_small = new QImage(,1500,QImage::Format_RGB32);
|
|
|
|
|
|
|
|
myview->setCacheMode(myview->CacheBackground);
|
|
myview->setCacheMode(myview->CacheBackground);
|
|
|
#if 0
|
|
#if 0
|
|
|
myview_small->setCacheMode(myview_small->CacheBackground);
|
|
myview_small->setCacheMode(myview_small->CacheBackground);
|
|
|
#endif
|
|
#endif
|
|
|
painter = new QPainter(image); //创建QPainter对象
|
|
painter = new QPainter(image); //创建QPainter对象
|
|
|
- painter_small = new QPainter(image_small); //创建QPainter对象
|
|
|
|
|
|
|
+// painter_small = new QPainter(image_small); //创建QPainter对象
|
|
|
scene = new QGraphicsScene;
|
|
scene = new QGraphicsScene;
|
|
|
scene_small = new QGraphicsScene;
|
|
scene_small = new QGraphicsScene;
|
|
|
timer = new QTimer(this);
|
|
timer = new QTimer(this);
|
|
@@ -1005,9 +1005,9 @@ void ADCIntelligentVehicle::closeEvent(QCloseEvent *event)
|
|
|
void MyView::wheelEvent(QWheelEvent *event)
|
|
void MyView::wheelEvent(QWheelEvent *event)
|
|
|
{
|
|
{
|
|
|
// 滚轮的滚动量
|
|
// 滚轮的滚动量
|
|
|
- QPoint scrollAmount = event->angleDelta();
|
|
|
|
|
- // 正值表示滚轮远离使用者(放大),负值表示朝向使用者(缩小)
|
|
|
|
|
- scrollAmount.y() > 0 ? zoomIn() : zoomOut();
|
|
|
|
|
|
|
+// QPoint scrollAmount = event->angleDelta();
|
|
|
|
|
+// // 正值表示滚轮远离使用者(放大),负值表示朝向使用者(缩小)
|
|
|
|
|
+// scrollAmount.y() > 0 ? zoomIn() : zoomOut();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -1050,7 +1050,7 @@ void ADCIntelligentVehicle::paintEvent(QPaintEvent *)
|
|
|
|
|
|
|
|
// image->fill(QColor(60, 60, 60));//对画布进行填充
|
|
// image->fill(QColor(60, 60, 60));//对画布进行填充
|
|
|
image->fill(QColor(220, 220, 220));//对画布进行填充
|
|
image->fill(QColor(220, 220, 220));//对画布进行填充
|
|
|
- image_small->fill(QColor(220,220,220));
|
|
|
|
|
|
|
+// image_small->fill(QColor(220,220,220));
|
|
|
std::vector<iv::GPSData> navigation_data;
|
|
std::vector<iv::GPSData> navigation_data;
|
|
|
mMutexNavi.lock();
|
|
mMutexNavi.lock();
|
|
|
navigation_data = m_navigation_data;
|
|
navigation_data = m_navigation_data;
|
|
@@ -1074,7 +1074,7 @@ void ADCIntelligentVehicle::paintEvent(QPaintEvent *)
|
|
|
|
|
|
|
|
// std::vector<iv::GPSData> navigation_data = brain->navigation_data;
|
|
// std::vector<iv::GPSData> navigation_data = brain->navigation_data;
|
|
|
painter->setRenderHint(QPainter::Antialiasing, true);//设置反锯齿模式,好看一点
|
|
painter->setRenderHint(QPainter::Antialiasing, true);//设置反锯齿模式,好看一点
|
|
|
- painter_small->setRenderHint(QPainter::Antialiasing, true);//设置反锯齿模式,好看一点
|
|
|
|
|
|
|
+// painter_small->setRenderHint(QPainter::Antialiasing, true);//设置反锯齿模式,好看一点
|
|
|
|
|
|
|
|
|
|
|
|
|
int pointx = 450, pointy = 700;//确定坐标轴起点坐标,这里定义(35,280)
|
|
int pointx = 450, pointy = 700;//确定坐标轴起点坐标,这里定义(35,280)
|