Commit 54c3286b authored by Matthias Möller's avatar Matthias Möller

added "whats this" hyperlink to help Browser support

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@13874 383ad7c9-94d9-4d36-a494-682f7c89f535
parent f10c573c
......@@ -606,6 +606,18 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
// Close button
connect(stereoSettingsWidget_->closeButton, SIGNAL(clicked()),
stereoSettingsWidget_, SLOT(hide()));
// ======================================================================
// Help Browser start up
// ======================================================================
if (!OpenFlipper::Options::nogui())
{
helpWidget_ = new HelpWidget(this);
connect(this, SIGNAL(changeHelpSite(QUrl)), helpWidget_, SLOT(linkActivated(QUrl)));
}
}
......@@ -1023,5 +1035,21 @@ void CoreWidget::setForceNativeCursor ( bool _state )
cursorPainter_->setForceNative (_state);
}
//-----------------------------------------------------------------------------
bool CoreWidget::event( QEvent *_event )
{
//WhatsThisClicked for hyperlinks in 'whats this' Message Boxes
if( _event->type() == QEvent::WhatsThisClicked )
{
QWhatsThisClickedEvent *wtcEvent = static_cast<QWhatsThisClickedEvent*>(_event);
QWhatsThis::hideText();
this->showHelpBrowser(wtcEvent->href());
return true;
}
return QWidget::event(_event);
}
//=============================================================================
......@@ -327,6 +327,8 @@ public:
// Filter alt key events under windows
//bool eventFilter(QObject *obj, QEvent *ev);
bool event( QEvent *event );
signals :
/** When this Signal is emitted when a Keyevent Event occures
......@@ -1028,7 +1030,10 @@ public:
public slots:
/// Display the help Browser
void showHelpBrowser();
void showHelpBrowser(const QString &page = "qthelp://org.openflipper.dev/doc/main.html");
signals:
void changeHelpSite(QUrl);
private:
/// Pointer to the help Browser
......
......@@ -57,17 +57,15 @@
//== IMPLEMENTATION ==========================================================
void CoreWidget::showHelpBrowser( ) {
void CoreWidget::showHelpBrowser(const QString &page /*= "qthelp://org.openflipper.dev/doc/main.html"*/) {
if ( OpenFlipper::Options::nogui() )
return;
if(helpWidget_ == 0)
helpWidget_ = new HelpWidget(this, "qthelp://org.openflipper.dev/doc/main.html");
emit changeHelpSite(QUrl(page));
helpWidget_->show();
helpWidget_->activateWindow();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment