#include "designerView.h"

DesignerView::DesignerView(QWidget *parent)
    : QGraphicsView(parent)
{
    initialize();
}
DesignerView::~DesignerView()
{

}

void DesignerView::initialize()
{
    //去掉QGraphicsView自带滚动条
    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    //设置背景
    setStyleSheet("background-image: url(:/images/checkerboard.png);\
                  padding: 0px; \
                  border: 0px;");
    //打开反锯齿
    setRenderHint(QPainter::Antialiasing);
    setMouseTracking(true);
    //setDragMode(QGraphicsView::RubberBandDrag); //将控制交给selector

    centerOn(0, 0);
}
