-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'v1' of https://github.com/tgerring/qml into tgerring-v1
# Conflicts: # cpp/idletimer.cpp
- Loading branch information
Showing
18 changed files
with
289 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include <QObject> | ||
#include <QtCore/QObject> | ||
|
||
#include "connector.h" | ||
#include "capi.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#ifndef CONNECTOR_H | ||
#define CONNECTOR_H | ||
|
||
#include <QObject> | ||
#include <QtCore/QObject> | ||
|
||
#include <stdint.h> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
|
||
"gopkg.in/qml.v1" | ||
) | ||
|
||
func main() { | ||
if err := qml.Run(run); err != nil { | ||
fmt.Fprintf(os.Stderr, "error: %v\n", err) | ||
os.Exit(1) | ||
} | ||
} | ||
|
||
func run() error { | ||
// I genqrc "../res" | ||
qml.SetWindowIcon(":../res/1.ico") | ||
|
||
engine := qml.NewEngine() | ||
controls, err := engine.LoadFile("qrc:///../res/main.qml") | ||
if err != nil { | ||
return err | ||
} | ||
|
||
window := controls.CreateWindow(nil) | ||
|
||
window.Show() | ||
window.Wait() | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
|
||
"gopkg.in/qml.v1" | ||
) | ||
|
||
func main() { | ||
if err := qml.Run(run); err != nil { | ||
fmt.Fprintf(os.Stderr, "error: %v\n", err) | ||
os.Exit(1) | ||
} | ||
} | ||
|
||
func run() error { | ||
qml.SetWindowIcon("../res/1.ico") | ||
|
||
engine := qml.NewEngine() | ||
controls, err := engine.LoadFile("../res/main.qml") | ||
if err != nil { | ||
return err | ||
} | ||
|
||
window := controls.CreateWindow(nil) | ||
|
||
window.Show() | ||
window.Wait() | ||
return nil | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/**************************************************************************** | ||
** | ||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). | ||
** Contact: http://www.qt-project.org/legal | ||
** | ||
** This file is part of the Qt Quick Controls module of the Qt Toolkit. | ||
** | ||
** $QT_BEGIN_LICENSE:BSD$ | ||
** You may use this file under the terms of the BSD license as follows: | ||
** | ||
** "Redistribution and use in source and binary forms, with or without | ||
** modification, are permitted provided that the following conditions are | ||
** met: | ||
** * Redistributions of source code must retain the above copyright | ||
** notice, this list of conditions and the following disclaimer. | ||
** * Redistributions in binary form must reproduce the above copyright | ||
** notice, this list of conditions and the following disclaimer in | ||
** the documentation and/or other materials provided with the | ||
** distribution. | ||
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names | ||
** of its contributors may be used to endorse or promote products derived | ||
** from this software without specific prior written permission. | ||
** | ||
** | ||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." | ||
** | ||
** $QT_END_LICENSE$ | ||
** | ||
****************************************************************************/ | ||
|
||
|
||
|
||
|
||
|
||
import QtQuick 2.2 | ||
import QtQuick.Controls 1.1 | ||
|
||
ApplicationWindow { | ||
visible: true | ||
width: 50 | ||
height: 50 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
|
||
"gopkg.in/qml.v1" | ||
"gopkg.in/qml.v1/webengine" | ||
) | ||
|
||
func main() { | ||
fmt.Println(qml.Run(func() error { | ||
webengine.Initialize() | ||
|
||
engine := qml.NewEngine() | ||
engine.On("quit", func() { os.Exit(0) }) | ||
|
||
component, err := engine.LoadFile("webengine.qml") | ||
if err != nil { | ||
return err | ||
} | ||
win := component.CreateWindow(nil) | ||
win.Show() | ||
win.Wait() | ||
return nil | ||
})) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import QtQuick 2.1 | ||
import QtWebEngine 1.0 | ||
import QtQuick.Controls 1.0 | ||
|
||
ApplicationWindow { | ||
id: root | ||
width: 1024 | ||
height: 768 | ||
|
||
WebEngineView { | ||
anchors.fill: parent | ||
url: "http://codingame.com" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include <QtWebEngine> | ||
#include "webengine.h" | ||
|
||
void webengineInitialize() { | ||
QtWebEngine::initialize(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package webengine | ||
|
||
// #cgo CPPFLAGS: -I./ | ||
// #cgo CXXFLAGS: -std=c++0x -pedantic-errors -Wall -fno-strict-aliasing | ||
// #cgo LDFLAGS: -lstdc++ | ||
// #cgo pkg-config: Qt5WebEngine | ||
// | ||
// #include "webengine.h" | ||
import "C" | ||
|
||
import ( | ||
"gopkg.in/qml.v1" | ||
) | ||
|
||
// Initializes the WebEngine extension. | ||
func Initialize() { | ||
qml.RunMain(func() { | ||
C.webengineInitialize() | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifndef WEBENGINE_H | ||
#define WEBENGINE_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
void webengineInitialize(); | ||
|
||
#ifdef __cplusplus | ||
} // extern "C" | ||
#endif | ||
|
||
#endif // WEBENGINE_H |