// Load help text QString helpUrl; // Help file address if(QFile::exists(qApp->applicationDirPath() + "/LevitationBreathTechnic.htm")) helpUrl = qApp->applicationDirPath() + "/LevitationBreathTechnic.htm"; else helpUrl = qApp->applicationDirPath() + "/../LevitationBreathTechnic.htm"; ui->textBrowser->setSource("file:///" + helpUrl);
// Setup sound player and outputBreathWindow::BreathWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::BreathWindow){ isSoundAvailable = true; // QSound::isAvailable(); sound = new Phonon::MediaObject(this); audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this); Phonon::createPath(sound, audioOutput);}void BreathWindow::play(QString sourceFile){ if(sound->state() == Phonon::PlayingState) sound->stop(); sound->setCurrentSource(Phonon::MediaSource(sourceFile)); sound->play();}
C++ (Qt)ui->textBrowser->setSource( QUrl::fromLocalFile( helpUrl ) );
ui->textBrowser->setSource("file:///" + helpUrl);
ui->textBrowser->setSource("file://" + helpUrl);
// Load help text QString helpUrl; // Help file address if(QFile::exists(qApp->applicationDirPath() + "/LevitationBreathTechnic.htm")) helpUrl = qApp->applicationDirPath() + "/LevitationBreathTechnic.htm"; else helpUrl = qApp->applicationDirPath() + "/../LevitationBreathTechnic.htm";#ifdef Q_WS_WIN ui->textBrowser->setSource("file:///" + helpUrl);#endif#ifdef Q_WS_X11 ui->textBrowser->setSource("file://" + helpUrl);#endif
ui->textBrowser->setSource(QUrl::fromLocalFile(helpUrl)); std::cout << QUrl::fromLocalFile(helpUrl).toString().toStdString() << std::endl;
helpUrl = qApp->applicationDirPath() + "/../LevitationBreathTechnic.htm";
helpUrl = qApp->applicationDirPath() + "/LevitationBreathTechnic.htm
QUrl url("file://"+qApp->applicationDirPath()+"/test.sh");
QUrl url("file:///"+qApp->applicationDirPath()+"/test.sh");