HelpWidget::HelpWidget(QWidget* parent) : InviwoDockWidget(tr("Help"), parent), helpBrowser_(nullptr), helpEngine_(nullptr) { setObjectName("HelpWidget"); setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); QWidget* centralWidget = new QWidget(); QVBoxLayout* vLayout = new QVBoxLayout(centralWidget); vLayout->setSpacing(7); vLayout->setContentsMargins(0, 0, 0, 0); std::string helpfile = InviwoApplication::getPtr()->getPath(InviwoApplication::PATH_HELP, "/inviwo.qhc"); helpEngine_ = new QHelpEngineCore(QString::fromStdString(helpfile), this); helpBrowser_ = new HelpBrowser(this, helpEngine_); helpBrowser_->setHtml(QString("Hello world")); vLayout->addWidget(helpBrowser_); centralWidget->setLayout(vLayout); setWidget(centralWidget); connect(helpEngine_, SIGNAL(setupFinished()), this, SLOT(setupFinished())); if (!helpEngine_->setupData()) { LogWarn("Faild to setup the help engine:" << helpEngine_->error().toUtf8().constData()); delete helpEngine_; helpEngine_ = nullptr; } }
/** * @brief Loads the setup parameters from TMDb * @see TMDb::setupFinished */ void TMDb::setup() { QUrl url(QString("http://api.themoviedb.org/3/configuration?api_key=%1").arg(TMDb::apiKey())); QNetworkRequest request(url); request.setRawHeader("Accept", "application/json"); QNetworkReply *reply = qnam()->get(request); connect(reply, SIGNAL(finished()), this, SLOT(setupFinished())); }
QHelpEngineWrapper::QHelpEngineWrapper(const QString &collectionFile) : QHelpEngine(collectionFile) { /* * Otherwise we will waste time if several new docs are found, * because we will start to index them, only to be interrupted * by the next request. Also, there is a nasty SQLITE bug that will * cause the application to hang for minutes in that case. * This call is reverted by initalDocSetupDone(), which must be * called after the new docs have been installed. */ disconnect(this, SIGNAL(setupFinished()), searchEngine(), SLOT(indexDocumentation())); }
void QHelpEnginePrivate::init(const QString &collectionFile, QHelpEngineCore *helpEngineCore) { QHelpEngineCorePrivate::init(collectionFile, helpEngineCore); contentModel = new QHelpContentModel(this); indexModel = new QHelpIndexModel(this); connect(helpEngineCore, SIGNAL(setupFinished()), this, SLOT(applyCurrentFilter())); connect(helpEngineCore, SIGNAL(currentFilterChanged(QString)), this, SLOT(applyCurrentFilter())); }
EAyuda::EAyuda(QWidget* parent, Qt::WFlags fl) : QWidget( parent, fl ), Ui::EAyudaBase() { setupUi(this); qDebug( QString( "Cargando Documentacion desde: %1").arg(QApplication::applicationDirPath() + QDir::separator() + "documentacion.qch").toLocal8Bit()); engine = new QHelpEngine( QApplication::applicationDirPath() + QDir::separator() + "documentacion.qch", parent ); connect( engine, SIGNAL( setupStarted() ), this, SLOT( inicioConstruccion() ) ); connect( engine, SIGNAL( setupFinished() ), this, SLOT( finConstruccion() ) ); if( !engine->setupData() ) { qWarning( QString( "Error al cargar la documentacion: %1" ).arg( engine->error() ).toLocal8Bit().constData() ); return; } else { qDebug( QString( "Documentacion cargada desde %1. OK!" ).arg( engine->collectionFile() ).toLocal8Bit() ); } connect( engine, SIGNAL( warning( const QString & ) ), this, SLOT( errorEngine( const QString & ) ) ); PBCerrar->setIcon( QIcon( ":/imagenes/fileclose.png" ) ); this->setVisible(false); connect( PBCerrar, SIGNAL( clicked() ), this, SLOT( hide() ) ); this->setWindowTitle( "Ayuda" ); }
void QHelpEngineWrapper::initialDocSetupDone() { connect(this, SIGNAL(setupFinished()), searchEngine(), SLOT(indexDocumentation())); setupData(); }
void OgreWidget::initializeOgre() { mOgreRoot = new Ogre::Root; Ogre::RenderSystem *renderSystem = mOgreRoot->getRenderSystemByName("OpenGL Rendering Subsystem"); mOgreRoot->setRenderSystem(renderSystem); mOgreRoot->initialise(false); Ogre::NameValuePairList viewConfig; QWidget *parentWidget = dynamic_cast <QWidget *>(parent()); Ogre::String windowHandle = Ogre::StringConverter::toString ((unsigned long)QX11Info::display()) + ":" + Ogre::StringConverter::toString ((unsigned int)QX11Info::appScreen()) + ":" + Ogre::StringConverter::toString ((unsigned long)parentWidget->winId()); qDebug() << __PRETTY_FUNCTION__ << "using window handle" << QString::fromStdString(windowHandle); viewConfig["parentWindowHandle"] = windowHandle; viewConfig["vsync"] = "true"; // this actually works on linux/nvidia-blob/thinkpad! mOgreRenderWindow = mOgreRoot->createRenderWindow("OgreRenderWindow", width(), height(), false, &viewConfig); mOgreRenderWindow->setActive(true); Ogre::SceneManagerEnumerator::MetaDataIterator iter = Ogre::SceneManagerEnumerator::getSingleton().getMetaDataIterator(); while( iter.hasMoreElements() ) { Ogre::String st = iter.getNext()->typeName; qDebug() << "Scene manager type available:" << QString::fromStdString(st); } mSceneManager = mOgreRoot->createSceneManager(Ogre::ST_GENERIC); // ogreSceneManager = ogreRoot->createSceneManager("TerrainSceneManager"/*Ogre::ST_EXTERIOR_CLOSE*/); // ogreSceneManager->showBoundingBoxes(true); // By default, entities cannot be found using a RSQ. This is to make sure that the // Lidar's don't catch the rotors, cameras etc. It also means we'll have to set the // flags to nonzero for any mesh that should be scannable. Ogre::MovableObject::setDefaultQueryFlags(0x00000000); mCamera = mSceneManager->createCamera("camera"); mCamera->setNearClipDistance(.1); //mCamera->setPolygonMode(Ogre::PM_WIREFRAME); /* wireframe */ mCamera->setPolygonMode(Ogre::PM_SOLID); /* solid */ mCameraNode = mSceneManager->getRootSceneNode()->createChildSceneNode("CameraNode", Ogre::Vector3(0, 12, 15)); mCameraNode->attachObject(mCamera); mCamera->lookAt(0,8,0); mOgreViewport = mOgreRenderWindow->addViewport(mCamera); mOgreViewport->setBackgroundColour(Ogre::ColourValue(0.7, 0.7, 0.7)); mCamera->setAspectRatio(Ogre::Real(width()) / Ogre::Real(height())); if(mOgreRoot->getRenderSystem()->getCapabilities()->hasCapability(Ogre::RSC_INFINITE_FAR_PLANE)) { mCamera->setFarClipDistance(0); // enable infinite far clip distance if we can } // Initialize shader generator. // Must be before resource loading in order to allow parsing extended material attributes. if(!initializeRTShaderSystem(mSceneManager)) { OGRE_EXCEPT(Ogre::Exception::ERR_FILE_NOT_FOUND, "Shader Generator Initialization failed - Core shader libs path not found", "SdkSample::_setup"); } setupTerrain(); // initialize trajectory line mTrajectoryLine = mSceneManager->createManualObject(QString("trajectoryLine_manualobject").toStdString()); Ogre::SceneNode* mTrajectoryLineNode = mSceneManager->getRootSceneNode()->createChildSceneNode("trajectoryLine_node"); Ogre::MaterialPtr trajectoryLineMaterial = Ogre::MaterialManager::getSingleton().create("trajectoryLineMaterial", "General"); trajectoryLineMaterial->setReceiveShadows(false); trajectoryLineMaterial->getTechnique(0)->setLightingEnabled(true); trajectoryLineMaterial->getTechnique(0)->getPass(0)->setDiffuse(0,0,1,0); trajectoryLineMaterial->getTechnique(0)->getPass(0)->setAmbient(0,0,1); trajectoryLineMaterial->getTechnique(0)->getPass(0)->setSelfIllumination(0,0,1); // trajectoryLineMaterial->dispose(); // dispose pointer, not the material mTrajectoryLineNode->attachObject(mTrajectoryLine); emit setupFinished(); qDebug() << __PRETTY_FUNCTION__ << "done."; }
void LobbyWidget::done() { if(path.length() > 0) { // TODO catch more emit setupFinished(new Game(path)); } }