void MainWindow::createStatusBar()
{
locationLabel = new QLabel(" W999 ");//以文字" W999 " 建立 一个新的QLabel的对象
locationLabel->setAlignment(Qt::AlignHCenter);//文字对齐方式为中间对齐
locationLabel->setMinimumSize(locationLabel->sizeHint());
//设置这个Label的最小大小为当前最适合的大小。即Label的最小面积就是现在的大小了
formulaLabel = new QLabel;
formulaLabel->setIndent(3);
//设置自动缩进
statusBar()->addWidget(locationLabel);
statusBar()->addWidget(formulaLabel, 1);
//第二个参数是设置 窗体 伸张系数的,默认为0.
connect(spreadsheet, SIGNAL(currentCellChanged(int, int, int, int)),
this, SLOT(updateStatusBar()));
connect(spreadsheet, SIGNAL(modified()),
this, SLOT(spreadsheetModified()));
updateStatusBar();
}