From: Brandon King Date: Tue, 28 Feb 2006 00:27:37 +0000 (+0000) Subject: Added WhatsThis feature to Mussa. X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=mussa.git;a=commitdiff_plain;h=92405a59809ece2b2f67ecd9295556271e78e9f5 Added WhatsThis feature to Mussa. To use this feature, take any QWidget inherited object and call: widget->setWhatsThis(tr("Long description")); That's it! --- diff --git a/qui/PathWindow.cxx b/qui/PathWindow.cxx index 477270a..488a3f9 100644 --- a/qui/PathWindow.cxx +++ b/qui/PathWindow.cxx @@ -9,6 +9,7 @@ #include #include #include +#include #include "qui/PathScene.h" #include "qui/ThresholdWidget.h" @@ -22,6 +23,10 @@ PathWindow::PathWindow(QWidget *) : setupMainMenu(); scene = new PathScene(10000, 10, this); + //This next setWhatsThis function prevents + // a segfault when using WhatsThis feature with + // opengl widget. + scene->setWhatsThis(tr("Mussa in OpenGL!")); setCentralWidget(scene); mussaViewTB = new QToolBar("Path Views"); @@ -90,9 +95,14 @@ void PathWindow::setupActions() toggleMotifsAction = new QAction(tr("Toggle Motifs"), this); connect(toggleMotifsAction, SIGNAL(triggered()), this, SLOT(toggleMotifs())); - toggleMotifsAction->setCheckable(true); toggleMotifsAction->setIcon(QIcon("icons/motif_icon.png")); + toggleMotifsAction->setWhatsThis(tr("Toggle motif annotations on/off\n\n" + "You can load motif annotations via " + "'File->Load Motif List' menu option.")); + + whatsThisAction = QWhatsThis::createAction(this); + whatsThisAction->setIcon(QIcon("icons/help.png")); } void PathWindow::setupMainMenu() @@ -116,6 +126,8 @@ void PathWindow::setupMainMenu() newMenu->addAction(showMussaViewToolbarAction); newMenu = menuBar()->addMenu(tr("&Help")); + newMenu->addAction(whatsThisAction); + newMenu->addSeparator(); newMenu->addAction(aboutAction); } diff --git a/qui/PathWindow.h b/qui/PathWindow.h index b98bb44..86d7352 100644 --- a/qui/PathWindow.h +++ b/qui/PathWindow.h @@ -56,6 +56,7 @@ protected: QAction *saveMotifListAction; QAction *showMussaViewToolbarAction; QAction *toggleMotifsAction; + QAction *whatsThisAction; //! initialze the actions void setupActions();