本文整理汇总了C++中QScriptEngineDebugger::standardWindow方法的典型用法代码示例。如果您正苦于以下问题:C++ QScriptEngineDebugger::standardWindow方法的具体用法?C++ QScriptEngineDebugger::standardWindow怎么用?C++ QScriptEngineDebugger::standardWindow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QScriptEngineDebugger
的用法示例。
在下文中一共展示了QScriptEngineDebugger::standardWindow方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runScript
bool QtScriptEngine::runScript(const QString& script, const QString& name, RunMode mode)
{
MyQScriptEngine engine(this);
map<ADM_dynMuxer*, Muxer*> muxers;
map<ADM_videoEncoder6*, VideoEncoder*> videoEncoders;
#ifdef QT_SCRIPTTOOLS
QScriptEngineDebugger debugger;
if (mode == IScriptEngine::Debug || mode == IScriptEngine::DebugOnError)
{
debugger.attachTo(&engine);
debugger.standardWindow()->setWindowTitle(QT_TR_NOOP("Avidemux Script Debugger"));
debugger.standardWindow()->setWindowModality(Qt::ApplicationModal);
if (mode == IScriptEngine::Debug)
{
debugger.action(QScriptEngineDebugger::InterruptAction)->trigger();
}
}
#endif
this->registerAudioEncoderPlugins(&engine);
this->registerMuxerPlugins(&engine, &muxers);
this->registerVideoEncoderPlugins(&engine, &videoEncoders);
this->registerVideoFilterPlugins(&engine);
this->registerDialogClasses(&engine);
this->registerScriptClasses(&engine, &muxers, &videoEncoders);
QScriptValue result = engine.evaluate(script, name);
bool success = false;
if (engine.hasUncaughtException())
{
QString errorDetails = (QString("Unable to process script.\n\nLine number: %1\n").arg(
engine.uncaughtExceptionLineNumber()) + result.toString());
this->callEventHandlers(IScriptEngine::Error, NULL, -1, (QString("Script error ") + errorDetails).toUtf8().constData());
success = false;
}
else
{
this->callEventHandlers(IScriptEngine::Information, NULL, -1, (QString("Result: ") + result.toString()).toUtf8().constData());
success = true;
}
return success;
}
示例2: standardObjects
void tst_QScriptEngineDebugger::standardObjects()
{
#if defined(Q_OS_WINCE) && _WIN32_WCE < 0x600
QSKIP("skipped due to high mem usage until task 261062 is fixed", SkipAll);
#endif
QScriptEngine engine;
QScriptEngineDebugger debugger;
debugger.attachTo(&engine);
QMainWindow *win = debugger.standardWindow();
QCOMPARE(static_cast<QWidget *>(win->parent()), (QWidget*)0);
QMenu *menu = debugger.createStandardMenu();
QCOMPARE(static_cast<QWidget *>(menu->parent()), (QWidget*)0);
QToolBar *toolBar = debugger.createStandardToolBar();
QCOMPARE(static_cast<QWidget *>(toolBar->parent()), (QWidget*)0);
QMenu *menu2 = debugger.createStandardMenu(win);
QCOMPARE(static_cast<QWidget *>(menu2->parent()), (QWidget*)win);
QVERIFY(menu2 != menu);
QToolBar *toolBar2 = debugger.createStandardToolBar(win);
QCOMPARE(static_cast<QWidget *>(toolBar2->parent()), (QWidget*)win);
QVERIFY(toolBar2 != toolBar);
delete menu;
delete toolBar;
}
示例3: QObject
MapleManager::MapleManager(Server* server, QWidget *widget) :
QObject(server),
m_status(ConnectionStatus::WAITIGN),
m_launch_status(LaunchStatus::LAUNCHIGN),
m_socket(0),
m_relaunch(true),
r_mode(MapleManager::RESIZE_MODE::AUTO)
{
m_server = server;
m_widget = new ManagerWidget(widget);
m_widget->installEventFilter(this);
connect(m_widget,SIGNAL(save()),this,SLOT(saveSettings()));
connect(m_widget,SIGNAL(load()),this,SLOT(loadSettings()));
connect(m_widget,SIGNAL(showDBG(bool)),this,SLOT(showDBG(bool)));
connect(m_widget,SIGNAL(relaunch(bool)),this,SLOT(setRelaunch(bool)));
connect(m_widget,SIGNAL(s_changeTabName(QString)),this,SLOT(changeTabName(QString)));
m_engine = new QScriptEngine(this);
QScriptEngineDebugger *dbg = new QScriptEngineDebugger(this);
dbg->attachTo(m_engine);
m_widget->regiterDebugger((QWidget*)dbg->standardWindow());
ScriptFunctions::registerFuncions(m_engine);
m_engine->globalObject().setProperty(API::Path,qApp->applicationDirPath());
m_engine->globalObject().setProperty(API::GUI,m_engine->newQObject(m_widget));
m_engine->globalObject().setProperty(API::Socket,m_engine->newQObject(this));
}
示例4: main
int main(int argc, char **argv)
{
Q_INIT_RESOURCE(calculator);
QApplication app(argc, argv);
//! [0a]
QScriptEngine engine;
//! [0a]
#if !defined(QT_NO_SCRIPTTOOLS)
QScriptEngineDebugger debugger;
debugger.attachTo(&engine);
QMainWindow *debugWindow = debugger.standardWindow();
debugWindow->resize(1024, 640);
#endif
//! [0b]
QString scriptFileName(":/calculator.js");
QFile scriptFile(scriptFileName);
scriptFile.open(QIODevice::ReadOnly);
engine.evaluate(scriptFile.readAll(), scriptFileName);
scriptFile.close();
//! [0b]
//! [1]
QUiLoader loader;
QFile uiFile(":/calculator.ui");
uiFile.open(QIODevice::ReadOnly);
QWidget *ui = loader.load(&uiFile);
uiFile.close();
//! [1]
//! [2]
QScriptValue ctor = engine.evaluate("Calculator");
QScriptValue scriptUi = engine.newQObject(ui, QScriptEngine::ScriptOwnership);
QScriptValue calc = ctor.construct(QScriptValueList() << scriptUi);
//! [2]
#if !defined(QT_NO_SCRIPTTOOLS)
QLineEdit *display = qFindChild<QLineEdit*>(ui, "display");
QObject::connect(display, SIGNAL(returnPressed()),
debugWindow, SLOT(show()));
#endif
//! [3]
ui->show();
return app.exec();
//! [3]
}
示例5: init
void SmsScriptsManager::init()
{
#if SMS_USE_DEBUGGER
QScriptEngineDebugger *debugger = new QScriptEngineDebugger(this);
debugger->attachTo(Engine);
debugger->standardWindow()->show();
#endif
QString scriptPath = Application::instance()->pathsProvider()->profilePath() + QLatin1String("plugins/data/sms/scripts/gateway.js");
if (QFile::exists(scriptPath))
loadScript(scriptPath);
else
{
scriptPath = Application::instance()->pathsProvider()->dataPath() + QLatin1String("plugins/data/sms/scripts/gateway.js");
if (QFile::exists(scriptPath))
loadScript(scriptPath);
// TODO: maybe we should return here if no gateway.js was found?
}
// scripts from profile path can replace the ones from data path if the file name is the same
loadScripts(QDir(Application::instance()->pathsProvider()->profilePath() + QLatin1String("plugins/data/sms/scripts")));
loadScripts(QDir(Application::instance()->pathsProvider()->dataPath() + QLatin1String("plugins/data/sms/scripts")));
}