made help browser close on click

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6637 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2013-08-28 20:14:37 +00:00
parent dbb8e4980e
commit c3af05b0bf

View File

@ -9,6 +9,23 @@ MainPage::MainPage(QWidget *parent , Qt::WindowFlags flags ) : QWidget(parent, f
help_browser = NULL ;
}
class MyTextBrowser: public QTextBrowser
{
public:
MyTextBrowser(QWidget *parent,QPushButton *bt)
: QTextBrowser(parent),button(bt)
{
}
virtual void mousePressEvent ( QMouseEvent * e )
{
hide() ;
button->setChecked(false) ;
}
protected:
QPushButton *button ;
};
void MainPage::showHelp(bool b)
{
@ -27,7 +44,7 @@ void MainPage::registerHelpButton(QPushButton *button,const QString& help_html_t
{
if(help_browser == NULL)
{
help_browser = new QTextBrowser(this) ;
help_browser = new MyTextBrowser(this,button) ;
QGraphicsDropShadowEffect * effect = new QGraphicsDropShadowEffect(help_browser) ;
effect->setBlurRadius(30.0);