include ( ../lib/lib.pri )
include ( ../plugins/plugins.pri )
include ( ../ananas.pri )
+QT += script
+QT += scripttools
TEMPLATE = app
DESTDIR = ../../bin
LIBS += -L../../lib -lananas4
-LIBS += -L../../lib/designer -lananasplugin4 -lqt4-qdataschema -L$(QTDIR)/lib -lqsa
+LIBS += -L../../lib/designer -lananasplugin4 -lqt4-qdataschema -L$(QTDIR)/lib
INCLUDEPATH += ../lib ../lib/tmp/ui ../lib/.ui
include (../plugins/plugins.pri)
include (../lib/lib.pri)
include (../ananas.pri)
-load(qsa)
+#load(qsa)
+QT += script
+QT += scripttools
+
TARGET = ananas4
TEMPLATE = app
if ( !initEngine() ) return false;
connect( menubar, SIGNAL(activated(int)), &engine, SLOT(on_MenuBar(int)) );
languageChange();
- engine.project.addObject(menubar);
- engine.project.addObject(this);
- engine.project.addObject(statusBar());
+// engine.project.addObject(menubar);
+// engine.project.addObject(this);
+// engine.project.addObject(statusBar());
+ engine.code->newQObject(menubar);
+ engine.code->newQObject(this);
+ engine.code->newQObject(statusBar());
+
languageChange();
engine.on_systemstart();
return true;
#define ANANASMAINFORM_H
#include <qvariant.h>
#include <qworkspace.h>
-#include <qsinterpreter.h>
+//#include <qsinterpreter.h>
#include <qdialog.h>
#include <qstringlist.h>
#include <qworkspace.h>
#include <QPixmap>
#include "acfg.h"
#include <qtabbar.h>
-#include <qsinterpreter.h>
-#include <qseditor.h>
+//#include <qsinterpreter.h>
+//#include <qseditor.h>
+#include <scriptedit.h>
/*
* Constructs a dEditAction as a child of 'parent', with the
st = md->attr ( obj, mda_type);
if ( st == "0" ) cbType->setCurrentItem( 0 );
else if ( st == "1" ) cbType->setCurrentItem( 1 );
- eModule->setText( md->sText( obj, md_sourcecode ) );
+ eModule->setPlainText( md->sText( obj, md_sourcecode ) );
active = md->findChild( obj, md_active_picture, 0 );
if ( !active.isNull() ) { // set active mode picture if exists
bRemoveActive->setEnabled( TRUE );
if ( cbType->currentItem() == 1 )
{
md->setAttr( obj, mda_type, "1" );
- md->setSText( obj, md_sourcecode, eModule->text() );
+ md->setSText( obj, md_sourcecode, eModule->toPlainText() );
}
}
{
delete statusBar();
- eModule->setInterpreter(new QSInterpreter());
+ //eModule->setInterpreter(new QSInterpreter());
// tabWidget2->page(1)->hide() ;
// tabWidget2->setTabEnabled ( tabWidget2->page(1), FALSE );
}
</property>
<layout class="QGridLayout" >
<item row="0" column="0" >
- <widget class="QSEditor" native="1" name="eModule" >
+ <widget class="ScriptEdit" native="1" name="eModule" >
<property name="enabled" >
<bool>true</bool>
</property>
<header>q3textedit.h</header>
</customwidget>
<customwidget>
- <class>QSEditor</class>
+ <class>ScriptEdit</class>
<extends>QWidget</extends>
- <header>qseditor.h</header>
+ <header>scriptedit.h</header>
</customwidget>
</customwidgets>
<includes>
<include location="local" >aliaseditor.h</include>
<include location="local" >pixmappreview.h</include>
<include location="local" >mainform.h</include>
- <include location="local" >qseditor.h</include>
+ <include location="local" >scriptedit.h</include>
</includes>
<resources/>
<connections>
#include <qpixmap.h>
#include <qstatusbar.h>
-#include <qsinterpreter.h>
-#include <qseditor.h>
+//#include <qsinterpreter.h>
+//#include <qseditor.h>
#include "acfg.h"
/*
e = md->find( obj, md_element ); // Find Element context
sv = md->find( g, md_string_view ); // Group string view
//====================================
- eStrViewFG->setText( md->sText( sv, md_svfunction ) );
+ eStrViewFG->setPlainText( md->sText( sv, md_svfunction ) );
eSvG->insertItem( "[ standart function ]" );
eSvG->insertItem( "[ user function ]" );
fid = md->sText( sv, md_fieldid ).toInt();
//====================================
sv = md->find( e, md_string_view );
- eStrViewF->setText( md->sText( sv, md_svfunction ) );
+ eStrViewF->setPlainText( md->sText( sv, md_svfunction ) );
eSv->insertItem( "[ standart function ]" );
eSv->insertItem( "[ user function ]" );
fid = md->sText( sv, md_fieldid ).toInt();
void dEditCat::init()
{
delete statusBar();
- eStrViewF->setInterpreter( new QSInterpreter() );
+// eStrViewF->setInterpreter( new QSInterpreter() );
eStrViewF->setEnabled( FALSE );
}
//======== Element view save
sv = md->find( e, md_string_view );
if ( sv.isNull() ) sv = md->insert( e, md_string_view );
- md->setSText( sv, md_svfunction, eStrViewF->text() );
+ md->setSText( sv, md_svfunction, eStrViewF->toPlainText() );
if ( eSv->currentItem() == 0 ) md->setAttr( sv, mda_stdf, "1" );
else {
md->setAttr( sv, mda_stdf, "0" );
//======== Group view save
sv = md->find( g, md_string_view );
if ( sv.isNull() ) sv = md->insert( g, md_string_view );
- md->setSText( sv, md_svfunction, eStrViewFG->text() );
+ md->setSText( sv, md_svfunction, eStrViewFG->toPlainText() );
if ( eSvG->currentItem() == 0 ) md->setAttr( sv, mda_stdf, "1" );
else {
md->setAttr( sv, mda_stdf, "0" );
</attribute>
<layout class="QGridLayout" >
<item row="1" column="0" >
- <widget class="QSEditor" native="1" name="eStrViewF" >
+ <widget class="ScriptEdit" native="1" name="eStrViewF" >
<property name="enabled" >
<bool>true</bool>
</property>
</attribute>
<layout class="QGridLayout" >
<item row="1" column="0" >
- <widget class="QSEditor" native="1" name="eStrViewFG" >
+ <widget class="ScriptEdit" native="1" name="eStrViewFG" >
<property name="enabled" >
<bool>true</bool>
</property>
<header>q3textedit.h</header>
</customwidget>
<customwidget>
- <class>QSEditor</class>
+ <class>ScriptEdit</class>
<extends>QWidget</extends>
- <header>qseditor.h</header>
+ <header>scriptedit.h</header>
</customwidget>
</customwidgets>
<includes>
<include location="local" >aliaseditor.h</include>
<include location="local" >mainform.h</include>
<include location="local" >roleeditor.h</include>
- <include location="local" >qseditor.h</include>
- <include location="local" >qseditor.h</include>
+ <include location="local" >scriptedit.h</include>
</includes>
<resources/>
<connections>
#include "acfg.h"
#include "qlayout.h"
-#include "qsproject.h"
-#include "qsscript.h"
+//#include "qsproject.h"
+//#include "qsscript.h"
//#include "qseditor.h"
-#include <qsinterpreter.h>
+//#include <qsinterpreter.h>
#include <qstatusbar.h>
#ifndef QSA_NO_IDE
-#include "qsworkbench.h"
+//#include "qsworkbench.h"
#endif
/*
// eModule=NULL;
// eModule = new QSEditor(tabWidget->page(2), "global module");
// l->addWidget(eModule, 5, 5, 0);
- eModule->setInterpreter(new QSInterpreter());
+// eModule->setInterpreter(new QSInterpreter());
}
eDate->setText( md->info( md_info_date ) );
eDescription->setText( md->info( md_info_remark ) );
globals = md->find( obj, md_globals, 0 );
- eModule->setText( md->sText( globals, md_sourcecode ) );
+ eModule->setPlainText( md->sText( globals, md_sourcecode ) );
/*
n=cfgobj_count(context, aot_remark);
if (eDBType->currentItem()==1) md->rc.setValue( "dbtype", "mysql" );
if (eDBType->currentItem()==2) md->rc.setValue( "dbtype", "postgres" );
globals = md->find( obj, md_globals, 0 );
- md->setSText( globals, md_sourcecode, eModule->text() );
+ md->setSText( globals, md_sourcecode, eModule->toPlainText() );
/*
if (cancelupdate) return;
</attribute>
<layout class="QGridLayout" >
<item row="0" column="0" >
- <widget class="QSEditor" native="1" name="eModule" />
+ <widget class="ScriptEdit" native="1" name="eModule" />
</item>
</layout>
</widget>
<header>q3textedit.h</header>
</customwidget>
<customwidget>
- <class>QSEditor</class>
+ <class>ScriptEdit</class>
<extends>QWidget</extends>
- <header>qseditor.h</header>
+ <header>scriptedit.h</header>
</customwidget>
</customwidgets>
<includes>
<include location="local" >mdtree.h</include>
<include location="local" >acfg.h</include>
- <include location="local" >qseditor.h</include>
<include location="local" >mainform.h</include>
- <include location="local" >qseditor.h</include>
+ <include location="local" >scriptedit.h</include>
</includes>
<resources/>
<connections/>
#include <qfile.h>
#include <qstatusbar.h>
#include "acfg.h"
-#include "qsproject.h"
-#include "qsscript.h"
-#include <qsinterpreter.h>
+//#include "qsproject.h"
+//#include "qsscript.h"
+//#include <qsinterpreter.h>
#include <qdialog.h>
//--#include <qwidgetfactory.h>
#include <QFormBuilder>
#include <qobject.h>
#include <q3textstream.h>
#include <qbuffer.h>
-#include <qsinterpreter.h>
-#include <qseditor.h>
+//#include <qsinterpreter.h>
+//#include <qseditor.h>
#include <q3process.h>
#include <qapplication.h>
void dEditDialog::init()
{
delete statusBar();
- eModule->setInterpreter(new QSInterpreter());
+// eModule->setInterpreter(new QSInterpreter());
// fd = new aFormDesigner();
}
al->setData();
eName->setText( md->attr( obj, mda_name ) );
eDescription->setText( md->sText( obj, md_description ) );
- eModule->setText( md->sText( obj, md_sourcecode ) );
+ eModule->setPlainText( md->sText( obj, md_sourcecode ) );
eFormFile->setText( QString("inputform_")+QString::number(item->id)+QString(".ui"));
setCaption( tr("Form:") + eName->text() );
parentClass = md->objClass( md->parent ( md->parent( obj ) ) );
md->setAttr( obj, mda_type, cbFormMode->currentItem() );
md->setAttr( obj, mda_readonly, cbReadOnly->isChecked() );
md->setSText( obj, md_description, eDescription->text() );
- md->setSText( obj, md_sourcecode, eModule->text() );
+ md->setSText( obj, md_sourcecode, eModule->toPlainText() );
// ui.arg(cbDefault->currentItem());
// md->setSText( obj, md_defaultmod, QString( "%1" ).arg( cbDefault->currentItem() ) );
int i = (1<<md_form_new) * cbNew->isChecked() + \
</attribute>
<layout class="QGridLayout" >
<item row="0" column="0" >
- <widget class="QSEditor" native="1" name="eModule" />
+ <widget class="ScriptEdit" native="1" name="eModule" />
</item>
</layout>
</widget>
<header>q3textedit.h</header>
</customwidget>
<customwidget>
- <class>QSEditor</class>
+ <class>ScriptEdit</class>
<extends>QWidget</extends>
- <header>qseditor.h</header>
+ <header>scriptedit.h</header>
</customwidget>
</customwidgets>
<includes>
<include location="local" >formdesigner.h</include>
<include location="local" >aliaseditor.h</include>
<include location="local" >mainform.h</include>
- <include location="local" >qseditor.h</include>
+ <include location="local" >scriptedit.h</include>
</includes>
<resources/>
<connections>
#include <qstatusbar.h>
#include "acfg.h"
-#include <qsinterpreter.h>
-#include <qseditor.h>
+//#include <qsinterpreter.h>
+//#include <qseditor.h>
/*
* Constructs a dEditDoc as a child of 'parent', with the
void dEditDoc::init()
{
delete statusBar();
- eModule->setInterpreter( new QSInterpreter() );
- eStrViewF->setInterpreter( new QSInterpreter() );
+// eModule->setInterpreter( new QSInterpreter() );
+// eStrViewF->setInterpreter( new QSInterpreter() );
eStrViewF->setEnabled( FALSE );
}
setCaption( tr("Document:") + md->attr( obj, mda_name ) );
eName->setText( md->attr( obj, mda_name ) );
eDescription->setText( md->sText( obj, md_description ) );
- eModule->setText( md->sText( obj, md_sourcecode ) );
+ eModule->setPlainText( md->sText( obj, md_sourcecode ) );
sv = md->find( obj, md_string_view );
- eStrViewF->setText( md->sText( sv, md_svfunction ) );
+ eStrViewF->setPlainText( md->sText( sv, md_svfunction ) );
eSv->insertItem( "[ standart function ]" );
eSv->insertItem( "[ user function ]" );
fid = md->sText( sv, md_fieldid ).toInt();
item->setText( 0, eName->text().stripWhiteSpace() );
md->setAttr( obj, mda_name, eName->text().stripWhiteSpace() );
md->setSText( obj, md_description, eDescription->text() );
- md->setSText( obj, md_sourcecode, eModule->text() );
+ md->setSText( obj, md_sourcecode, eModule->toPlainText() );
sv = md->find( obj, md_string_view );
if ( sv.isNull() ) sv = md->insert( obj, md_string_view );
- md->setSText( sv, md_svfunction, eStrViewF->text() );
+ md->setSText( sv, md_svfunction, eStrViewF->toPlainText() );
if ( eSv->currentItem() == 0 ) md->setAttr( sv, mda_stdf, "1" );
else {
md->setAttr( sv, mda_stdf, "0" );
</attribute>
<layout class="QGridLayout" >
<item row="0" column="0" >
- <widget class="QSEditor" native="1" name="eModule" />
+ <widget class="ScriptEdit" native="1" name="eModule" />
</item>
</layout>
</widget>
<widget class="QComboBox" name="eSv" />
</item>
<item row="1" column="0" >
- <widget class="QSEditor" native="1" name="eStrViewF" >
+ <widget class="ScriptEdit" native="1" name="eStrViewF" >
<property name="enabled" >
<bool>false</bool>
</property>
<header>q3textedit.h</header>
</customwidget>
<customwidget>
- <class>QSEditor</class>
+ <class>ScriptEdit</class>
<extends>QWidget</extends>
- <header>qseditor.h</header>
+ <header>scriptedit.h</header>
</customwidget>
</customwidgets>
<includes>
<include location="local" >aliaseditor.h</include>
<include location="local" >mainform.h</include>
<include location="local" >roleeditor.h</include>
- <include location="local" >qseditor.h</include>
- <include location="local" >qseditor.h</include>
+ <include location="local" >scriptedit.h</include>
</includes>
<resources/>
<connections>
<includes>
<include location="local" >acfg.h</include>
<include location="local" >mdtree.h</include>
- <include location="local" >qseditor.h</include>
+ <include location="local" >scriptedit.h</include>
<include location="local" >aliaseditor.h</include>
<include location="local" >mainform.h</include>
</includes>
#include <qstatusbar.h>
#include "acfg.h"
-#include <qsinterpreter.h>
-#include <qseditor.h>
+//#include <qsinterpreter.h>
+//#include <qseditor.h>
/*
* Constructs a dEditReport as a child of 'parent', with the
setCaption( tr("Report:") + md->attr( obj, mda_name ) );
eName->setText( md->attr( obj, mda_name ) );
eDescription->setText( md->sText( obj, md_description ) );
- eModule->setText( md->sText( obj, md_sourcecode ) );
+ eModule->setPlainText( md->sText( obj, md_sourcecode ) );
}
void dEditReport::init()
{
delete statusBar();
- eModule->setInterpreter(new QSInterpreter());
+// eModule->setInterpreter(new QSInterpreter());
}
item->setText( 0, eName->text().stripWhiteSpace() );
md->setAttr( obj, mda_name, eName->text().stripWhiteSpace() );
md->setSText( obj, md_description, eDescription->text() );
- md->setSText( obj, md_sourcecode, eModule->text() );
+ md->setSText( obj, md_sourcecode, eModule->toPlainText() );
}
void dEditReport::destroy()
</attribute>
<layout class="QGridLayout" >
<item row="0" column="0" >
- <widget class="QSEditor" native="1" name="eModule" />
+ <widget class="ScriptEdit" native="1" name="eModule" />
</item>
</layout>
</widget>
<header>q3textedit.h</header>
</customwidget>
<customwidget>
- <class>QSEditor</class>
+ <class>ScriptEdit</class>
<extends>QWidget</extends>
- <header>qseditor.h</header>
+ <header>scriptedit.h</header>
</customwidget>
</customwidgets>
<includes>
<include location="local" >mdtree.h</include>
<include location="local" >aliaseditor.h</include>
<include location="local" >mainform.h</include>
- <include location="local" >qseditor.h</include>
+ <include location="local" >scriptedit.h</include>
</includes>
<resources/>
<connections/>
#include <qstatusbar.h>
#include "acfg.h"
-#include <qsinterpreter.h>
-#include <qseditor.h>
+//#include <qsinterpreter.h>
+//#include <qseditor.h>
/*
* Constructs a dEditWebForm as a child of 'parent', with the
void dEditWebForm::init()
{
delete statusBar();
- eServerModule->setInterpreter(new QSInterpreter());
- eClientModule->setInterpreter(new QSInterpreter());
+// eServerModule->setInterpreter(new QSInterpreter());
+// eClientModule->setInterpreter(new QSInterpreter());
}
void dEditWebForm::destroy()
setCaption( tr("Web form:") + md->attr( obj, mda_name ) );
eName->setText( md->attr( obj, mda_name ) );
eDescription->setText( md->sText( obj, md_description ) );
- eServerModule->setText( md->sText( obj, md_servermodule ) );
- eClientModule->setText( md->sText( obj, md_clientmodule ) );
+ eServerModule->setPlainText( md->sText( obj, md_servermodule ) );
+ eClientModule->setPlainText( md->sText( obj, md_clientmodule ) );
eFormSource->setText( md->sText( obj, md_formsource ) );
}
item->setText( 0, eName->text().stripWhiteSpace() );
md->setAttr( obj, mda_name, eName->text().stripWhiteSpace() );
md->setSText( obj, md_description, eDescription->text() );
- md->setSText( obj, md_servermodule, eServerModule->text() );
- md->setSText( obj, md_clientmodule, eClientModule->text() );
+ md->setSText( obj, md_servermodule, eServerModule->toPlainText() );
+ md->setSText( obj, md_clientmodule, eClientModule->toPlainText() );
md->setSText( obj, md_formsource, eFormSource->text() );
}
</attribute>
<layout class="QGridLayout" >
<item row="0" column="0" >
- <widget class="QSEditor" native="1" name="eClientModule" />
+ <widget class="ScriptEdit" native="1" name="eClientModule" />
</item>
</layout>
</widget>
</attribute>
<layout class="QGridLayout" >
<item row="0" column="0" >
- <widget class="QSEditor" native="1" name="eServerModule" />
+ <widget class="ScriptEdit" native="1" name="eServerModule" />
</item>
</layout>
</widget>
<header>q3textedit.h</header>
</customwidget>
<customwidget>
- <class>QSEditor</class>
+ <class>ScriptEdit</class>
<extends>QWidget</extends>
- <header>qseditor.h</header>
+ <header>scriptedit.h</header>
</customwidget>
</customwidgets>
<includes>
<include location="local" >aliaseditor.h</include>
<include location="local" >mdtree.h</include>
<include location="local" >mainform.h</include>
- <include location="local" >qseditor.h</include>
- <include location="local" >qseditor.h</include>
+ <include location="local" >scriptedit.h</include>
</includes>
<resources/>
<connections/>
DESTDIR = ../../bin
-INCLUDEPATH += . ./formdesigner ../lib ../../tmp/ui/ananas ../plugins
-LIBS += -L../../lib -lananas4 -L../../lib/designer -lananasplugin4 -lqt4-qdataschema
+INCLUDEPATH += . ./formdesigner ./formdesigner/private ../lib ../../tmp/ui/ananas ../plugins ../editor
+LIBS += -L../../lib -lananas4 -lqt4designer -L../../lib/designer -lananasplugin4 -lqt4-qdataschema -L../editor -lqtscriptedit
unix {
#LIBS += -L$(QTINC)/QtDesigner
LIBS += -lQtDesignerComponents
#INCLUDEPATH += ../lib ../lib/tmp/ui ../lib/.ui ./formdesigner /usr/lib
include ( ../ananas.pri )
-load(qsa)
+#load(qsa)
+QT += script
+QT += scripttools
HEADERS = \
actiontree.h \
for (i=0; i< workbench()->formWindowCount(); i++){
w = workbench()->formWindow( i );
workbench()->saveForm(w->editor());
- printf("w=%s\n", w->windowTitle().toUtf8().data());
+ //printf("w=%s\n", w->windowTitle().toUtf8().data());
}
}
--- /dev/null
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Designer of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at http://www.qtsoftware.com/contact.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of Qt Designer. This header
+// file may change from version to version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#ifndef DEVICEPROFILE_H
+#define DEVICEPROFILE_H
+
+#include "shared_global_p.h"
+
+#include <QtCore/QString>
+#include <QtCore/QSharedDataPointer>
+
+QT_BEGIN_NAMESPACE
+
+class QDesignerFormEditorInterface;
+class QWidget;
+class QStyle;
+
+namespace qdesigner_internal {
+
+class DeviceProfileData;
+
+/* DeviceProfile for embedded design. They influence
+ * default properties (for example, fonts), dpi and
+ * style of the form. This class represents a device
+ * profile. */
+
+class QDESIGNER_SHARED_EXPORT DeviceProfile {
+public:
+ DeviceProfile();
+
+ DeviceProfile(const DeviceProfile&);
+ DeviceProfile& operator=(const DeviceProfile&);
+ ~DeviceProfile();
+
+ void clear();
+
+ // Device name
+ QString name() const;
+ void setName(const QString &);
+
+ // System settings active
+ bool isEmpty() const;
+
+ // Default font family of the embedded system
+ QString fontFamily() const;
+ void setFontFamily(const QString &);
+
+ // Default font size of the embedded system
+ int fontPointSize() const;
+ void setFontPointSize(int p);
+
+ // Display resolution of the embedded system
+ int dpiX() const;
+ void setDpiX(int d);
+ int dpiY() const;
+ void setDpiY(int d);
+
+ // Style
+ QString style() const;
+ void setStyle(const QString &);
+
+ // Initialize from desktop system
+ void fromSystem();
+
+ static void systemResolution(int *dpiX, int *dpiY);
+ static void widgetResolution(const QWidget *w, int *dpiX, int *dpiY);
+
+ bool equals(const DeviceProfile& rhs) const;
+
+ // Apply to form/preview (using font inheritance)
+ enum ApplyMode {
+ /* Pre-Apply to parent widget of form being edited: Apply font
+ * and make use of property inheritance to be able to modify the
+ * font property freely. */
+ ApplyFormParent,
+ /* Post-Apply to preview widget: Change only inherited font
+ * sub properties. */
+ ApplyPreview
+ };
+ void apply(const QDesignerFormEditorInterface *core, QWidget *widget, ApplyMode am) const;
+
+ static void applyDPI(int dpiX, int dpiY, QWidget *widget);
+
+ QString toString() const;
+
+ QString toXml() const;
+ bool fromXml(const QString &xml, QString *errorMessage);
+
+private:
+ QSharedDataPointer<DeviceProfileData> m_d;
+};
+
+inline bool operator==(const DeviceProfile &s1, const DeviceProfile &s2)
+ { return s1.equals(s2); }
+inline bool operator!=(const DeviceProfile &s1, const DeviceProfile &s2)
+ { return !s1.equals(s2); }
+
+}
+
+
+QT_END_NAMESPACE
+
+#endif // DEVICEPROFILE_H
/****************************************************************************
**
-** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved.
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Designer of the Qt Toolkit.
**
-** This file may be used under the terms of the GNU General Public
-** License version 2.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of
-** this file. Please review the following information to ensure GNU
-** General Public Licensing requirements will be met:
-** http://www.trolltech.com/products/qt/opensource.html
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
**
-** If you are unsure which license is appropriate for your use, please
-** review the following information:
-** http://www.trolltech.com/products/qt/licensing.html or contact the
-** sales department at sales@trolltech.com.
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at http://www.qtsoftware.com/contact.
+** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef FORMSCRIPTRUNNER_H
#define FORMSCRIPTRUNNER_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtDesigner/uilib_global.h>
#include <QtCore/QList>
#include <QtCore/QFlags>
#include <QtCore/QString>
+QT_BEGIN_NAMESPACE
+
class QWidget;
#ifdef QFORMINTERNAL_NAMESPACE
}
#endif
+QT_END_NAMESPACE
+
#endif // FORMSCRIPTRUNNER_H
/****************************************************************************
**
-** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved.
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Designer of the Qt Toolkit.
**
-** This file may be used under the terms of the GNU General Public
-** License version 2.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of
-** this file. Please review the following information to ensure GNU
-** General Public Licensing requirements will be met:
-** http://www.trolltech.com/products/qt/opensource.html
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
**
-** If you are unsure which license is appropriate for your use, please
-** review the following information:
-** http://www.trolltech.com/products/qt/licensing.html or contact the
-** sales department at sales@trolltech.com.
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at http://www.qtsoftware.com/contact.
+** $QT_END_LICENSE$
**
****************************************************************************/
#include "shared_global_p.h"
+#include <QtCore/QSharedDataPointer>
#include <QtCore/QMap>
#include <QtCore/QStringList>
-#include <QtCore/QSettings>
+
+QT_BEGIN_NAMESPACE
class QDesignerFormEditorInterface;
class QDesignerCustomWidgetInterface;
+class QDesignerPluginManagerPrivate;
+
+class QDesignerCustomWidgetSharedData;
+
+/* Information contained in the Dom XML of a custom widget. */
+class QDESIGNER_SHARED_EXPORT QDesignerCustomWidgetData {
+public:
+ explicit QDesignerCustomWidgetData(const QString &pluginPath = QString());
+
+ enum ParseResult { ParseOk, ParseWarning, ParseError };
+ ParseResult parseXml(const QString &xml, const QString &name, QString *errorMessage);
+
+ QDesignerCustomWidgetData(const QDesignerCustomWidgetData&);
+ QDesignerCustomWidgetData& operator=(const QDesignerCustomWidgetData&);
+ ~QDesignerCustomWidgetData();
+
+ bool isNull() const;
+
+ QString pluginPath() const;
+
+ // Data as parsed from the widget's domXML().
+ QString xmlClassName() const;
+ // Optional. The language the plugin is supposed to be used with.
+ QString xmlLanguage() const;
+ // Optional. method used to add pages to a container with a container extension
+ QString xmlAddPageMethod() const;
+ // Optional. Base class
+ QString xmlExtends() const;
+ // Optional. The name to be used in the widget box.
+ QString xmlDisplayName() const;
+
+private:
+ QSharedDataPointer<QDesignerCustomWidgetSharedData> m_d;
+};
class QDESIGNER_SHARED_EXPORT QDesignerPluginManager: public QObject
{
Q_OBJECT
public:
- QDesignerPluginManager(QDesignerFormEditorInterface *core);
+ typedef QList<QDesignerCustomWidgetInterface*> CustomWidgetList;
+
+ explicit QDesignerPluginManager(QDesignerFormEditorInterface *core);
virtual ~QDesignerPluginManager();
QDesignerFormEditorInterface *core() const;
QStringList failedPlugins() const;
QString failureReason(const QString &pluginName) const;
- QList<QObject*> instances() const;
- QList<QDesignerCustomWidgetInterface*> registeredCustomWidgets() const;
+ QObjectList instances() const;
+
+ CustomWidgetList registeredCustomWidgets() const;
+ QDesignerCustomWidgetData customWidgetData(QDesignerCustomWidgetInterface *w) const;
bool registerNewPlugins();
void registerPlugin(const QString &plugin);
private:
- QDesignerFormEditorInterface *m_core;
- QStringList m_pluginPaths;
- QStringList m_registeredPlugins;
- QStringList m_disabledPlugins;
-
- typedef QMap<QString, QString> FailedPluginMap;
- FailedPluginMap m_failedPlugins;
+ static QStringList defaultPluginPaths();
- typedef QList<QDesignerCustomWidgetInterface*> CustomWidgetList;
- CustomWidgetList m_customWidgets;
-
- QStringList defaultPluginPaths() const;
+ QDesignerPluginManagerPrivate *m_d;
};
+QT_END_NAMESPACE
+
#endif // PLUGINMANAGER_H
/****************************************************************************
**
-** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved.
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Designer of the Qt Toolkit.
**
-** This file may be used under the terms of the GNU General Public
-** License version 2.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of
-** this file. Please review the following information to ensure GNU
-** General Public Licensing requirements will be met:
-** http://www.trolltech.com/products/qt/opensource.html
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
**
-** If you are unsure which license is appropriate for your use, please
-** review the following information:
-** http://www.trolltech.com/products/qt/licensing.html or contact the
-** sales department at sales@trolltech.com.
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at http://www.qtsoftware.com/contact.
+** $QT_END_LICENSE$
**
****************************************************************************/
#define QDESIGNER_FORMBUILDER_H
#include "shared_global_p.h"
+#include "deviceprofile_p.h"
-#include <private/formscriptrunner_p.h>
+//#include <QtDesigner/private/formscriptrunner_p.h>
+#include <formscriptrunner_p.h>
#include <QtDesigner/formbuilder.h>
#include <QtCore/QMap>
#include <QtCore/QSet>
+QT_BEGIN_NAMESPACE
+
class QDesignerFormEditorInterface;
class QDesignerFormWindowInterface;
+class QPixmap;
+class QtResourceSet;
+
namespace qdesigner_internal {
-// Form builder used for previewing forms
+class DesignerPixmapCache;
+class DesignerIconCache;
+
+/* Form builder used for previewing forms, widget box and new form dialog.
+ * It applies the system settings to its toplevel window. */
+
class QDESIGNER_SHARED_EXPORT QDesignerFormBuilder: public QFormBuilder
{
public:
enum Mode {
- // Use container extension to populate containers. Disable scripts.
DisableScripts,
- // Use container extension to populate containers as well as scripts
- UseScriptAndContainerExtension,
- // Experimental: Use scripts to populate the container
- UseScriptForContainerExtension
+ EnableScripts
};
- QDesignerFormBuilder(QDesignerFormEditorInterface *core, Mode mode);
+ QDesignerFormBuilder(QDesignerFormEditorInterface *core,
+ Mode mode,
+ const DeviceProfile &deviceProfile = DeviceProfile());
QWidget *createWidgetFromContents(const QString &contents, QWidget *parentWidget = 0);
inline QDesignerFormEditorInterface *core() const
{ return m_core; }
+ QString systemStyle() const;
+
typedef QFormScriptRunner::Errors ScriptErrors;
// Create a preview widget (for integrations) or return 0. The widget has to be embedded into a main window.
// Experimental, depending on script support.
static QWidget *createPreview(const QDesignerFormWindowInterface *fw, const QString &styleName /* ="" */,
+ const QString &appStyleSheet /* ="" */,
+ const DeviceProfile &deviceProfile,
ScriptErrors *scriptErrors, QString *errorMessage);
// Convenience that pops up message boxes in case of failures.
static QWidget *createPreview(const QDesignerFormWindowInterface *fw, const QString &styleName = QString());
+ // Create a preview widget (for integrations) or return 0. The widget has to be embedded into a main window.
+ static QWidget *createPreview(const QDesignerFormWindowInterface *fw, const QString &styleName, const QString &appStyleSheet, QString *errorMessage);
+ static QWidget *createPreview(const QDesignerFormWindowInterface *fw, const QString &styleName, const QString &appStyleSheet, const DeviceProfile &deviceProfile, QString *errorMessage);
+ // Convenience that pops up message boxes in case of failures.
+ static QWidget *createPreview(const QDesignerFormWindowInterface *fw, const QString &styleName, const QString &appStyleSheet);
+
+ // Create a preview image
+ static QPixmap createPreviewPixmap(const QDesignerFormWindowInterface *fw, const QString &styleName = QString(), const QString &appStyleSheet = QString());
protected:
using QFormBuilder::createDom;
virtual DomWidget *createDom(QWidget *widget, DomWidget *ui_parentWidget, bool recursive = true);
virtual QWidget *create(DomWidget *ui_widget, QWidget *parentWidget);
virtual QLayout *create(DomLayout *ui_layout, QLayout *layout, QWidget *parentWidget);
+ virtual void createResources(DomResources *resources);
virtual QWidget *createWidget(const QString &widgetName, QWidget *parentWidget, const QString &name);
virtual bool addItem(DomWidget *ui_widget, QWidget *widget, QWidget *parentWidget);
virtual void loadExtraInfo(DomWidget *ui_widget, QWidget *widget, QWidget *parentWidget);
+ QtResourceSet *internalResourceSet() const { return m_tempResourceSet; }
+
+ DeviceProfile deviceProfile() const { return m_deviceProfile; }
+
private:
- bool addItemContainerExtension(QWidget *widget, QWidget *parentWidget);
QDesignerFormEditorInterface *m_core;
const Mode m_mode;
-
+
typedef QSet<QWidget *> WidgetSet;
WidgetSet m_customWidgetsWithScript;
+
+ const DeviceProfile m_deviceProfile;
+
+ DesignerPixmapCache *m_pixmapCache;
+ DesignerIconCache *m_iconCache;
+ bool m_ignoreCreateResources;
+ QtResourceSet *m_tempResourceSet;
+ bool m_mainWidget;
};
} // namespace qdesigner_internal
+QT_END_NAMESPACE
+
#endif // QDESIGNER_FORMBUILDER_H
/****************************************************************************
**
-** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved.
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Designer of the Qt Toolkit.
**
-** This file may be used under the terms of the GNU General Public
-** License version 2.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of
-** this file. Please review the following information to ensure GNU
-** General Public Licensing requirements will be met:
-** http://www.trolltech.com/products/qt/opensource.html
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
**
-** If you are unsure which license is appropriate for your use, please
-** review the following information:
-** http://www.trolltech.com/products/qt/licensing.html or contact the
-** sales department at sales@trolltech.com.
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at http://www.qtsoftware.com/contact.
+** $QT_END_LICENSE$
**
****************************************************************************/
#define QDESIGNER_INTEGRATION_H
#include "shared_global_p.h"
-#include "abstractintegration.h"
+#include <QtDesigner/QDesignerIntegrationInterface>
#include <QtCore/QObject>
+QT_BEGIN_NAMESPACE
+
class QDesignerFormEditorInterface;
class QDesignerFormWindowInterface;
-class QDesignerFormWindowManagerInterface;
+class QDesignerResourceBrowserInterface;
class QVariant;
class QWidget;
namespace qdesigner_internal {
struct Selection;
+class QDesignerIntegrationPrivate;
class QDESIGNER_SHARED_EXPORT QDesignerIntegration: public QDesignerIntegrationInterface
{
Q_OBJECT
public:
- QDesignerIntegration(QDesignerFormEditorInterface *core, QObject *parent = 0);
+ explicit QDesignerIntegration(QDesignerFormEditorInterface *core, QObject *parent = 0);
virtual ~QDesignerIntegration();
+ static void requestHelp(const QDesignerFormEditorInterface *core, const QString &manual, const QString &document);
+
virtual QWidget *containerWindow(QWidget *widget) const;
// Load plugins into widget database and factory.
static void initializePlugins(QDesignerFormEditorInterface *formEditor);
+ void emitObjectNameChanged(QDesignerFormWindowInterface *formWindow, QObject *object,
+ const QString &newName, const QString &oldName);
+ void emitNavigateToSlot(const QString &objectName, const QString &signalSignature, const QStringList ¶meterNames);
+ void emitNavigateToSlot(const QString &slotSignature);
+
+ // Create a resource browser specific to integration. Language integration takes precedence
+ virtual QDesignerResourceBrowserInterface *createResourceBrowser(QWidget *parent = 0);
+
+ enum ResourceFileWatcherBehaviour {
+ NoWatcher,
+ ReloadSilently,
+ PromptAndReload
+ };
+
+ ResourceFileWatcherBehaviour resourceFileWatcherBehaviour() const;
+ bool isResourceEditingEnabled() const;
+ bool isSlotNavigationEnabled() const;
+
+ QString contextHelpId() const;
+
+protected:
+
+ void setResourceFileWatcherBehaviour(ResourceFileWatcherBehaviour behaviour); // PromptAndReload by default
+ void setResourceEditingEnabled(bool enable); // true by default
+ void setSlotNavigationEnabled(bool enable); // false by default
signals:
void propertyChanged(QDesignerFormWindowInterface *formWindow, const QString &name, const QVariant &value);
+ void objectNameChanged(QDesignerFormWindowInterface *formWindow, QObject *object, const QString &newName, const QString &oldName);
+ void helpRequested(const QString &manual, const QString &document);
+
+ void navigateToSlot(const QString &objectName, const QString &signalSignature, const QStringList ¶meterNames);
+ void navigateToSlot(const QString &slotSignature);
public slots:
- virtual void updateProperty(const QString &name, const QVariant &value);
+ virtual void updateProperty(const QString &name, const QVariant &value, bool enableSubPropertyHandling);
// Additional signals of designer property editor
- virtual void updatePropertyComment(const QString &name, const QString &value);
virtual void resetProperty(const QString &name);
virtual void addDynamicProperty(const QString &name, const QVariant &value);
virtual void removeDynamicProperty(const QString &name);
-
virtual void updateActiveFormWindow(QDesignerFormWindowInterface *formWindow);
virtual void setupFormWindow(QDesignerFormWindowInterface *formWindow);
virtual void updateSelection();
void updateCustomWidgetPlugins();
+private slots:
+ void updatePropertyPrivate(const QString &name, const QVariant &value);
+
private:
void initialize();
void getSelection(Selection &s);
QObject *propertyEditorObject();
- QDesignerFormWindowManagerInterface *m_formWindowManager;
+ QDesignerIntegrationPrivate *m_d;
};
} // namespace qdesigner_internal
+QT_END_NAMESPACE
+
#endif // QDESIGNER_INTEGRATION_H
/****************************************************************************
**
-** Copyright (C) 1992-2006 Trolltech ASA. All rights reserved.
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Designer of the Qt Toolkit.
**
-** This file may be used under the terms of the GNU General Public
-** License version 2.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of
-** this file. Please review the following information to ensure GNU
-** General Public Licensing requirements will be met:
-** http://www.trolltech.com/products/qt/opensource.html
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
**
-** If you are unsure which license is appropriate for your use, please
-** review the following information:
-** http://www.trolltech.com/products/qt/licensing.html or contact the
-** sales department at sales@trolltech.com.
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at http://www.qtsoftware.com/contact.
+** $QT_END_LICENSE$
**
****************************************************************************/
/****************************************************************************
**
-** Copyright (C) 1992-2006 Trolltech ASA. All rights reserved.
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Designer of the Qt Toolkit.
**
-** This file may be used under the terms of the GNU General Public
-** License version 2.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of
-** this file. Please review the following information to ensure GNU
-** General Public Licensing requirements will be met:
-** http://www.trolltech.com/products/qt/opensource.html
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
**
-** If you are unsure which license is appropriate for your use, please
-** review the following information:
-** http://www.trolltech.com/products/qt/licensing.html or contact the
-** sales department at sales@trolltech.com.
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at http://www.qtsoftware.com/contact.
+** $QT_END_LICENSE$
**
****************************************************************************/
#include "shared_global_p.h"
-#include <QItemDelegate>
-#include <QTreeView>
+#include <QtGui/QItemDelegate>
+#include <QtGui/QTreeView>
+
+QT_BEGIN_NAMESPACE
class QTreeView;
} // namespace qdesigner_internal
+QT_END_NAMESPACE
+
#endif // SHEET_DELEGATE_H
/****************************************************************************
** Resource object code
**
-** Created: Sun Oct 26 23:47:57 2008
-** by: The Resource Compiler for Qt version 4.3.0
+** Created: Wed Dec 23 14:39:47 2009
+** by: The Resource Compiler for Qt version 4.5.2
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include <QtCore/qglobal.h>
static const unsigned char qt_resource_data[] = {
- // /home/user/src/ananas-qt4/src/designer/formdesigner/images/designer.png
+ // /home/app/devel/clones/ananas-qt4/src/designer/formdesigner/images/designer.png
0x0,0x0,0x39,0xf,
0x89,
0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
0x24,0xf0,0x4a,0xcd,0xbc,0xb,0x59,0xd8,0x21,0xea,0x22,0xf5,0x5a,0x2,0x75,0x29,
0x8c,0xcd,0x4,0xfc,0x31,0x2d,0x1c,0xf9,0xff,0x1,0x1f,0xdc,0x76,0xde,0x36,0x49,
0xe6,0xd2,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82,
- // /home/user/src/ananas-qt4/src/designer/formdesigner/templates/forms/Dialog_with_Buttons_Bottom.ui
+ // /home/app/devel/clones/ananas-qt4/src/designer/formdesigner/templates/forms/Dialog_with_Buttons_Bottom.ui
0x0,0x0,0x2,0x72,
0x0,
0x0,0x8,0xb0,0x78,0x9c,0xb5,0x55,0x4d,0x8f,0xd3,0x30,0x10,0xbd,0x23,0xf1,0x1f,
0x2,0x7e,0xa9,0xac,0x2f,0x94,0x35,0xbb,0xbc,0x79,0x75,0x59,0x57,0x57,0x31,0xe7,
0xf5,0xfa,0xef,0x75,0x9d,0xfa,0x3a,0x2,0xa5,0x1d,0x55,0x9f,0x3f,0x70,0x8d,0x7e,
0x64,
- // /home/user/src/ananas-qt4/src/designer/formdesigner/templates/forms/Dialog_with_Buttons_Right.ui
+ // /home/app/devel/clones/ananas-qt4/src/designer/formdesigner/templates/forms/Dialog_with_Buttons_Right.ui
0x0,0x0,0x2,0x78,
0x0,
0x0,0x8,0xab,0x78,0x9c,0xb5,0x55,0x4d,0x6f,0xd4,0x30,0x10,0xbd,0x23,0xf1,0x1f,
0xaa,0x4a,0xf8,0xa9,0x4f,0x7d,0xa9,0xaa,0x9b,0xd1,0x6f,0x61,0xb7,0x7b,0xa9,0xaa,
0xab,0xcb,0xfd,0x30,0xe5,0x6a,0x7d,0xf1,0x7c,0x59,0x63,0xdf,0xac,0xc0,0x49,0xc3,
0xf4,0xe7,0xf,0xe0,0x1d,0x7c,0xd5,
- // /home/user/src/ananas-qt4/src/designer/formdesigner/templates/forms/Main_Window.ui
+ // /home/app/devel/clones/ananas-qt4/src/designer/formdesigner/templates/forms/Main_Window.ui
0x0,0x0,0x2,0xc7,
0x3c,
0x75,0x69,0x20,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x3d,0x22,0x34,0x2e,0x30,0x22,
0x6d,0x61,0x70,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x3e,0xd,0xa,0x20,0x3c,
0x63,0x6f,0x6e,0x6e,0x65,0x63,0x74,0x69,0x6f,0x6e,0x73,0x2f,0x3e,0xd,0xa,0x3c,
0x2f,0x75,0x69,0x3e,0xd,0xa,
- // /home/user/src/ananas-qt4/src/designer/formdesigner/templates/forms/Widget.ui
+ // /home/app/devel/clones/ananas-qt4/src/designer/formdesigner/templates/forms/Widget.ui
0x0,0x0,0x2,0x18,
0x3c,
0x75,0x69,0x20,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x3d,0x22,0x34,0x2e,0x30,0x22,
};
-int qInitResources_designer()
+QT_BEGIN_NAMESPACE
+
+extern bool qRegisterResourceData
+ (int, const unsigned char *, const unsigned char *, const unsigned char *);
+
+extern bool qUnregisterResourceData
+ (int, const unsigned char *, const unsigned char *, const unsigned char *);
+
+QT_END_NAMESPACE
+
+
+int QT_MANGLE_NAMESPACE(qInitResources_designer)()
{
- extern bool qRegisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *);
- qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data);
+ QT_PREPEND_NAMESPACE(qRegisterResourceData)
+ (0x01, qt_resource_struct, qt_resource_name, qt_resource_data);
return 1;
}
-Q_CONSTRUCTOR_FUNCTION(qInitResources_designer)
-int qCleanupResources_designer()
+
+Q_CONSTRUCTOR_FUNCTION(QT_MANGLE_NAMESPACE(qInitResources_designer))
+
+int QT_MANGLE_NAMESPACE(qCleanupResources_designer)()
{
- extern bool qUnregisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *);
- qUnregisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data);
+ QT_PREPEND_NAMESPACE(qUnregisterResourceData)
+ (0x01, qt_resource_struct, qt_resource_name, qt_resource_data);
return 1;
}
-Q_DESTRUCTOR_FUNCTION(qCleanupResources_designer)
+
+Q_DESTRUCTOR_FUNCTION(QT_MANGLE_NAMESPACE(qCleanupResources_designer))
+
TEMPLATE = lib
TARGET = qt4designer
-INCLUDEPATH +=
+INCLUDEPATH += ./private
DEFINES +=
TEMPLATE = lib
#DESTDIR = ../lib
-TARGET = qtscripteditor
+TARGET = qtscriptedit
#DEFINES += Q_SCRIPTDEBUG_BUILD_LIB
include(editor.pri)
#include <qimage.h>
#include <qpixmap.h>
-#include <qseditor.h>
+//#include <qseditor.h>
#include <stdlib.h>
/*
#include <qfile.h>
#include <qdir.h>
//#include <qsinterpreter.h>
+#include <QScriptValue>
+#include <QScriptEngine>
//--#include <qbutton.h>
#include <qpushbutton.h>
connectSlots();
if ( !sModule.isEmpty() )
{
- // engine->project.addObject(this);
- engine->project.interpreter()->evaluate(sModule,this );
+// engine->project.interpreter()->evaluate(sModule,this );
+ engine->code->evaluate(sModule);
aLog::print(aLog::Debug, tr("aForm load form module script"));
- QStringList lst = engine->project.interpreter()->functions(this);
- for(uint i=0; i<lst.count();i++)
- {
- aLog::print(aLog::Debug, tr("aForm defined function %1").arg(lst[i]));
- }
+// QStringList lst = engine->project.interpreter()->functions(this);
+// for(uint i=0; i<lst.count();i++)
+// {
+// aLog::print(aLog::Debug, tr("aForm defined function %1").arg(lst[i]));
+// }
}
else
{
{
if ( form )
{
- if ( engine->project.interpreter()->functions( this ).findIndex("on_formstart")!=-1)
- {
- engine->project.interpreter()->call("on_formstart", QVariantList(), this);
- }
+// if ( engine->project.interpreter()->functions( this ).findIndex("on_formstart")!=-1)
+// {
+// engine->project.interpreter()->call("on_formstart", QVariantList(), this);
+// }
+ if ( engine->code->globalObject().property("on_formstart").isValid() ){
+ engine->code->globalObject().property("on_formstart").call();
+ }
+
form->show();
((QWidget*)form->parent())->move(0,0);
connect( form, SIGNAL(destroyed()), this, SLOT(close()) );
*/
int
aForm::SignIn(){
- QVariant res;
+ QScriptValue res;
if ( form && !mainWidget->dataObject()->IsConducted())
{
- if ( engine->project.interpreter()->functions( this ).findIndex("on_conduct")!=-1)
- {
- res = engine->project.interpreter()->call("on_conduct",QVariantList(), this);
- }
- }
- //--if(res.type()==QSArgument::Variant)
- {
- // if return false
- if(res.toBool()==false && res.type()!=QVariant::Invalid)
- {
- aLog::print(aLog::Info, tr("aForm conduct: function on_conduct() return false, document not conducted"));
- return 0;
- }
+// if ( engine->project.interpreter()->functions( this ).findIndex("on_conduct")!=-1)
+// {
+// res = engine->project.interpreter()->call("on_conduct",QVariantList(), this);
+// }
+ if ( engine->code->globalObject().property("on_conduct").isValid() ){
+ res = engine->code->globalObject().property("on_conduct").call();
+ }
+
}
+ // if return false
+ if(res.isValid() && res.toBool() == false )
+ {
+ aLog::print(aLog::Info, tr("aForm conduct: function on_conduct() return false, document not conducted"));
+ return 0;
+ }
return mainWidget->TurnOn();
}
void
aForm::on_button(){
- if ( engine->project.interpreter()->functions(this).findIndex("on_button")!=-1)
- {
- engine->project.interpreter()->call("on_button",QVariantList()<<sender()->name(),this);
-// engine->code->evaluate("on_button(\""+sender()->name()+"\")", this);
- }
+// if ( engine->project.interpreter()->functions(this).findIndex("on_button")!=-1)
+// {
+// engine->project.interpreter()->call("on_button",QVariantList()<<sender()->name(),this);
+// }
+ if ( engine->code->globalObject().property("on_button").isValid() ){
+ engine->code->globalObject().property("on_button").call();
+ }
+
}
void
aForm::on_form_close(){
if(!engine) return;
- if ( engine->project.interpreter()->functions(this).findIndex("on_formstop")!=-1) {
- engine->project.interpreter()->call("on_formstop", QVariantList(),this);
- }
+// if ( engine->project.interpreter()->functions(this).findIndex("on_formstop")!=-1) {
+// engine->project.interpreter()->call("on_formstop", QVariantList(),this);
+// }
+ if ( engine->code->globalObject().property("on_formstop").isValid() ){
+ engine->code->globalObject().property("on_formstop").call();
+ }
}
aForm::on_valueChanged( const QString & name, const QVariant & val )
{
- if ( engine->project.interpreter()->functions(this).findIndex("on_valuechanged")!=-1)
- {
- Q3ValueList<QVariant> lst;
- lst << name;
- lst << val;
-// if(!val.isNull() && !val.isValid()) v = val;
- engine->project.interpreter()->call("on_valuechanged",QVariantList(lst), this);
- // printf("aForm change value field %s to %s\n",(const char*)name.local8Bit(), val.toString().ascii());
- }
+// if ( engine->project.interpreter()->functions(this).findIndex("on_valuechanged")!=-1)
+// {
+// Q3ValueList<QVariant> lst;
+// lst << name;
+// lst << val;
+// engine->project.interpreter()->call("on_valuechanged",QVariantList(lst), this);
+// }
+ if ( engine->code->globalObject().property("on_valuechanged").isValid() ){
+ QScriptValueList list;
+ list.append(QScriptValue(name));
+ list.append( engine->code->newVariant(val));
+ engine->code->globalObject().property("on_valuechanged")
+ .call(QScriptValue(),list);
+ }
+
}
aForm::on_tabvalueChanged(int row, int col)
{
- if ( engine->project.interpreter()->functions(this).findIndex("on_tabupdate")!=-1)
- {
- Q3ValueList<QVariant> lst;
- lst << row;
- lst << col;
- lst << sender()->name();
-
- engine->project.interpreter()->call("on_tabupdate",QVariantList(lst), this);
- }
-/*
- const QObject *sobj=sender();
- QString objName=widgetName((QObject *) sobj);
- cfg_message(0, "value changed %s (%s)\n", (const char *) objName.utf8(), (const char *) dbobject->className());
- cfg_message(0, "classname %s\n", (const char *) sobj->className());
- if (strcmp(sobj->className(),"QAnanasDBTable")==0) {
-// if (sobj->className()=="QAnanasDBField") {
-*/
-/* cfg_message(0,"OK");
- if (dbobject->className()=="QAdoc"){
- ((QAdoc *)dbobject)->setfield(objName, s);
- }
- if (dbobject->className()=="QAcat"){
- cfg_message(0,"Поле справочника %s=%s\n",(const char *) objName.utf8(), (const char *) s.utf8());
- ((QAcat *)dbobject)->setfield(objName, s);
- }
-*/
+// if ( engine->project.interpreter()->functions(this).findIndex("on_tabupdate")!=-1)
+// {
+// Q3ValueList<QVariant> lst;
+// lst << row;
+// lst << col;
+// lst << sender()->name();
+//
+// engine->project.interpreter()->call("on_tabupdate",QVariantList(lst), this);
// }
+ if ( engine->code->globalObject().property("on_tabupdate").isValid() ){
+ QScriptValueList list;
+ list << row;
+ list << col;
+ list << sender()->name();
+ engine->code->globalObject().property("on_tabupdate")
+ .call(QScriptValue(),list);
+ }
}
aSQLTable *t = o->table();
id = t->value(0).toULongLong();
}
- if ( engine->project.interpreter()->functions(this).findIndex("on_tablerow")!=-1) {
- engine->project.interpreter()->call("on_tablerow", QVariantList()<<sender()->name(), this);
- }
+// if ( engine->project.interpreter()->functions(this).findIndex("on_tablerow")!=-1) {
+// engine->project.interpreter()->call("on_tablerow", QVariantList()<<sender()->name(), this);
+// }
+ if ( engine->code->globalObject().property("on_tablerow").isValid() ){
+ QScriptValueList list;
+ list << sender()->name();
+ engine->code->globalObject().property("on_tablerow")
+ .call(QScriptValue(),list);
+ }
}
void
aForm::on_event( const QString &source, const QString &data )
{
- Q3ValueList<QVariant> lst;
- lst << source;
- lst << data;
- if ( engine->project.interpreter()->functions(this).findIndex("on_event")!=-1) {
- engine->project.interpreter()->call("on_event", QVariantList(lst), this);
- }
+// Q3ValueList<QVariant> lst;
+// lst << source;
+// lst << data;
+// if ( engine->project.interpreter()->functions(this).findIndex("on_event")!=-1) {
+// engine->project.interpreter()->call("on_event", QVariantList(lst), this);
+// }
+ if ( engine->code->globalObject().property("on_event").isValid() ){
+ QScriptValueList list;
+ list << source;
+ list << data;
+ engine->code->globalObject().property("on_event")
+ .call(QScriptValue(),list);
+ }
}
void
aForm::on_tablerow( qulonglong uid )
{
- Q3ValueList<QVariant> lst;
- lst << sender()->name();
- lst << QString("%1").arg(uid);
- if ( engine->project.interpreter()->functions(this).findIndex("on_tabrowselected")!=-1) {
- engine->project.interpreter()->call("on_tabrowselected", QVariantList(lst), this);
- }
+// Q3ValueList<QVariant> lst;
+// lst << sender()->name();
+// lst << QString("%1").arg(uid);
+// if ( engine->project.interpreter()->functions(this).findIndex("on_tabrowselected")!=-1) {
+// engine->project.interpreter()->call("on_tabrowselected", QVariantList(lst), this);
+// }
+ if ( engine->code->globalObject().property("on_tabrowselected").isValid() ){
+ QScriptValueList list;
+ list << sender()->name();
+ list << QString("%1").arg(uid);
+ engine->code->globalObject().property("on_tabrowselected")
+ .call(QScriptValue(),list);
+ }
}
int
** not clear to you.
**
**********************************************************************/
-#include <qsinterpreter.h>
-#include <qsinputdialogfactory.h>
+//#include <qsinterpreter.h>
+//#include <qsinputdialogfactory.h>
+
#include <qobject.h>
#include <q3valuelist.h>
#include <qstringlist.h>
#include <qstring.h>
#include <stdlib.h>
#include <qfile.h>
-#include <qsproject.h>
-#include <qsscript.h>
+//#include <qsproject.h>
+//#include <qsscript.h>
+
+#include <QScriptValue>
+#include <QScriptEngine>
+#include <QScriptContext>
+
#include <qdialog.h>
//--#include <qwidgetfactory.h>
#include <qobject.h>
-#include <qsutilfactory.h>
-#include <qsinputdialogfactory.h>
+//#include <qsutilfactory.h>
+//#include <qsinputdialogfactory.h>
+
+
#include <qapplication.h>
//Added by qt3to4:
#include <QTimerEvent>
#include "ametaobject.h"
+static QScriptValue
+createObject(QScriptContext *context, QScriptEngine *engine) {
+ QObject *parent = context->argument(0).toQObject();
+ QObject *object = new QObject(parent);
+ return engine->newQObject(object, QScriptEngine::ScriptOwnership);
+}
+
+
/*!
* \~english
* Constructor
if ( ! db ) return;
- registerClass("MetaObject",&AMetaObject::staticMetaObject);
- registerClass("MetaGroup",&AMetaGroup::staticMetaObject);
- registerClass("Documents",&AMetaDocuments::staticMetaObject);
- registerClass("Catalogues",&AMetaCatalogues::staticMetaObject);
- registerClass("MetaInfo",&AMetaInfo::staticMetaObject);
- registerClass("MetaGlobal",&AMetaGlobal::staticMetaObject);
-
-
- registerClass("PopupMenu",&Q3PopupMenu::staticMetaObject);
-// registerClass("PopupMenu","QApopupmenu");
- registerClass("Document",&aDocument::staticMetaObject);
- registerClass("Catalogue",&aCatalogue::staticMetaObject);
- registerClass("CatalogEditor",&wCatalogEditor::staticMetaObject);
- registerClass("Report",&aReport::staticMetaObject);
- registerClass("ARegister",&aARegister::staticMetaObject);
- registerClass("IRegister",&aIRegister::staticMetaObject);
- registerClass("ATime",&aTime::staticMetaObject);
- registerClass("DataField",&aDataField::staticMetaObject);
-// registerClass("reg","QAreg");
- registerClass("Journal",&aDocJournal::staticMetaObject);
- registerClass("ComboBox",&AComboBox::staticMetaObject);
-//registerClass("djournalview","QAjournview");
-// registerClass("djournalview","QAdocjournal");
-// registerClass("form","AForms");
-// registerClass("report","QAreport");
-// registerClass("table","QAnanasTable");
+ QScriptValue ctor = engine->code->newFunction( &createObject);
+
+ engine->code->globalObject().setProperty("QObject",
+ engine->code->newQMetaObject(&QObject::staticMetaObject, ctor));
+ engine->code->globalObject().setProperty("MetaObject",
+ engine->code->newQMetaObject(&AMetaObject::staticMetaObject, ctor));
+ engine->code->globalObject().setProperty("MetaGroup",
+ engine->code->newQMetaObject(&AMetaGroup::staticMetaObject, ctor));
+ engine->code->globalObject().setProperty("Documents",
+ engine->code->newQMetaObject(&AMetaDocuments::staticMetaObject, ctor));
+ engine->code->globalObject().setProperty("Catalogues",
+ engine->code->newQMetaObject(&AMetaCatalogues::staticMetaObject, ctor));
+ engine->code->globalObject().setProperty("MetaInfo",
+ engine->code->newQMetaObject(&AMetaInfo::staticMetaObject, ctor));
+ engine->code->globalObject().setProperty("MetaGlobal",
+ engine->code->newQMetaObject(&AMetaGlobal::staticMetaObject, ctor));
+ engine->code->globalObject().setProperty("PopupMenu",
+ engine->code->newQMetaObject(&Q3PopupMenu::staticMetaObject, ctor));
+ engine->code->globalObject().setProperty("Document",
+ engine->code->newQMetaObject(&aDocument::staticMetaObject, ctor));
+ engine->code->globalObject().setProperty("Catalogue",
+ engine->code->newQMetaObject(&aCatalogue::staticMetaObject, ctor));
+ engine->code->globalObject().setProperty("CatalogEditor",
+ engine->code->newQMetaObject(&wCatalogEditor::staticMetaObject, ctor));
+ engine->code->globalObject().setProperty("Report",
+ engine->code->newQMetaObject(&aReport::staticMetaObject, ctor));
+ engine->code->globalObject().setProperty("ARegister",
+ engine->code->newQMetaObject(&aARegister::staticMetaObject, ctor));
+ engine->code->globalObject().setProperty("IRegister",
+ engine->code->newQMetaObject(&aIRegister::staticMetaObject, ctor));
+ engine->code->globalObject().setProperty("Time",
+ engine->code->newQMetaObject(&aTime::staticMetaObject, ctor));
+ engine->code->globalObject().setProperty("DataField",
+ engine->code->newQMetaObject(&aDataField::staticMetaObject, ctor));
+ engine->code->globalObject().setProperty("DocJournal",
+ engine->code->newQMetaObject(&aDocJournal::staticMetaObject, ctor));
+ engine->code->globalObject().setProperty("ComboBox",
+ engine->code->newQMetaObject(&AComboBox::staticMetaObject, ctor));
+
+
+// registerClass("MetaObject",&AMetaObject::staticMetaObject);
+// registerClass("MetaGroup",&AMetaGroup::staticMetaObject);
+// registerClass("Documents",&AMetaDocuments::staticMetaObject);
+// registerClass("Catalogues",&AMetaCatalogues::staticMetaObject);
+// registerClass("MetaInfo",&AMetaInfo::staticMetaObject);
+// registerClass("MetaGlobal",&AMetaGlobal::staticMetaObject);
+//
+//
+// registerClass("PopupMenu",&Q3PopupMenu::staticMetaObject);
+// registerClass("Document",&aDocument::staticMetaObject);
+// registerClass("Catalogue",&aCatalogue::staticMetaObject);
+// registerClass("CatalogEditor",&wCatalogEditor::staticMetaObject);
+// registerClass("Report",&aReport::staticMetaObject);
+// registerClass("ARegister",&aARegister::staticMetaObject);
+// registerClass("IRegister",&aIRegister::staticMetaObject);
+// registerClass("ATime",&aTime::staticMetaObject);
+// registerClass("DataField",&aDataField::staticMetaObject);
+// registerClass("Journal",&aDocJournal::staticMetaObject);
+// registerClass("ComboBox",&AComboBox::staticMetaObject);
//Register extensions classes
QStringList extlist = AExtensionFactory::keys();
for ( int i=0; i<extlist.count(); i++){
- registerClass(extlist[i], AExtensionFactory::metaObject( extlist[i] ));
- }
+// registerClass(extlist[i], AExtensionFactory::metaObject( extlist[i] ));
+ engine->code->globalObject().setProperty(extlist[i],
+ engine->code->newQMetaObject(AExtensionFactory::metaObject( extlist[i] ), ctor));
+ }
}
-
/*!
* \~english
* Creates script object. Mapping Script name to real name.
debugger->attachTo(code); //окно дебагера появится при ошибке выполнении скрипта
//code->addObjectFactory( new QSInputDialogFactory );
- code->addObjectFactory( new aObjectsFactory( this ) );
+ //code->addObjectFactory( new aObjectsFactory( this ) );
//code->addObjectFactory( new QSUtilFactory );
//project.addObject( this );
// Объект sys часто используется для вывода сообщений в окно сообщений
- QScriptValue ananasEngineObject = code.newQObject(this);
- code.globalObject().setProperty("sys", ananasEngineObject);
+ QScriptValue ananasEngineObject = code->newQObject(this);
+ code->globalObject().setProperty("sys", ananasEngineObject);
//project.addObject( md );
// Похоже не используется
- QScriptValue ananasMetadataObject = code.newQObject(md*);
- code.globalObject().setProperty("Metadata", ananasMetadataObject);
+ QScriptValue ananasMetadataObject = code->newQObject(md);
+ code->globalObject().setProperty("Metadata", ananasMetadataObject);
// project.addObject( AMetaData::metadata() );
- QScriptValue ananasMetadataData = code.newQObject(md*);
- code.globalObject().setProperty("MetaData", ananasMetadataData);
+ QScriptValue ananasMetadataData = code->newQObject(md);
+ code->globalObject().setProperty("MetaData", ananasMetadataData);
mGlobal = md->sText( md->find( md->find( mdc_metadata ), md_globals, 0 ), md_sourcecode );
if ( ! mGlobal.isEmpty() ) {
code->evaluate(sysf+sourcePreprocessor(mGlobal));
int
aEngine::on_systemstart(){
- if (project.interpreter()->functions().findIndex("on_systemstart")!=-1) {
- project.interpreter()->call("on_systemstart",QVariantList());
- }
+// if (project.interpreter()->functions().findIndex("on_systemstart")!=-1) {
+// project.interpreter()->call("on_systemstart",QVariantList());
+// }
+ if ( code->globalObject().property("on_systemstart").isValid() ){
+ code->globalObject().property("on_systemstart").call();
+ }
+
return 0;
}
void
aEngine::on_event( const QString &data )
{
- Q3ValueList<QVariant> lst;
- lst << sender()->name();
- lst << data;
- if (project.interpreter()->functions().findIndex("on_event")!=-1) {
- project.interpreter()->call("on_event", QVariantList(lst));
- }
+// Q3ValueList<QVariant> lst;
+// lst << sender()->name();
+// lst << data;
+// if (project.interpreter()->functions().findIndex("on_event")!=-1) {
+// project.interpreter()->call("on_event", QVariantList(lst));
+// }
+ if ( code->globalObject().property("on_event").isValid() ){
+ QScriptValueList list;
+ list.append(QScriptValue(sender()->name()));
+// list.append( engine->code->newVariant(val));
+ list.append(QScriptValue(data));
+ code->globalObject().property("on_event")
+ .call(QScriptValue(),list);
+ }
+
emit event( sender()->name(), data );
}
*/
int
aEngine::on_systemstop(){
- if (project.interpreter()->functions().findIndex("on_systemstop")!=-1) {
- project.interpreter()->call("on_systemstop",QVariantList());
- }
+// if (project.interpreter()->functions().findIndex("on_systemstop")!=-1) {
+// project.interpreter()->call("on_systemstop",QVariantList());
+// }
+ if ( code->globalObject().property("on_systemstop").isValid() ){
+ code->globalObject().property("on_systemstop").call();
+ }
+
return 0;
}
case 1:
aModule = md->sText( act, md_sourcecode );
if ( !aModule.isEmpty() ) {
- code->evaluate( sourcePreprocessor(aModule), context, md->attr( act, mda_name ) );
- }
+// code->evaluate( sourcePreprocessor(aModule),
+// context, md->attr( act, mda_name ) );
+ code->evaluate( sourcePreprocessor(aModule));
+ }
break;
case 2:
break;
void
aEngine::error ( const QString & message, QObject * context, const QString & scriptName, int lineNumber )
{
- Message( 2, tr("Line:%1 Message:%2 Stack:(%3)").arg(lineNumber).arg(message).arg(code->stackTraceString()) );
+ if (code->uncaughtException().isValid()) {
+ Message( 2, tr("Line:%1 Message:%2 Stack:(%3)")
+ .arg(lineNumber)
+ .arg(message)
+ .arg(code->uncaughtException().toString()) );
+ } else {
+ Message( 2, tr("Line:%1 Message:%2")
+ .arg(lineNumber)
+ .arg(message)
+ );
+ }
}
//#include <qsinterpreter.h>
#include <qscriptengine.h>
#include <qscriptenginedebugger.h>
+#include <QScriptValue>
//Added by qt3to4:
#include <QTimerEvent>
* \~
*/
QScriptEngine* code;
- QScriptEngineDebugger debugger;
+ QScriptEngineDebugger* debugger;
/*!
* \~english
* link to script project.
SUBDIRS += lib plugins
SUBDIRS += designer ananas admin
SUBDIRS += extensions
+SUBDIRS += editor
#TRANSLATIONS = \
# ../translations/ananas-en.ts \