Commit 8d643506 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander Trofimov

test web menu

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@57488 954022d7-b5bf-4e40-9824-e11837661b57
parent d9ce02d6
......@@ -398,6 +398,10 @@ DesktopEditor/Qt_build/test_resources/document/media/image2.jpg svn_mime_002dtyp
DesktopEditor/Qt_build/test_resources/document/media/image3.png svn_mime_002dtype=application%2Foctet-stream
DesktopEditor/Qt_build/test_resources/document/media/image4.png svn_mime_002dtype=application%2Foctet-stream
DesktopEditor/Qt_build/test_resources/document/media/image5.png svn_mime_002dtype=application%2Foctet-stream
DesktopEditor/Qt_build/test_web svnc_tsvn_003alogminsize=5
DesktopEditor/Qt_build/test_web/Debug svnc_tsvn_003alogminsize=5
DesktopEditor/Qt_build/test_web/Release svnc_tsvn_003alogminsize=5
DesktopEditor/Qt_build/test_web/control svnc_tsvn_003alogminsize=5
DesktopEditor/Teamlab[!!-~]Editor[!!-~]IOS/Document[!!-~]Editor/Document[!!-~]Editor.xcodeproj/project.xcworkspace/xcuserdata/Korol.xcuserdatad/UserInterfaceState.xcuserstate svn_mime_002dtype=application%2Foctet-stream
DesktopEditor/Teamlab[!!-~]Editor[!!-~]IOS/Document[!!-~]Editor/Document[!!-~]Editor.xcodeproj/project.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate svn_mime_002dtype=application%2Foctet-stream
DesktopEditor/Teamlab[!!-~]Editor[!!-~]IOS/Document[!!-~]Editor/ios_app_resources/media/image1.jpg svn_mime_002dtype=application%2Foctet-stream
......
#ifndef TEST_NATIVECONTROL_H
#define TEST_NATIVECONTROL_H
#include <QApplication>
#include <QGraphicsView>
#include "../../editor/project/NativeControl.h"
class NativeControl : public CNativeCtrl
{
public:
NativeControl(QWidget *parent = 0, const char *name = NULL) : CNativeCtrl(parent, name)
{
}
virtual ~NativeControl()
{
}
public:
virtual void initializeGL()
{
CNativeCtrl::initializeGL();
QString sBasePath = QApplication::applicationDirPath();
QString sDebug = "Debug";
QString sRelease = "Release";
int n1 = sBasePath.lastIndexOf(sDebug);
int n2 = sBasePath.lastIndexOf(sRelease);
if (n1 < 0 && n2 < 0)
return;
int nCount = 0;
if (n1 > n2)
{
nCount = n1 + sDebug.length();
}
else
{
nCount = n2 + sRelease.length();
}
if (nCount != sBasePath.length())
{
sBasePath = sBasePath.mid(0, nCount);
}
QString sFontsPath = sBasePath + "/../../../../../OfficeWeb/Fonts/native";
QString sSdkPath = sBasePath + "/../../test_resources/sdk-all.js";
QString sDocumentPath = sBasePath + "/../../test_resources/document/Editor.bin";
std::wstring s1 = sFontsPath.toStdWString();
std::wstring s2 = sSdkPath.toStdWString();
std::wstring s3 = sDocumentPath.toStdWString();
InitSDK(s1, s2);
OpenFile(s3);
}
};
#endif // TEST_NATIVECONTROL_H
#-------------------------------------------------
#
# Project created by QtCreator 2014-03-22T17:09:03
#
#-------------------------------------------------
QT += core gui opengl webkit webkitwidgets
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = control
TEMPLATE = app
DEFINES += \
_QT
CONFIG(debug, debug|release) {
LIBS += -L../../editor/Debug/debug -lnative_control
LIBS += -L../../graphics/Debug/debug -lgraphics
message(debug)
} else {
LIBS += -L../../editor/Release/release -lnative_control
LIBS += -L../../graphics/Release/release -lgraphics
message(release)
}
linux-g++ | linux-g++-64 | linux-g++-32 {
DEFINES += \
LINUX \
_LINUX \
_LINUX_QT
LIBS += -L../../../../../../../../../v8/out/native/obj.target/tools/gyp -lv8_base.ia32
LIBS += -L../../../../../../../../../v8/out/native/obj.target/tools/gyp -lv8_snapshot
LIBS += -L../../../../../../../../../v8/out/native/obj.target/tools/gyp -lv8_nosnapshot.ia32
LIBS += -L../../../../../../../../../v8/out/native/obj.target/third_party/icu -licui18n
LIBS += -L../../../../../../../../../v8/out/native/obj.target/third_party/icu -licuuc
LIBS += -L../../../../../../../../../v8/out/native/obj.target/third_party/icu -licudata
message(linux)
}
mac {
DEFINES += \
LINUX \
_LINUX \
_LINUX_QT \
_MAC \
QT_MAC
LIBS += -L../../../../../../../../../v8/out/native -lv8_base.x64
LIBS += -L../../../../../../../../../v8/out/native -lv8_snapshot
LIBS += -L../../../../../../../../../v8/out/native -lv8_nosnapshot.x64
LIBS += -L../../../../../../../../../v8/out/native -licui18n
LIBS += -L../../../../../../../../../v8/out/native -licuuc
LIBS += -L../../../../../../../../../v8/out/native -licudata
message(mac)
}
win32 {
DEFINES += \
WIN32
DEFINES -= UNICODE
LIBS += -lwinmm
LIBS += -ladvapi32
LIBS += -L../../../../../../../../../v8/build/Release/lib -lv8_base.x64
LIBS += -L../../../../../../../../../v8/build/Release/lib -lv8_snapshot
LIBS += -L../../../../../../../../../v8/build/Release/lib -lv8_nosnapshot.x64
LIBS += -L../../../../../../../../../v8/build/Release/lib -licui18n
LIBS += -L../../../../../../../../../v8/build/Release/lib -licuuc
message(windows)
}
INCLUDEPATH += \
../../../agg-2.4/include \
../../../freetype-2.5.2/include \
.../../../../../../../../../v8/include
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h \
NativeControl.h
FORMS += mainwindow.ui
This diff is collapsed.
#include "mainwindow.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDir>
#include <QUuid>
#include <QWebFrame>
#include <QLayout>
#include <QDialog>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
QString sBasePath = QApplication::applicationDirPath();
QString sDebug = "Debug";
QString sRelease = "Release";
int n1 = sBasePath.lastIndexOf(sDebug);
int n2 = sBasePath.lastIndexOf(sRelease);
if (n1 < 0 && n2 < 0)
return;
int nCount = 0;
if (n1 > n2)
{
nCount = n1 + sDebug.length();
}
else
{
nCount = n2 + sRelease.length();
}
if (nCount != sBasePath.length())
{
sBasePath = sBasePath.mid(0, nCount);
}
QString sFontsPath = sBasePath + "/../../../../../OfficeWeb/Fonts/native";
QString sSdkPath = sBasePath + "/../../test_resources/sdk-all.js";
QString sDocumentPath = sBasePath + "/../../test_resources/document/Editor.bin";
std::wstring s1 = sFontsPath.toStdWString();
std::wstring s2 = sSdkPath.toStdWString();
std::wstring s3 = sDocumentPath.toStdWString();
ui->widget->setGeometry(0, 0, this->width(), this->height());
ui->widget->InitSDK(s1, s2);
ui->widget->Init(s3);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::resizeEvent(QResizeEvent* e)
{
ui->widget->setGeometry(0, 0, this->width(), this->height());
}
void MainWindow::closeEvent(QCloseEvent* e)
{
ui->widget->closeEvent(e);
}
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private:
Ui::MainWindow *ui;
protected:
virtual void resizeEvent(QResizeEvent* e);
virtual void closeEvent(QCloseEvent* e);
};
#endif // MAINWINDOW_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>744</width>
<height>432</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralWidget">
<widget class="CNativeCtrlWebMenu" name="widget" native="true">
<property name="geometry">
<rect>
<x>120</x>
<y>60</y>
<width>511</width>
<height>271</height>
</rect>
</property>
</widget>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>744</width>
<height>21</height>
</rect>
</property>
</widget>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
<class>CNativeCtrlWebMenu</class>
<extends>QWidget</extends>
<header>../control/NativeControl.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment