diff options
Diffstat (limited to 'kjsembed/docs/embedding/qtembed')
-rw-r--r-- | kjsembed/docs/embedding/qtembed/main.cpp | 18 | ||||
-rwxr-xr-x | kjsembed/docs/embedding/qtembed/posviewbase.ui | 183 | ||||
-rw-r--r-- | kjsembed/docs/embedding/qtembed/posviewimp.cpp | 30 | ||||
-rw-r--r-- | kjsembed/docs/embedding/qtembed/posviewimp.h | 26 | ||||
-rwxr-xr-x | kjsembed/docs/embedding/qtembed/qtembed.pro | 12 | ||||
-rw-r--r-- | kjsembed/docs/embedding/qtembed/test.js | 3 | ||||
-rwxr-xr-x | kjsembed/docs/embedding/qtembed/view.ui | 85 |
7 files changed, 357 insertions, 0 deletions
diff --git a/kjsembed/docs/embedding/qtembed/main.cpp b/kjsembed/docs/embedding/qtembed/main.cpp new file mode 100644 index 00000000..b2d7d3d1 --- /dev/null +++ b/kjsembed/docs/embedding/qtembed/main.cpp @@ -0,0 +1,18 @@ +// +// Author: Ian Reinhart Geiser <geiseri@kde.org>, (C) 2004 +// +// Copyright: See COPYING file that comes with this distribution +// +// + +#include <qapplication.h> +#include "posviewimp.h" + +int main ( int argc, char ** argv ) +{ + QApplication app( argc, argv ); + POSViewImp *view = new POSViewImp; + app.setMainWidget(view); + view->show(); + return app.exec(); +} diff --git a/kjsembed/docs/embedding/qtembed/posviewbase.ui b/kjsembed/docs/embedding/qtembed/posviewbase.ui new file mode 100755 index 00000000..9d8bad1a --- /dev/null +++ b/kjsembed/docs/embedding/qtembed/posviewbase.ui @@ -0,0 +1,183 @@ +<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> +<class>POSViewBase</class> +<widget class="QDialog"> + <property name="name"> + <cstring>POSViewBase</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>492</width> + <height>298</height> + </rect> + </property> + <property name="caption"> + <string>Point of Sale v1.0</string> + </property> + <property name="sizeGripEnabled"> + <bool>true</bool> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>layout3</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QFrame"> + <property name="name"> + <cstring>appFrame</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>5</vsizetype> + <horstretch>1</horstretch> + <verstretch>1</verstretch> + </sizepolicy> + </property> + <property name="frameShape"> + <enum>StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>Raised</enum> + </property> + </widget> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>layout2</cstring> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLabel"> + <property name="name"> + <cstring>textLabel2</cstring> + </property> + <property name="text"> + <string>Recipt</string> + </property> + </widget> + <widget class="QTextBrowser"> + <property name="name"> + <cstring>recipt</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>7</vsizetype> + <horstretch>1</horstretch> + <verstretch>1</verstretch> + </sizepolicy> + </property> + <property name="textFormat"> + <enum>LogText</enum> + </property> + </widget> + </vbox> + </widget> + </hbox> + </widget> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>Layout1</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QPushButton"> + <property name="name"> + <cstring>buttonHelp</cstring> + </property> + <property name="text"> + <string>&Help</string> + </property> + <property name="accel"> + <string>F1</string> + </property> + <property name="autoDefault"> + <bool>true</bool> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>Horizontal Spacing2</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="QPushButton"> + <property name="name"> + <cstring>buttonOk</cstring> + </property> + <property name="text"> + <string>&OK</string> + </property> + <property name="accel"> + <string></string> + </property> + <property name="autoDefault"> + <bool>true</bool> + </property> + <property name="default"> + <bool>true</bool> + </property> + </widget> + <widget class="QPushButton"> + <property name="name"> + <cstring>buttonCancel</cstring> + </property> + <property name="text"> + <string>&Cancel</string> + </property> + <property name="accel"> + <string></string> + </property> + <property name="autoDefault"> + <bool>true</bool> + </property> + </widget> + </hbox> + </widget> + </vbox> +</widget> +<connections> + <connection> + <sender>buttonOk</sender> + <signal>clicked()</signal> + <receiver>POSViewBase</receiver> + <slot>accept()</slot> + </connection> + <connection> + <sender>buttonCancel</sender> + <signal>clicked()</signal> + <receiver>POSViewBase</receiver> + <slot>reject()</slot> + </connection> +</connections> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/kjsembed/docs/embedding/qtembed/posviewimp.cpp b/kjsembed/docs/embedding/qtembed/posviewimp.cpp new file mode 100644 index 00000000..7d4aebc9 --- /dev/null +++ b/kjsembed/docs/embedding/qtembed/posviewimp.cpp @@ -0,0 +1,30 @@ +// +// Author: Ian Reinhart Geiser <geiseri@kde.org>, (C) 2004 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "posviewimp.h" + +#include <kjsembed/kjsembedpart.h> +#include <kjsembed/jsconsolewidget.h> +#include <kjsembed/jsbinding.h> + +#include <qgroupbox.h> +#include <qdatetime.h> +#include <qcolor.h> + +POSViewImp::POSViewImp(QWidget *parent, const char *name) + :POSViewBase(parent, name) +{ + m_part = new KJSEmbed::KJSEmbedPart(0, "kjsembed_part", this,"JSEmbed"); + m_part->addObject(appFrame, "appFrame"); + loadScript(); +} + +void POSViewImp::loadScript() +{ + m_part->runFile("test.js", m_part->globalObject() ); +} + + diff --git a/kjsembed/docs/embedding/qtembed/posviewimp.h b/kjsembed/docs/embedding/qtembed/posviewimp.h new file mode 100644 index 00000000..3fce0965 --- /dev/null +++ b/kjsembed/docs/embedding/qtembed/posviewimp.h @@ -0,0 +1,26 @@ +// +// Author: Ian Reinhart Geiser <geiseri@kde.org>, (C) 2004 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef POSVIEWIMP_H +#define POSVIEWIMP_H + +#include "posviewbase.h" +namespace KJSEmbed { + class KJSEmbedPart; +}; + +class POSViewImp: public POSViewBase { + Q_OBJECT +public: + POSViewImp( QWidget *parent = 0, const char *name = 0 ); + +public slots: + void loadScript(); +private: + KJSEmbed::KJSEmbedPart *m_part; +}; + +#endif diff --git a/kjsembed/docs/embedding/qtembed/qtembed.pro b/kjsembed/docs/embedding/qtembed/qtembed.pro new file mode 100755 index 00000000..5b0f4c6b --- /dev/null +++ b/kjsembed/docs/embedding/qtembed/qtembed.pro @@ -0,0 +1,12 @@ +include( ../../../qjsembed.pri ) +TEMPLATE = app + +# Input +HEADERS += posviewimp.h +INTERFACES += posviewbase.ui +SOURCES += main.cpp posviewimp.cpp + + +LIBS += -L../../../bin -lqjsembed +INCLUDEPATH += ../../../.. ../../.. + diff --git a/kjsembed/docs/embedding/qtembed/test.js b/kjsembed/docs/embedding/qtembed/test.js new file mode 100644 index 00000000..7a5c3bc0 --- /dev/null +++ b/kjsembed/docs/embedding/qtembed/test.js @@ -0,0 +1,3 @@ +var vbox = new QVBoxLayout( appFrame ); +var view = Factory.loadui("view.ui", appFrame, appFrame ); +view.show();
\ No newline at end of file diff --git a/kjsembed/docs/embedding/qtembed/view.ui b/kjsembed/docs/embedding/qtembed/view.ui new file mode 100755 index 00000000..c714ff00 --- /dev/null +++ b/kjsembed/docs/embedding/qtembed/view.ui @@ -0,0 +1,85 @@ +<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> +<class>view</class> +<widget class="QWidget"> + <property name="name"> + <cstring>view</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>285</width> + <height>197</height> + </rect> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>layout1</cstring> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLineEdit" row="1" column="1"> + <property name="name"> + <cstring>mSKU</cstring> + </property> + </widget> + <widget class="QLineEdit" row="2" column="1"> + <property name="name"> + <cstring>mPrice</cstring> + </property> + </widget> + <widget class="QLabel" row="1" column="0"> + <property name="name"> + <cstring>textLabel2</cstring> + </property> + <property name="text"> + <string>SKU:</string> + </property> + </widget> + <widget class="QLabel" row="2" column="0"> + <property name="name"> + <cstring>textLabel3</cstring> + </property> + <property name="text"> + <string>Price:</string> + </property> + </widget> + <widget class="QLabel" row="0" column="0"> + <property name="name"> + <cstring>textLabel1</cstring> + </property> + <property name="text"> + <string>Product:</string> + </property> + </widget> + <widget class="QComboBox" row="0" column="1"> + <property name="name"> + <cstring>mProduct</cstring> + </property> + <property name="autoCompletion"> + <bool>true</bool> + </property> + </widget> + </grid> + </widget> + <widget class="QLabel"> + <property name="name"> + <cstring>mImage</cstring> + </property> + <property name="text"> + <string></string> + </property> + <property name="scaledContents"> + <bool>true</bool> + </property> + </widget> + </vbox> +</widget> +<layoutdefaults spacing="6" margin="11"/> +</UI> |