diff --git a/src/Gui/CommandDoc.cpp b/src/Gui/CommandDoc.cpp index 5586fff6f..f285c2ee7 100644 --- a/src/Gui/CommandDoc.cpp +++ b/src/Gui/CommandDoc.cpp @@ -615,7 +615,7 @@ StdCmdPrint::StdCmdPrint() void StdCmdPrint::activated(int iMsg) { if (getMainWindow()->activeWindow()) { - getMainWindow()->statusBar()->showMessage(QObject::tr("Printing...")); + getMainWindow()->showMessage(QObject::tr("Printing...")); getMainWindow()->activeWindow()->print(); } } @@ -670,7 +670,7 @@ StdCmdPrintPdf::StdCmdPrintPdf() void StdCmdPrintPdf::activated(int iMsg) { if (getMainWindow()->activeWindow()) { - getMainWindow()->statusBar()->showMessage(QObject::tr("Exporting PDF...")); + getMainWindow()->showMessage(QObject::tr("Exporting PDF...")); getMainWindow()->activeWindow()->printPdf(); } } diff --git a/src/Gui/Document.cpp b/src/Gui/Document.cpp index 512f39186..1f629b2ab 100644 --- a/src/Gui/Document.cpp +++ b/src/Gui/Document.cpp @@ -508,7 +508,7 @@ bool Document::save(void) /// Save the document under a new file name bool Document::saveAs(void) { - getMainWindow()->statusBar()->showMessage(QObject::tr("Save document under new filename...")); + getMainWindow()->showMessage(QObject::tr("Save document under new filename...")); QString exe = qApp->applicationName(); QString fn = QFileDialog::getSaveFileName(getMainWindow(), QObject::tr("Save %1 Document").arg(exe), @@ -554,7 +554,7 @@ bool Document::saveAs(void) return true; } else { - getMainWindow()->statusBar()->showMessage(QObject::tr("Saving aborted"), 2000); + getMainWindow()->showMessage(QObject::tr("Saving aborted"), 2000); return false; } } diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp index cccdf146b..e1cc361a1 100644 --- a/src/Gui/MainWindow.cpp +++ b/src/Gui/MainWindow.cpp @@ -734,7 +734,7 @@ void MainWindow::addWindow(MDIView* view) #endif #endif connect(view, SIGNAL(message(const QString&, int)), - statusBar(), SLOT(showMessage(const QString&, int))); + this, SLOT(showMessage(const QString&, int))); connect(this, SIGNAL(windowStateChanged(MDIView*)), view, SLOT(windowStateChanged(MDIView*))); @@ -799,7 +799,7 @@ void MainWindow::removeWindow(Gui::MDIView* view) { // free all connections disconnect(view, SIGNAL(message(const QString&, int)), - statusBar(), SLOT(message(const QString&, int ))); + this, SLOT(showMessage(const QString&, int ))); disconnect(this, SIGNAL(windowStateChanged(MDIView*)), view, SLOT(windowStateChanged(MDIView*))); view->removeEventFilter(this); @@ -1552,7 +1552,16 @@ void MainWindow::showMessage (const QString& message, int timeout) { QFontMetrics fm(statusBar()->font()); QString msg = fm.elidedText(message, Qt::ElideMiddle, this->width()/2); +#if QT_VERSION != 0x040801 this->statusBar()->showMessage(msg, timeout); +#else + //#0000665: There is a crash under Ubuntu 12.04 (Qt 4.8.1) + QMetaObject::invokeMethod(statusBar(), "showMessage", + Qt::QueuedConnection, + QGenericReturnArgument(), + Q_ARG(QString,msg), + Q_ARG(int, timeout)); +#endif } // ------------------------------------------------------------- diff --git a/src/Gui/ManualAlignment.cpp b/src/Gui/ManualAlignment.cpp index d220922fa..0256a0279 100644 --- a/src/Gui/ManualAlignment.cpp +++ b/src/Gui/ManualAlignment.cpp @@ -778,7 +778,7 @@ void ManualAlignment::continueAlignment() grp.addToViewer(myViewer->getViewer(0)); grp.setAlignable(true); - Gui::getMainWindow()->statusBar()->showMessage(tr("Please pick points in the left and right view")); + Gui::getMainWindow()->showMessage(tr("Please pick points in the left and right view")); myViewer->getViewer(0)->setEditingCursor(QCursor(Qt::PointingHandCursor)); myViewer->getViewer(1)->setEditingCursor(QCursor(Qt::PointingHandCursor)); @@ -838,7 +838,7 @@ void ManualAlignment::finish() closeViewer(); reset(); - Gui::getMainWindow()->statusBar()->showMessage(tr("The alignment has finished")); + Gui::getMainWindow()->showMessage(tr("The alignment has finished")); // If an event receiver has been defined send the manual alignment finished event to it emitFinished(); @@ -856,7 +856,7 @@ void ManualAlignment::cancel() myTransform = Base::Placement(); reset(); - Gui::getMainWindow()->statusBar()->showMessage(tr("The alignment has been canceled")); + Gui::getMainWindow()->showMessage(tr("The alignment has been canceled")); // If an event receiver has been defined send the manual alignment cancelled event to it emitCanceled(); @@ -888,7 +888,7 @@ void ManualAlignment::align() myAlignModel.activeGroup().removeFromViewer(myViewer->getViewer(0)); myAlignModel.activeGroup().setAlignable(false); std::vector pViews = myAlignModel.activeGroup().getViews(); - Gui::getMainWindow()->statusBar()->showMessage(tr("Try to align group of views")); + Gui::getMainWindow()->showMessage(tr("Try to align group of views")); // Compute alignment bool ok = computeAlignment(myAlignModel.activeGroup().getPoints(), myFixedGroup.getPoints()); @@ -928,17 +928,17 @@ void ManualAlignment::showInstructions() { // Now we can start the actual alignment if (myAlignModel.activeGroup().countPoints() < myPickPoints) { - Gui::getMainWindow()->statusBar()->showMessage( + Gui::getMainWindow()->showMessage( tr("Too few points picked in the left view." " At least %1 points are needed.").arg(myPickPoints)); } else if (myFixedGroup.countPoints() < myPickPoints) { - Gui::getMainWindow()->statusBar()->showMessage( + Gui::getMainWindow()->showMessage( tr("Too few points picked in the right view." " At least %1 points are needed.").arg(myPickPoints)); } else if (myAlignModel.activeGroup().countPoints() != myFixedGroup.countPoints()) { - Gui::getMainWindow()->statusBar()->showMessage( + Gui::getMainWindow()->showMessage( tr("Different number of points picked in left and right view. " "On the left view %1 points are picked, " "on the right view %2 points are picked.") @@ -1146,13 +1146,13 @@ void ManualAlignment::probePickedCallback(void * ud, SoEventCallback * n) self->applyPickedProbe(that, point); const SbVec3f& vec = point->getPoint(); - Gui::getMainWindow()->statusBar()->showMessage( + Gui::getMainWindow()->showMessage( tr("Point picked at (%1,%2,%3)") .arg(vec[0]).arg(vec[1]).arg(vec[2])); } } else { - Gui::getMainWindow()->statusBar()->showMessage( + Gui::getMainWindow()->showMessage( tr("No point was picked")); } } diff --git a/src/Gui/ProgressBar.cpp b/src/Gui/ProgressBar.cpp index 129860a4a..5fd5be65b 100644 --- a/src/Gui/ProgressBar.cpp +++ b/src/Gui/ProgressBar.cpp @@ -252,7 +252,7 @@ void Sequencer::showRemainingTime() Q_ARG(QString,status)); } else { - getMainWindow()->statusBar()->showMessage(status); + getMainWindow()->showMessage(status); } } } @@ -285,7 +285,7 @@ void Sequencer::resetData() d->waitCursor = 0; d->bar->leaveControlEvents(); getMainWindow()->setPaneText(1, QString()); - getMainWindow()->statusBar()->showMessage(QString()); + getMainWindow()->showMessage(QString()); } SequencerBase::resetData(); @@ -313,7 +313,7 @@ void Sequencer::setText (const char* pszTxt) Q_ARG(QString,d->text)); } else { - getMainWindow()->statusBar()->showMessage(d->text); + getMainWindow()->showMessage(d->text); } } diff --git a/src/Gui/SoFCSelection.cpp b/src/Gui/SoFCSelection.cpp index c34b52b08..f3362d4c2 100644 --- a/src/Gui/SoFCSelection.cpp +++ b/src/Gui/SoFCSelection.cpp @@ -568,7 +568,7 @@ SoFCSelection::handleEvent(SoHandleEventAction * action) ,pp->getPoint()[1] ,pp->getPoint()[2]); - getMainWindow()->statusBar()->showMessage(QString::fromAscii(buf),3000); + getMainWindow()->showMessage(QString::fromAscii(buf),3000); } } } @@ -602,7 +602,7 @@ SoFCSelection::handleEvent(SoHandleEventAction * action) ,pp->getPoint()[1] ,pp->getPoint()[2]); - getMainWindow()->statusBar()->showMessage(QString::fromAscii(buf),3000); + getMainWindow()->showMessage(QString::fromAscii(buf),3000); } } diff --git a/src/Gui/Tree.cpp b/src/Gui/Tree.cpp index 48d27f325..bca4d8e2b 100644 --- a/src/Gui/Tree.cpp +++ b/src/Gui/Tree.cpp @@ -1201,7 +1201,7 @@ void DocumentObjectItem::displayStatusInfo() QString info = QString::fromAscii(Obj->getStatusString()); if ( Obj->mustExecute() == 1 ) info += QString::fromAscii(" (but must be executed)"); - getMainWindow()->statusBar()->showMessage( info ); + getMainWindow()->showMessage( info ); } diff --git a/src/Gui/View3DInventorViewer.cpp b/src/Gui/View3DInventorViewer.cpp index 7c61cfc01..47f3b9991 100644 --- a/src/Gui/View3DInventorViewer.cpp +++ b/src/Gui/View3DInventorViewer.cpp @@ -2081,7 +2081,7 @@ SoPath * View3DInventorViewer::pickFilterCB(void *viewer, const SoPickedPoint * ,pp->getPoint()[1] ,pp->getPoint()[2]); - getMainWindow()->statusBar()->showMessage(QString::fromAscii(buf),3000); + getMainWindow()->showMessage(QString::fromAscii(buf),3000); } return pp->getPath(); } diff --git a/src/Mod/Web/Gui/BrowserView.cpp b/src/Mod/Web/Gui/BrowserView.cpp index 04739a351..5e53f872d 100644 --- a/src/Mod/Web/Gui/BrowserView.cpp +++ b/src/Mod/Web/Gui/BrowserView.cpp @@ -232,7 +232,7 @@ void BrowserView::onLoadStarted() QProgressBar* bar = Gui::Sequencer::instance()->getProgressBar(); bar->setRange(0, 100); bar->show(); - Gui::getMainWindow()->statusBar()->showMessage(tr("Loading %1...").arg(view->url().toString())); + Gui::getMainWindow()->showMessage(tr("Loading %1...").arg(view->url().toString())); isLoading = true; } @@ -248,7 +248,7 @@ void BrowserView::onLoadFinished(bool ok) QProgressBar* bar = Sequencer::instance()->getProgressBar(); bar->setValue(100); bar->hide(); - getMainWindow()->statusBar()->showMessage(QString()); + getMainWindow()->showMessage(QString()); } isLoading = false; }