/
viktor-zin
/
afce
Обзор
Документация
Войти
/
viktor-zin
/
afce
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
thelpwindow.cpp
52 строки
2 KB
viktor-zin
Improved MacOS X support (#42)
11 окт 2014, 12:42
11 окт 2014, 12:42
5cc8b27
Код
Авторство
О чём код?
/**************************************************************************** ** ** ** Copyright (C) 2009-2014 Victor Zinkevich. All rights reserved. ** ** Contact: vicking@yandex.ru ** ** ** ** This file is part of the Algorithm Flowchart Editor project. ** ** ** ** This file may be used under the terms of the GNU ** ** General Public License versions 2.0 or 3.0 as published by the Free ** ** Software Foundation and appearing in the file LICENSE included in ** ** the packaging of this file. ** ** You can find license at http://www.gnu.org/licenses/gpl.html ** ** ** ****************************************************************************/ #include "thelpwindow.h" #include <QLocale> #include <QApplication> THelpWindow::THelpWindow() { fWidget = new QFrame(this); setWidget(fWidget); toolBar = new QToolBar; toolBar->setObjectName("help_toolbar"); textBrowser = new QTextBrowser; QVBoxLayout *vl = new QVBoxLayout; vl->addWidget(toolBar); vl->addWidget(textBrowser); widget()->setLayout(vl); textBrowser->setSearchPaths(QStringList() << qApp->applicationDirPath() + "/help/"+QLocale().name() << qApp->applicationDirPath() + "/help/en_US"); #if defined(Q_WS_X11) or defined(Q_OS_LINUX) textBrowser->setSearchPaths(QStringList() << QString(PROGRAM_DATA_DIR) + "help/"+QLocale().name() << QString(PROGRAM_DATA_DIR) + "help/en_US"); #endif home(); toolBar->addAction(QIcon(":/images/back_16_h.png"), tr("Back"), textBrowser, SLOT(backward())); toolBar->addAction(QIcon(":/images/forward_16_h.png"), tr("Forward"), textBrowser, SLOT(forward())); toolBar->addSeparator(); toolBar->addAction(QIcon(":/images/home_16_h.png"), tr("Home"), this, SLOT(home())); } void THelpWindow::hideEvent(QHideEvent *) { emit windowVisibilityChanged(); } void THelpWindow::home() { textBrowser->setSource(QUrl("index.html")); }