void MainWindow::createStatusBar() { locationLabel = new QLabel(" W999 "); locationLabel -> setAlignment(Qt::AlignHCenter); locationLabel -> setMinimumSize(locationLabel -> sizeHint()); formulaLabel = new QLabel; formulaLabel -> setIndent(3); formulaLabel -> setMaximumSize(formulaLabel -> sizeHint()); statusBar() -> addWidget(locationLabel); statusBar() -> addWidget(formulaLabel, 1); Spreadsheet *ss = static_cast<Spreadsheet *> (tabWidget ->currentWidget()); connect(ss, SIGNAL(currentCellChanged( int , int , int , int )) , this , SLOT(updateStatusBar())); connect(ss, SIGNAL(modified()), this , SLOT(spreadsheetModified())); //show the tabbar in the status bar // QWidget *hb = new QWidget(statusBar()); // hb->setObjectName("taskbar"); // QHBoxLayout *hbLayout = new QHBoxLayout(hb); // hbLayout->setMargin(0); // hbLayout->setObjectName("tasklayout"); // statusBar()->addWidget(hb); // //create a tabbar in the hbox // hbLayout->addWidget(mdiArea->getTabBar()); updateStatusBar(); }
int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QMainWindow::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: newFile(); break; case 1: open(); break; case 2: { bool _r = save(); if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; } break; case 3: { bool _r = saveas(); if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; } break; case 4: find(); break; case 5: goToCell(); break; case 6: sort(); break; case 7: about(); break; case 8: openRecentFile(); break; case 9: updateStatusBar(); break; case 10: spreadsheetModified(); break; default: ; } _id -= 11; } return _id; }
void MainWindow::createStatusBar() { locationLabel = new QLabel(tr("W999")); locationLabel->setAlignment(Qt::AlignHCenter); locationLabel->setMinimumSize(locationLabel->sizeHint()); formulaLabel = new QLabel; formulaLabel->setIndent(3); ui->statusBar->addWidget(locationLabel); ui->statusBar->addWidget(formulaLabel,1); connect(spreadsheet,SIGNAL(currentCellChanged(int,int,int,int)),this,SLOT(updateStatusBar())); connect(spreadsheet,SIGNAL(modified()),this,SLOT(spreadsheetModified())); updateStatusBar(); }