sortBar = new THBlackBar(this);
mostRelevantAction = new QAction(tr("Most relevant"), this);
- mostRelevantAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_1));
+ QKeySequence keySequence(Qt::CTRL + Qt::Key_1);
+ mostRelevantAction->setShortcut(keySequence);
+ mostRelevantAction->setStatusTip(keySequence.toString());
addAction(mostRelevantAction);
connect(mostRelevantAction, SIGNAL(triggered()), this, SLOT(searchMostRelevant()), Qt::QueuedConnection);
sortBar->addAction(mostRelevantAction);
mostRecentAction = new QAction(tr("Most recent"), this);
- mostRecentAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_2));
+ keySequence = QKeySequence(Qt::CTRL + Qt::Key_2);
+ mostRecentAction->setShortcut(keySequence);
+ mostRecentAction->setStatusTip(keySequence.toString());
addAction(mostRecentAction);
connect(mostRecentAction, SIGNAL(triggered()), this, SLOT(searchMostRecent()), Qt::QueuedConnection);
sortBar->addAction(mostRecentAction);
mostViewedAction = new QAction(tr("Most viewed"), this);
- mostViewedAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_3));
+ keySequence = QKeySequence(Qt::CTRL + Qt::Key_3);
+ mostViewedAction->setShortcut(keySequence);
+ mostViewedAction->setStatusTip(keySequence.toString());
addAction(mostViewedAction);
connect(mostViewedAction, SIGNAL(triggered()), this, SLOT(searchMostViewed()), Qt::QueuedConnection);
sortBar->addAction(mostViewedAction);
#include <QPainter>
#include <QPaintEvent>
#include <QList>
+#include <QtGui>
#include "thblackbar.h"
* PUBLIC Constructor/Destructors
*/
THBlackBar::THBlackBar (QWidget *parent)
- : QWidget(parent), d(new THBlackBar::Private)
+ : QWidget(parent), d(new THBlackBar::Private)
{
// Setup Widget Options
setMouseTracking(true);
d->hoveredAction = action;
action->hover();
update();
+
+ // status tip
+ QMainWindow* mainWindow = dynamic_cast<QMainWindow*>(qApp->topLevelWidgets().first());
+ if (mainWindow) mainWindow->statusBar()->showMessage(action->statusTip());
}
}