标签:eve class graphic image event graphics png graph ssi
测试代码:
void OsgEarthGraphicsView::resizeEvent(QResizeEvent* event) { //if (scene()) //{ // scene()->setSceneRect(QRect(QPoint(0, 0), event->size())); //} QRect rect = this->rect(); std::cout << "this->rect()" << std::endl; std::cout << rect.x() << ‘ ‘ << rect.y() << ‘ ‘ << rect.width() << ‘ ‘ << rect.height() << ‘ ‘ << std::endl; QSize thissize = this->size(); std::cout << "this->size()" << std::endl; std::cout << thissize.width() << ‘ ‘ << thissize.height() << std::endl; QSize size = event->size(); std::cout << "event->size()" << std::endl; std::cout << size.width() << ‘ ‘ << size.height() << std::endl; }
结果:
event->size()要比前两者要小一点,估计是窗口边框的缘故。感觉和文档说的并不一致。
Qt 中 this->size() this->rect() event->size() 三者差异
标签:eve class graphic image event graphics png graph ssi
原文地址:https://www.cnblogs.com/XiaoXiaoShuai-/p/12244929.html