-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Commit des tvx en cours sur QML. Ne devrait impacter que le build en
debug
- Loading branch information
dguihal@gmail.com
committed
Jul 11, 2014
1 parent
20a1afc
commit 16174b7
Showing
10 changed files
with
461 additions
and
206 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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import QtQuick 2.0 | ||
import QtQuick.Controls 1.2 | ||
import QtQuick.Layouts 1.1 | ||
import org.moules.quteqoin 1.0 | ||
|
||
|
||
ApplicationWindow { | ||
id: root | ||
width: 400 | ||
height: 600 | ||
visible: true | ||
|
||
ColumnLayout { | ||
id: mainLayout | ||
anchors.fill: parent | ||
anchors.margins: 2 | ||
spacing: 2 | ||
|
||
RowLayout { | ||
spacing: 2 | ||
|
||
ComboBox { | ||
id: tabCB | ||
Layout.fillWidth: true | ||
Layout.alignment: Qt.AlignVCenter | ||
model: [ "Main", "Slow", "ReadOnly" ] | ||
} | ||
|
||
Button { | ||
Layout.minimumWidth: 24 | ||
Layout.maximumWidth: 24 | ||
Layout.minimumHeight: 24 | ||
Layout.maximumHeight: 24 | ||
Layout.alignment: Qt.AlignVCenter | ||
|
||
iconSource: "/img/settings-icon.png" | ||
} | ||
} | ||
|
||
TextArea { | ||
id: textArea | ||
|
||
Layout.fillHeight: true | ||
Layout.fillWidth: true | ||
|
||
readOnly: true | ||
wrapMode: TextEdit.Wrap | ||
} | ||
|
||
DocumentHandler { | ||
id: document | ||
target: textArea | ||
cursorPosition: textArea.cursorPosition | ||
selectionStart: textArea.selectionStart | ||
selectionEnd: textArea.selectionEnd | ||
} | ||
|
||
QQmlPalmi { | ||
id: palmi | ||
Layout.fillWidth: true | ||
} | ||
} | ||
} |
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,28 @@ | ||
import QtQuick 2.0 | ||
import QtQuick.Controls 1.2 | ||
import QtQuick.Layouts 1.1 | ||
|
||
Item { | ||
id:root | ||
height: postInput.height | ||
|
||
ColumnLayout { | ||
id: mainLayout | ||
anchors.fill: parent | ||
|
||
RowLayout { | ||
spacing: 2 | ||
|
||
TextField { | ||
Layout.fillWidth: true | ||
id: postInput | ||
placeholderText: "coin ! coin !" | ||
} | ||
|
||
Button { | ||
id: postBtn | ||
text: qsTr("Post") | ||
} | ||
} | ||
} | ||
} |
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 @@ | ||
import QtQuick 2.0 | ||
|
||
Pinnipede { | ||
width: 100 | ||
height: 62 | ||
} |
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,45 @@ | ||
#include "documenthandler.h" | ||
|
||
DocumentHandler::DocumentHandler(QObject *parent) : | ||
QObject(parent), | ||
m_target(0), | ||
m_doc(0), | ||
m_cursorPosition(-1), | ||
m_selectionStart(0), | ||
m_selectionEnd(0) | ||
{ | ||
} | ||
|
||
void DocumentHandler::setTarget(QQuickItem *target) | ||
{ | ||
m_doc = 0; | ||
m_target = target; | ||
if (!m_target) | ||
return; | ||
|
||
QVariant doc = m_target->property("textDocument"); | ||
if (doc.canConvert<QQuickTextDocument*>()) { | ||
QQuickTextDocument *qqdoc = doc.value<QQuickTextDocument*>(); | ||
if (qqdoc) | ||
m_doc = qqdoc->textDocument(); | ||
} | ||
emit targetChanged(); | ||
} | ||
|
||
void DocumentHandler::setCursorPosition(int position) | ||
{ | ||
if (position == m_cursorPosition) | ||
return; | ||
|
||
m_cursorPosition = position; | ||
} | ||
|
||
void DocumentHandler::setSelectionStart(int position) | ||
{ | ||
m_selectionStart = position; | ||
} | ||
|
||
void DocumentHandler::setSelectionEnd(int position) | ||
{ | ||
m_selectionEnd = position; | ||
} |
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,51 @@ | ||
#ifndef DOCUMENTHANDLER_H | ||
#define DOCUMENTHANDLER_H | ||
|
||
#include <QQuickTextDocument> | ||
|
||
QT_BEGIN_NAMESPACE | ||
class QTextDocument; | ||
QT_END_NAMESPACE | ||
|
||
class DocumentHandler : public QObject | ||
{ | ||
Q_OBJECT | ||
|
||
Q_PROPERTY(QQuickItem *target READ target WRITE setTarget NOTIFY targetChanged) | ||
Q_PROPERTY(int cursorPosition READ cursorPosition WRITE setCursorPosition NOTIFY cursorPositionChanged) | ||
Q_PROPERTY(int selectionStart READ selectionStart WRITE setSelectionStart NOTIFY selectionStartChanged) | ||
Q_PROPERTY(int selectionEnd READ selectionEnd WRITE setSelectionEnd NOTIFY selectionEndChanged) | ||
|
||
public: | ||
explicit DocumentHandler(QObject *parent = 0); | ||
|
||
QQuickItem *target() { return m_target; } | ||
|
||
void setTarget(QQuickItem *target); | ||
|
||
void setCursorPosition(int position); | ||
void setSelectionStart(int position); | ||
void setSelectionEnd(int position); | ||
|
||
int cursorPosition() const { return m_cursorPosition; } | ||
int selectionStart() const { return m_selectionStart; } | ||
int selectionEnd() const { return m_selectionEnd; } | ||
|
||
signals: | ||
void targetChanged(); | ||
void cursorPositionChanged(); | ||
void selectionStartChanged(); | ||
void selectionEndChanged(); | ||
|
||
public slots: | ||
|
||
private: | ||
QQuickItem *m_target; | ||
QTextDocument *m_doc; | ||
|
||
int m_cursorPosition; | ||
int m_selectionStart; | ||
int m_selectionEnd; | ||
}; | ||
|
||
#endif // DOCUMENTHANDLER_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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<RCC> | ||
<qresource prefix="/qml"> | ||
<file>QQmlMain.qml</file> | ||
<file>QQmlPalmi.qml</file> | ||
</qresource> | ||
</RCC> |
Oops, something went wrong.