2018年7月8日

Flow

モジュール

QtQuick 2.6

クラス継承

QQuickFlow → QQuickBasePositioner (internal) → QQuickImplicitSizeItem (internal) → QQuickItemQObject

プロパティー

flow: Flow = Flow.LeftToRight
layoutDirection: Qt::LayoutDirection = Qt.LeftToRight
effectiveLayoutDirection: Qt::LayoutDirection = Qt.LeftToRight readonly

spacing: double = 0 inherited
populate: QQuickTransition* = null inherited
move: QQuickTransition* = null inherited
add: QQuickTransition* = null inherited
padding: real = 0 inherited
topPadding: real = 0 inherited
leftPadding: real = 0 inherited
rightPadding: real = 0 inherited
bottomPadding: real = 0 inherited

implicitWidth: real = 0 readonly inherited override
implicitHeight: real = 0 readonly inherited override

シグナル

flowChanged()
layoutDirectionChanged()
effectiveLayoutDirectionChanged()

spacingChanged() inherited
populateChanged() inherited
moveChanged() inherited
addChanged() inherited
paddingChanged() inherited
topPaddingChanged() inherited
leftPaddingChanged() inherited
rightPaddingChanged() inherited
bottomPaddingChanged() inherited
positioningComplete() inherited

implicitWidthChanged() inherited
implicitHeightChanged() inherited

メソッド

public void forceLayout() inherited

スロット

protected void prePositioning() inherited

列挙

Flow
        LeftToRight = 0
        TopToBottom = 1

説明


プロパティーの説明

flow: Flow

layoutDirection: Qt::LayoutDirection

effectiveLayoutDirection: Qt::LayoutDirection


spacing: double

populate: QQuickTransition*

move: QQuickTransition*

add: QQuickTransition*

padding: real

topPadding: real

leftPadding: real

rightPadding: real

bottomPadding: real


implicitWidth: real = 0 readonly inherited override

implicitHeight: real = 0 readonly inherited override

シグナルの説明

positioningComplete() inherited

メソッドの説明

public void forceLayout() inherited

スロットの説明

protected void prePositioning() inherited

列挙の説明


参考情報

StackLayout

モジュール

QtQuick.Layouts 1.3

クラス継承

QQuickStackLayout → QQuickLayout (internal) → QQuickItem, QQuickItemChangeListener (internal) → QObject

プロパティー

count: int = 0 readonly
currentIndex: int = -1

シグナル

currentIndexChanged()
countChanged()

メソッド

public QQuickItem* itemAt(int index)

スロット

protected void invalidateSenderItem() inherited

説明


プロパティーの説明

count: int

currentIndex: int

メソッドの説明

public QQuickItem* itemAt(int index)

スロットの説明

protected void invalidateSenderItem() inherited

問題


StackLayout のリファレンスに itemAt() が記載されていない。

参考情報

GridLayout

モジュール

QtQuick.Layouts 1.0

クラス継承

QQuickRowLayout → QQuickGridLayoutBase (internal) → QQuickLayout (internal) → QQuickItem, QQuickItemChangeListener (internal) → QObject

プロパティー

columnSpacing: double = 5
rowSpacing: double = 5
columns: int = -1
rows: int = -1
flow: Flow = GridLayout.LeftToRight

layoutDirection: Qt::LayoutDirection = Qt.LeftToRight inherited

シグナル

columnSpacingChanged()
rowSpacingChanged()
columnsChanged()
rowsChanged()
flowChanged()

layoutDirectionChanged() inherited

スロット

protected void invalidateSenderItem() inherited

列挙

Flow
        LeftToRight
        TopToBottom

説明


プロパティーの説明

columnSpacing: double

rowSpacing: double

columns: int

rows: int

flow: Flow


layoutDirection: Qt::LayoutDirection

シグナルの説明

columnSpacingChanged()

rowSpacingChanged()

columnsChanged()

rowsChanged()

flowChanged()


layoutDirectionChanged()

スロットの説明

protected void invalidateSenderItem() inherited

列挙の説明


参考情報

Layout

モジュール

QtQuick.Layouts 1.2

クラス継承

QQuickLayout (internal) → QQuickItem, QQuickItemChangeListener (internal) → QObject

アタッチトプロパティー

minimumWidth: real = 0
minimumHeight: real = 0
preferredWidth: real = -1
preferredHeight: real = -1
maximumWidth: real = Infinity
maximumHeight: real = Infinity
fillHeight: bool = false
fillWidth: bool = false
row: int = 0
column: int = 0
rowSpan: int = 1
columnSpan: int = 1
alignment: Qt::Alignment = 0
margins: real = 0
leftMargin: real = 0
topMargin: real = 0
rightMargin: real = 0
bottomMargin: real = 0

シグナル

minimumWidthChanged()
minimumHeightChanged()
preferredWidthChanged()
preferredHeightChanged()
maximumWidthChanged()
maximumHeightChanged()
fillHeightChanged()
fillWidthChanged()
rowChanged()
columnChanged()
rowSpanChanged()
columnSpanChanged()
alignmentChanged()
marginsChanged()
leftMarginChanged()
topMarginChanged()
rightMarginChanged()
bottomMarginChanged()

説明


アタッチトプロパティーの説明

minimumWidth: real

minimumHeight: real

preferredWidth: real

preferredHeight: real

maximumWidth: real

maximumHeight: real

fillHeight: bool

fillWidth: bool

row: int

column: int

rowSpan: int

columnSpan: int

alignment: Qt::Alignment

margins: real

leftMargin: real

topMargin: real

rightMargin: real

bottomMargin: real

参考情報

2018年7月7日

RowLayout

モジュール

QtQuick.Layouts 1.0

クラス継承

QQuickRowLayout → QQuickLinearLayout (internal) → QQuickGridLayoutBase (internal) → QQuickLayout (internal) → QQuickItem, QQuickItemChangeListener (internal) → QObject

プロパティー

layoutDirection: Qt::LayoutDirection = Qt.LeftToRight inherited
spacing: real = 5 inherited

シグナル

layoutDirectionChanged() inherited
spacingChanged() inherited

スロット

protected void invalidateSenderItem() inherited

説明


プロパティーの説明

layoutDirection: Qt::LayoutDirection

spacing: real

スロットの説明

protected void invalidateSenderItem()

参考情報

ColumnLayout

モジュール

QtQuick.Layouts 1.0

クラス継承

QQuickColumnLayout → QQuickLinearLayout (internal) → QQuickGridLayoutBase (internal) → QQuickLayout (internal) → QQuickItem, QQuickItemChangeListener (internal) → QObject

プロパティー

layoutDirection: Qt::LayoutDirection = Qt.LeftToRight inherited
spacing: real = 5 inherited

シグナル

layoutDirectionChanged() inherited
spacingChanged() inherited

スロット

protected void invalidateSenderItem() inherited

説明


プロパティーの説明

layoutDirection: Qt::LayoutDirection

spacing: real

スロットの説明

protected void invalidateSenderItem()

参考情報

2018年7月6日

AngleDirection

モジュール

QtQuick.Particles 2.0

クラス継承

QQuickAngleDirection → QQuickDirection (internal) → QObject

プロパティー

angle: real = 0
magnitude: real = 0
angleVariation: real = 0
magnitudeVariation: real = 0

シグナル

angleChanged(real arg)
magnitudeChanged(real arg)
angleVariationChanged(real arg)
magnitudeVariationChanged(real arg)

スロット

void setAngle(real arg)
void setMagnitude(real arg)
void setAngleVariation(real arg)
void setMagnitudeVariation(real arg)

説明


プロパティーの説明

angle: real

magnitude: real

angleVariation: real

magnitudeVariation: real

スロットの説明

void setAngle(real arg)

void setMagnitude(real arg)

void setAngleVariation(real arg)

void setMagnitudeVariation(real arg)

参考情報

2018年5月19日

PropertyAction

モジュール

QtQuick 2.0

クラス継承

QQuickPropertyAction → QQuickAbstractAnimation (internal) → QObject

プロパティー

exclude: list<QtObject> = [] readonly
properties: string = ""
property: string = ""
target: QtObject = null
targets: list<QtObject> = [] readonly
value: QVariant = undefined

シグナル

targetChanged()
propertiesChanged(string)
propertyChanged()
valueChanged(QVariant)

説明


プロパティーの説明

exclude: list<QtObject>

properties: string

property: string

target: QtObject

targets: list<QtObject>

value: QVariant

参考情報

2018年5月9日

WorkerScript

モジュール

QtQuick 2.0

クラス継承

QQuickWorkerScript → QObject

プロパティー

source: url = QUrl()

シグナル

message(QQmlV4Handle messageObject)

sourceChanged()

スロット

void sendMessage(QQmlV4Function*)

説明


プロパティーの説明

source: url

シグナルの説明

message(QQmlV4Handle messageObject)

スロットの説明

void sendMessage(QQmlV4Function*)

参考情報

2018年5月8日

ScriptAction

モジュール

QtQuick 2.0

クラス継承

QQuickScriptAction → QQuickAbstractAnimation (internal) → QObject

プロパティー

script: QQmlScriptString = QQmlScriptString()
scriptName: QString = ""

説明


プロパティーの説明

script: QQmlScriptString

scriptName: QString

参考情報

2018年5月7日

DelegateModelGroup

モジュール

QtQml.Models 2.1

クラス継承

QQmlDelegateModelGroup → QObject

プロパティー

count: int = 0 readonly
name: QString = ""
includeByDefault: bool = false

シグナル

changed(QQmlV4Handle removed, QQmlV4Handle inserted)
countChanged()
defaultIncludeChanged()
nameChanged()

メソッド

QQmlV4Handle get(int index)

スロット

void addGroups(QQmlV4Function*)
void create(QQmlV4Function*)
void insert(QQmlV4Function*)
void move(QQmlV4Function*)
void resolve(QQmlV4Function*)
void remove(QQmlV4Function*)
void removeGroups(QQmlV4Function*)
void setGroups(QQmlV4Function*)

説明


プロパティーの説明

count: int

name: QString

includeByDefault: bool

シグナルの説明

changed(QQmlV4Handle removed, QQmlV4Handle inserted)


defaultIncludeChanged()

includeByDefault プロパティーの変更通知シグナル。

メソッドの説明

QQmlV4Handle get(int index)

スロットの説明

void addGroups(QQmlV4Function*)

void create(QQmlV4Function*)

void insert(QQmlV4Function*)

void move(QQmlV4Function*)

void resolve(QQmlV4Function*)

void remove(QQmlV4Function*)

void removeGroups(QQmlV4Function*)

void setGroups(QQmlV4Function*)

注意


includeByDefault プロパティーの変更通知シグナルが defaultIncludeChanged() となっていて命名規則と異なっている。

参考情報

2018年5月6日

ParentChange

モジュール

QtQuick 2.0

クラス継承

QQuickParentChange → QQuickStateOperation (internal) → QObject

プロパティー

target: Item = null
parent: Item = null
x: QQmlScriptString = ""
y: QQmlScriptString = ""
width: QQmlScriptString = ""
height: QQmlScriptString = ""
scale: QQmlScriptString = ""
rotation: QQmlScriptString = ""

説明


target に指定したビジュアルオブジェクトの parent を変更する。

x、y、width、height、scale、rotation で指定しないものがあるとき、parent を変更するビジュアルオブジェクトのそれらの値は見掛けをそのままにするような parent 変更先ビジュアルオブジェクト座標系での値に変更される。つまり、x と y の座標値は parent 変更先ビジュアルオブジェクトから見た座標値になり、スケールは逆数に、角度は逆向きになって、parent を変更する前の見掛けを保つように変更される。

x、y、width、height、scale、rotation のいずれかあるいは複数に parent 変更先ビジュアルオブジェクトでのプロパティー値を設定すると ParentAnimation でアニメーション効果を付けられる。

サンプルコード switchparent.qml を参照。

プロパティーの説明

target: Item

parent を変更するビジュアルオブジェクト。

parent: Item

parent 変更先ビジュアルオブジェクト。

x: QQmlScriptString

parent 変更先ビジュアルオブジェクトでの x 座標値を指定する。

y: QQmlScriptString

parent 変更先ビジュアルオブジェクトでの y 座標値を指定する。

width: QQmlScriptString

parent 変更後の幅を指定する。

height: QQmlScriptString

parent 変更後の高さを指定する。

scale: QQmlScriptString

parent 変更後のスケールを指定する。

rotation: QQmlScriptString

parent 変更後の角度を指定する。

問題


兄弟関係にある複数ビジュアルオブジェクトの parent を変更しようとすると正しく動作しない場合がある。

参考情報

ParentAnimation

モジュール

QtQuick 2.0

クラス継承

QQuickParentAnimation →  QQuickAnimationGroup (internal) → QQuickAbstractAnimation (internal) → QObject

プロパティー

target: Item = null
newParent: Item = null
via: Item = null

シグナル

targetChanged()
newParentChanged()
viaChanged()

説明


サンプルコード switchparent.qml を参照。


プロパティーの説明

target: Item

newParent: Item

via: Item

parent 変更先のビジュアルオブジェクトが parent 変更元のビジュアルオブジェクトよりも描画順序が先の場合や parent 変更先と変更元のいずれかのビジュアルオブジェクトの clip が true に設定されている場合に、clip が false に設定されているビジュアルオブジェクトを指定して parent を変えるビジュアルオブジェクトが隠れないようにする。

問題


ParentAnimation のリファレンスには親ビジュアルオブジェクトの clip が true のときの via 使用について書かれているがビジュアルオブジェクトの描画順序のために via が必要なことが書かれていない。

参考情報

2018年5月5日

switchparent.qml

switchparent.qml:

import QtQuick 2.10
import QtQuick.Window 2.10
import QtQuick.Layouts 1.3

Window {
    id: window

    visible: true

    minimumWidth: 300
    minimumHeight: 300

    RowLayout {
        id: topLayout

        anchors.fill: parent
        anchors.margins: spacing

        Rectangle {
            id: leftRect

            Layout.fillWidth: true
            Layout.fillHeight: true

            objectName: "leftRect"
            color: "red"

            Rectangle {
                id: innerRect

                x: 10; y: 10
                width: (minimumWidth - 3*topLayout.spacing)/2 - 2*10
                height: width

                color: "blue"

                Text {
                    anchors.centerIn: parent

                    text: "%1\n%2, %3\n%4x%5".arg(innerRect.parent.objectName)
                                             .arg(parent.x).arg(parent.y)
                                             .arg(parent.width).arg(parent.height)
                    color: "white"
                }
            }
        }

        Rectangle {
            id: rightRect

            Layout.fillWidth: true
            Layout.fillHeight: true

            objectName: "rightRect"
            color: "green"
        }
    }

    contentItem.states: State {
        name: "switchToRight"

        ParentChange {
            target: innerRect
            parent: rightRect
            x: rightRect.width - innerRect.width - 10
            y: rightRect.height - innerRect.height - 10
        }

        PropertyChanges {
            target: innerRect
            color: "darkblue"
        }
    }

    contentItem.transitions: Transition {
        ParentAnimation {
            via: contentItem

            NumberAnimation {
                properties: "x, y"
                duration: 3000
            }

            ColorAnimation {
                duration: 3000
            }
        }
    }

    MouseArea {
        anchors.fill: parent

        onClicked: {
            if (contentItem.state === "") {
                contentItem.state = "switchToRight";
            } else {
                contentItem.state = "";
            }
        }
    }
}
ウィンドウをクリックすると青い Rectangle の parent を右側の Rectangle に変更し右下に配置する。もう一度クリックすると parent を元に戻している。ParentAnimation 内の 2 つのアニメーションは並列に動作する。ParentAnimation で via を指定しないと青い Rectangle が右側から左側に移動するときに右側の Rectangle の裏に隠れてしまう。これはアニメーション開始時に青い Rectangle の parent が左側の Rectangle に変わることと、左側の Rectangle の parent 設定が右側の Rectangle の parent 設定よりも先に行われているので左側の Rectangle が右側の Rectangle の下に描画されるためである。

2018年5月4日

Behavior

モジュール

QtQuick 2.0

クラス継承

QQuickBehavior → QtObject

プロパティー

animation: Animation = null default deferred
enabled: bool = true

シグナル

enabledChanged()

説明


プロパティーの説明

animation: Animation

enabled: bool

問題


Behavior のリファレンスに animation プロパティーが遅延プロパティーであることが書かれていない。

参考情報

2018年5月1日

Transition

モジュール

QtQuick 2.0

クラス継承

QQuickTransition → QObject

プロパティー

animations: list<Animation> = [] readonly default deferred
enabled: bool = true
from: string = "*"
reversible: bool = false
running: bool = false readonly
to: string = "*"

シグナル

enabledChanged()
fromChanged()
reversibleChanged()
runningChanged()
toChanged()

説明


プロパティーの説明

animations: list<Animation>

enabled: bool

from: string

reversible: bool

running: bool

to: string

問題


Transition のリファレンスに animations プロパティーが遅延プロパティーであることが書かれていない。

参考情報

State

モジュール

QtQuick 2.0

クラス継承

QQuickState → QObject

プロパティー

changes: list<QQuickStateOperation> = [] readonly default deferred
extend: string = QString()
name: string = QString()
when: QQmlBinding* = nullptr

シグナル

completed()

説明


プロパティーの説明

changes: list<QQuickStateOperation>

カレントステートになったときに変更するプロパティーと実行スクリプトを指定する。QQuickStateOperation を継承しているのは以下のクラス。
QQuickParentChange
QQuickAnchorChanges
QQuickPropertyChanges
QQuickStateChangeScript
従って AnchorChanges と ParentChange、PropertyChanges、StateChangeScript を要素とするリストが設定できる。

extend: string

name: string

when: QQmlBinding*

シグナルの説明

completed()

問題


State のリファレンスの changes プロパティーは型表記が存在しないものになっている。また何を設定できるかが明確に記載されていない。遅延プロパティーであることも書かれていない。

参考情報

console

ログ

console.debug(...)
console.error(...)
console.info(...)
console.log(...) (console.debug() と同じ)
console.warn(...)
print(...) (console.debug() と同じ)

アサーション

console.assert(式, 説明文字列)

タイマー

console.time(識別文字列)
console.timeEnd(識別文字列)

トレース

console.trace()

カウント

console.count(説明文字列)

プロファイリング

console.profile()
console.profileEnd()

例外

console.exception(式...)

問題


Console API のリファレンスに print() が記載されていない。

参考情報

Console API

AnimatedImage

モジュール

QtQuick 2.11

クラス継承

QQuickAnimatedImage → QQuickImage → QQuickImageBase (internal) → QQuickImplicitSizeIte (internal) → QQuickItemQObject

プロパティー

playing: bool = true
paused: bool = false
currentFrame: int = 0
frameCount: int = 0 readonly
speed: real = 1

sourceSize: size = Qt.size(0, 0) readonly override

シグナル

frameChanged()
frameCountChanged()
pausedChanged()
playingChanged()
speedChanged()

void sourceSizeChanged() override

説明


プロパティーの説明

playing: bool

paused: bool

currentFrame: int

frameCount: int

speed: real

sourceSize: size

シグナルの説明

sourceSizeChanged()

注意


sourceSize プロパティーはオーバーライドされて読み込み専用になっている。

問題


AnimatedImage のリファレンスにはオーバーライドされた sourceSize プロパティーが記載されていない。

参考情報

anchored.qml

anchored.qml:

import QtQuick 2.10
import QtQuick.Window 2.10

Window {
    id: window

    visible: true

    minimumWidth: 300
    minimumHeight: 300

    Rectangle {
        id: movingRect

        x: 10; y: 10
        width: 150; height: 150

        color: "red"

        MouseArea {
            anchors.fill: parent

            onClicked: {
                if (movingRect.state === "") {
                    movingRect.state = "anchored";
                } else {
                    movingRect.state = "";
                }
            }
        }

        states: State {
            name: "anchored"

            AnchorChanges {
                target: movingRect
                anchors {
                    right: contentItem.right
                    bottom: contentItem.bottom
                }
            }

            PropertyChanges {
                target: movingRect
                anchors {
                    rightMargin: 10
                    bottomMargin: 10
                }
            }
        }

        transitions: Transition {
            AnchorAnimation {
                duration: 1000
            }
        }
    }
}
Rectangle をクリックすると Rectangle にアンカーを付けて右下に配置し、もう一度クリックするとアンカーを削除している。AnchorChanges ではマージン指定をできないので PropertyChanges で指定している。

AnchorChanges

モジュール

QtQuick 2.0

クラス継承

QQuickAnchorChanges → QQuickStateOperation (internal) → QObject

プロパティー

anchors: QQuickAnchorSet* = QQuickAnchorSet(nullptr) readonly constant
anchors.left: QQmlScriptString = ""
anchors.right: QQmlScriptString = ""
anchors.horizontalCenter: QQmlScriptString = ""
anchors.top: QQmlScriptString = ""
anchors.bottom: QQmlScriptString = ""
anchors.verticalCenter: QQmlScriptString = ""
anchors.baseline: QQmlScriptString = ""
target: Item = null

説明


State 内で用いてアンカーを変更する。アニメーション効果を付けるには Transition 内で AnchorAnimation を使う。

サンプルコードanchored.qml を参照。

プロパティーの説明

anchors: QQuickAnchorSet*

anchors.left: QQmlScriptString

anchors.right: QQmlScriptString

anchors.horizontalCenter: QQmlScriptString

anchors.top: QQmlScriptString

anchors.bottom: QQmlScriptString

anchors.verticalCenter: QQmlScriptString

anchors.baseline: QQmlScriptString

target: Item

注意


AnchorChanges の anchors の型は Item の anchors の型とは異なっている。マージンなどがない。

問題


anchors.left などの設定を item.Left や item.center のように書き間違えてもその値が udefined なので警告もされずに実行されてしまう。

参考情報

2018年4月30日

anchors

クラス継承

QQuickAnchors → QObject

プロパティー

left: QQuickAnchorLine = QQuickAnchorLine()
right: QQuickAnchorLine = QQuickAnchorLine()
horizontalCenter: QQuickAnchorLine = QQuickAnchorLine()
top: QQuickAnchorLine = QQuickAnchorLine()
bottom: QQuickAnchorLine = QQuickAnchorLine()
verticalCenter: QQuickAnchorLine = QQuickAnchorLine()
baseline: QQuickAnchorLine = QQuickAnchorLine()
margins: real = 0
leftMargin: real = 0
rightMargin: real = 0
horizontalCenterOffset: real = 0
topMargin: real = 0
bottomMargin: real = 0
verticalCenterOffset: real = 0
baselineOffset: real = 0
fill: Item = null
centerIn: Item = null
alignWhenCentered: bool = true

シグナル

void leftChanged()
void rightChanged()
void horizontalCenterChanged()
void topChanged()
void bottomChanged()
void verticalCenterChanged()
void baselineChanged()
void marginsChanged()
void leftMarginChanged()
void rightMarginChanged()
void horizontalCenterOffsetChanged()
void topMarginChanged()
void bottomMarginChanged()
void verticalCenterOffsetChanged()
void baselineOffsetChanged()
void fillChanged()
void centerInChanged()
void centerAlignedChanged()

説明


プロパティーの説明

left: QQuickAnchorLine

right: QQuickAnchorLine

horizontalCenter: QQuickAnchorLine

top: QQuickAnchorLine

bottom: QQuickAnchorLine

verticalCenter: QQuickAnchorLine

baseline: QQuickAnchorLine

margins: real

leftMargin: real

rightMargin: real

horizontalCenterOffset: real

topMargin: real

bottomMargin: real

verticalCenterOffset: real

baselineOffset: real

fill: Item

centerIn: Item

alignWhenCentered: bool

参考情報

SequentialAnimation

モジュール

QtQuick 2.0

クラス継承

QQuickSequentialAnimation → QQuickAnimationGroup (internal) → QQuickAbstractAnimationQObject

プロパティー

animations: list<Animation> = [] readonly default inherited

説明


アニメーションをグループ化し直列実行する。各アニメーションは animations プロパティーに設定する。アニメーションは個別に実行の開始と終了はできずグループ単位で実行の開始と終了をする。

プロパティーの説明

animations: list<Animation>

グループ化して直列実行するアニメーション。

問題


SequentialAnimation のリファレンスに animations プロパティーが記載されていない。

参考情報

2018年4月29日

ParallelAnimation

モジュール

QtQuick 2.0

クラス継承

QQuickParallelAnimation → QQuickAnimationGroup (internal) → QQuickAbstractAnimationQObject

プロパティー

animations: list<Animation> = [] readonly default inherited

説明


アニメーションをグループ化し並列実行する。各アニメーションは animations プロパティーに設定する。アニメーションは個別に実行の開始と終了はできずグループ単位で実行の開始と終了をする。

プロパティーの説明

animations: list<Animation>

グループ化して並列実行するアニメーション。

問題


ParallelAnimation のリファレンスに animations プロパティーが記載されていない。

参考情報

2018年4月28日

Easing

クラス継承

QQmlEasingValueType

プロパティー

type: Easing::Type = Easing.Linear final
amplitude: real = 1 final
overshoot: real = 1.70158 final
period: real = 0.3 final
bezierCurve: QVariantList(real) = [] final

列挙

Type
        Linear = QEasingCurve::Linear
        InQuad = QEasingCurve::InQuad
        OutQuad = QEasingCurve::OutQuad
        InOutQuad = QEasingCurve::InOutQuad
        OutInQuad = QEasingCurve::OutInQuad
        InCubic = QEasingCurve::InCubic
        OutCubic = QEasingCurve::OutCubic
        InOutCubic = QEasingCurve::InOutCubic
        OutInCubic = QEasingCurve::OutInCubic
        InQuart = QEasingCurve::InQuart
        OutQuart = QEasingCurve::OutQuart
        InOutQuart = QEasingCurve::InOutQuart
        OutInQuart = QEasingCurve::OutInQuart
        InQuint = QEasingCurve::InQuint
        OutQuint = QEasingCurve::OutQuint
        InOutQuint = QEasingCurve::InOutQuint
        OutInQuint = QEasingCurve::OutInQuint
        InSine = QEasingCurve::InSine
        OutSine = QEasingCurve::OutSine
        InOutSine = QEasingCurve::InOutSine
        OutInSine = QEasingCurve::OutInSine
        InExpo = QEasingCurve::InExpo
        OutExpo = QEasingCurve::OutExpo
        InOutExpo = QEasingCurve::InOutExpo
        OutInExpo = QEasingCurve::OutInExpo
        InCirc = QEasingCurve::InCirc
        OutCirc = QEasingCurve::OutCirc
        InOutCirc = QEasingCurve::InOutCirc
        OutInCirc = QEasingCurve::OutInCirc
        InElastic = QEasingCurve::InElastic
        OutElastic = QEasingCurve::OutElastic
        InOutElastic = QEasingCurve::InOutElastic
        OutInElastic = QEasingCurve::OutInElastic
        InBack = QEasingCurve::InBack
        OutBack = QEasingCurve::OutBack
        InOutBack = QEasingCurve::InOutBack
        OutInBack = QEasingCurve::OutInBack
        InBounce = QEasingCurve::InBounce
        OutBounce = QEasingCurve::OutBounce
        InOutBounce = QEasingCurve::InOutBounce
        OutInBounce = QEasingCurve::OutInBounce
        InCurve = QEasingCurve::InCurve
        OutCurve = QEasingCurve::OutCurve
        SineCurve = QEasingCurve::SineCurve
        CosineCurve = QEasingCurve::CosineCurve
        Bezier = QEasingCurve::BezierSpline

説明


プロパティーの説明

type: Easing::Type

amplitude: real

overshoot: real

period: real

bezierCurve: QVariantList(real)

列挙の説明


注意


プロパティーの順序は説明文字列の要素順。

参考情報

easing
QEasingCurve Class

AnchorAnimation

モジュール

QtQuick 2.0

クラス継承

QQuickAnchorAnimation → QQuickAbstractAnimation (internal) → QObject

プロパティー

duration: int = 250
easing: QEasingCurve = QEasingCurve(QEasingCurve::Linear, amplitude = 1, overshoot = 1.70158, period = 0.3, bezierCurve = [])
targets: list<Item> = [] readonly

シグナル

durationChanged(int)
easingChanged(QEasingCurve)

説明


AnchorChanges によるアンカー変更時に Transition 中で使ってアニメーション効果を付ける。

サンプルコード anchored.qml を参照。

プロパティーの説明

duration: int

アニメーション継続時間、単位はミリ秒。

easing: QEasingCurve

Easing を参照。

targets: list<Item>

アニメーション効果を付けるビジュアルオブジェクトのリスト。指定しない場合は AnchorChanges でアンカーを変更するすべてのビジュアルオブジェクトがアニメーション効果の対象になる。

参考情報

Animation

モジュール

QtQuick 2.0

クラス継承

QQuickAbstractAnimation (internal) → QObject

プロパティー

alwaysRunToEnd: bool = false
loops: int = 1
paused: bool = false
running: bool = false

シグナル

started()
stopped()
alwaysRunToEndChanged(bool)
loopCountChanged(int)
runningChanged(bool)
pausedChanged(bool)

スロット

void complete()
void pause()
void restart()
void resume()
void start() default
void stop()

説明


タイプ階層
Animation
        AnchorAnimation
        Animator
        ParallelAnimation
        ParentAnimation
        PathAnimation
        PauseAnimation
        PropertyAction
        PropertyAnimation
                ColorAnimation
                NumberAnimation
                        SmoothedAnimation
                        SpringAnimation
                RotationAnimation
                Vector3dAnimation
        ScriptAction
        SequentialAnimation

プロパティーの説明

alwaysRunToEnd: bool

loops: int

paused: bool

running: bool

シグナルの説明

started()

stopped()

スロットの説明

void complete()

void pause()

void restart()

void resume()

void start()

void stop()

問題


Animation のリファレンスに start() がデフォルトメソッドであることが書かれていない。

参考情報

2018年4月27日

ItemSelectionModel

モジュール

QtQml.Models 2.2

クラス継承

QItemSelectionModel → QObject

プロパティー

currentIndex: QModelIndex = QModelIndex() readonly
hasSelection: bool = false readonly
model: QAbstractItemModel* = null
selection: QmlSequence(QItemSelection) = [] readonly
selectedIndexes: QmlSequence(QModelIndexList) = [] readonly

シグナル

currentChanged(QModelIndex current, QModelIndex previous)
currentColumnChanged(QModelIndex current, QModelIndex previous)
currentRowChanged(QModelIndex current, QModelIndex previous)
modelChanged(QAbstractItemModel* model)
selectionChanged(QItemSelection selected, QItemSelection deselected)

メソッド

bool columnIntersectsSelection(int column, QModelIndex parent)
bool isSelected(QModelIndex index)
bool isRowSelected(int row, QModelIndex parent)
bool isColumnSelected(int column, QModelIndex parent)
bool rowIntersectsSelection(int row, QModelIndex parent)
QModelIndexList selectedRows(int column = 0)
QModelIndexList selectedColumns(int row = 0)

スロット

void clear()
void clearCurrentIndex()
void clearSelection()
void reset()
void setCurrentIndex(QModelIndex index, QItemSelectionModel::SelectionFlags command)
void select(QModelIndex index, QItemSelectionModel::SelectionFlags command)
void select(QItemSelection selection, QItemSelectionModel::SelectionFlags command)

列挙フラグ

SelectionFlags
    NoUpdate
    Clear
    Select
    Deselect
    Toggle
    Current
    Rows
    Columns
    SelectCurrent
    ToggleCurrent
    ClearAndSelect

説明


プロパティーの説明

currentIndex: QModelIndex

hasSelection: bool

model: QAbstractItemModel*

selection: QmlSequence(QItemSelection)

selectedIndexes: QmlSequence(QModelIndexList)

シグナルの説明

currentChanged(QModelIndex current, QModelIndex previous)

currentColumnChanged(QModelIndex current, QModelIndex previous)

currentRowChanged(QModelIndex current, QModelIndex previous)

メソッドの説明

bool columnIntersectsSelection(int column, QModelIndex parent)

bool isSelected(QModelIndex index)

bool isRowSelected(int row, QModelIndex parent)

bool isColumnSelected(int column, QModelIndex parent)

bool rowIntersectsSelection(int row, QModelIndex parent)

QModelIndexList selectedRows(int column)

QModelIndexList selectedColumns(int row)

スロットの説明

void clear()

void clearCurrentIndex()

void clearSelection()

void reset()

void setCurrentIndex(QModelIndex index, QItemSelectionModel::SelectionFlags command)

void select(QModelIndex index, QItemSelectionModel::SelectionFlags command)

void select(QItemSelection selection, QItemSelectionModel::SelectionFlags command)

列挙フラグの説明


SelectionFlags
列挙値 説明
NoUpdate 0x0000 セレクション操作なし
Clear 0x0001
Select 0x0002
Deselect 0x0004
Toggle 0x0008
Current 0x0010
Rows 0x0020
Columns 0x0040
SelectCurrent Select | Current
ToggleCurrent Toggle | Current
ClearAndSelect Clear | Select

参考情報

2018年4月26日

DelegateModel

モジュール

QtQml.Models 2.1

クラス継承

QQmlDelegateModel → QQmlInstanceModel (internal) → QObject

プロパティー

delegate: Component* = null default
filterOnGroup: string = "items"
groups: list<DelegateModelGroup> = [ DelegateModelGroup("items"), DelegateModelGroup("persistedItems") ] readonly constant
items: DelegateModelGroup = DelegateModelGroup("items") readonly constant
model: QVariant = undefined
parts: QtObject = QQmlDelegateModelParts(this) readonly constant
persistedItems: DelegateModelGroup = DelegateModelGroup("persistedItems") readonly
rootIndex: QModelIndex* = QModelIndex()

count: int = 0 readonly inherited

シグナル

defaultGroupsChanged() 未使用
filterGroupChanged()
rootIndexChanged()
countChanged() inherited
createdItem(int index, QtObject object) inherited
destroyingItem(QtObject object) inherited
initItem(int index, QtObject object) inherited
modelUpdated(QQmlChangeSet changeSet, bool reset) inherited

メソッド

QModelIndex modelIndex(int index)
QModelIndex parentModelIndex()

説明


プロパティーの説明

delegate: Component

filterOnGroup: string

groups: list<DelegateModelGroup>

items: DelegateModelGroup*

model: QVariant

parts: QtObject*

persistedItems: DelegateModelGroup

rootIndex: QModelIndex*


count: int

シグナルの説明

filterGroupChanged()

filterOnGroup プロパティーの変更通知シグナル。

createdItem(int index, QtObject object)

destroyingItem(QtObject object)

initItem(int index, QtObject object)

modelUpdated(QQmlChangeSet changeSet, bool reset)

メソッドの説明

QModelIndex modelIndex(int index)

QModelIndex parentModelIndex()

注意


filterOnGroup プロパティーの変更通知シグナルは filterGroupChanged() となっていて命名規則と異なっている。

問題


DelegateModel のリファレンスに以下のシグナルが記載されていない。
createdItem(int index, QtObject object)
destroyingItem(QtObject object)
initItem(int index, QtObject object)
modelUpdated(QQmlChangeSet changeSet, bool reset)
以下のシグナルが定義されているが使われていない。
defaultGroupsChanged()

参考情報

2018年4月12日

LoggingCategory

モジュール

QtQml 2.8

クラス継承

QQmlLoggingCategory → QObject

プロパティー

name: QString = ""

説明


プロパティーの説明

name: QString

参考情報

2018年4月10日

ListModel

モジュール

QtQml.Models 2.1

クラス継承

QQmlListModel → QAbstractListModelQAbstractItemModel → QObject

プロパティー

count: int = 0 readonly
dynamicRoles: bool = false

シグナル

countChanged() signal

メソッド

void append(Object dictionary)
void clear()
Object get(int index)
void insert(int index, Object dictionary)
void insert(int index, Array [Object, Object, ...])
void move(int from, int to, int count)
void remove(int index, int count = 1)
void set(int index, Object dictionary)
void setProperty(int index, string property, var value)
void sync()

説明


プロパティーの説明

count: int

dynamicRoles: bool

メソッドの説明

void append(Object dictionary)

void clear()

Object get(int index)

void insert(int index, Object dictionary)

void move(int from, int to, int count)

void remove(int index, int count)

void set(int index, Object dictionary)

void setProperty(int index, string property, var value)

void sync()

参考情報

ListElement

モジュール

QtQml.Models 2.1

クラス継承

QQmlListElement → QObject

説明


注意


ロールはプロパティーと同じ形式だが値だけが設定でき、JavaScript の式は設定できない。

参考情報

fontInfo

クラス継承

QJSValue

プロパティー

fontInfo.bold: bool = false
fontInfo.family: string = プラットフォームデフォルト
fontInfo.italic: bool = false
fontInfo.pixelSize: int = プラットフォームデフォルト
fontInfo.pointSize: real = プラットフォームデフォルト
fontInfo.styleName: string = "Regular"
fontInfo.weight: int = 50

説明


QFontInfo の一部を QML で参照するときに使われるタイプ。

プロパティーの説明

fontInfo.bold: bool

true ならば太文字。

fontInfo.family: string

ファミリー名。

fontInfo.italic: bool

true ならばイタリック体。

fontInfo.pixelSize: real

ピクセルサイズ。

fontInfo.pointSize: real

ポイントサイズ。

fontInfo.styleName: string

スタイル名。

fontInfo.weight: int

ウェイト。

注意


toString() は font のような説明文字列を返さない。

問題


QFontInfo のリファレンスは underline()、overline()、strikeout() の記述が抜けている。

参考情報

font

クラス継承

QFont

プロパティー

font.bold: bool = false final
font.capitalization: Capitalization =  Font.MixedCase final
font.family: QString = プラットフォームデフォルト final
font.hintingPreference: HintingPreference = Font.PreferDefaultHinting) final
font.italic: bool = false final
font.kerning: bool = true final
font.letterSpacing: real = 0 final
font.overline: bool = false final
font.pixelSize: int = プラットフォームデフォルト final
font.pointSize: real = プラットフォームデフォルト final
font.preferShaping: bool = true final
font.strikeout: bool = false final
font.styleName: QString = "" final
font.underline: bool = false final
font.weight: FontWeight = Font.Normal final
font.wordSpacing: real = 0 final

説明


フォント指定で使われるタイプ。指定したフォントから実際に使われるフォントが求められて使われる。QFont の機能を部分的に QML で利用していて、pointSize と pixelSize の扱いは QML 向けになっている。

プロパティーの説明

font.bold: bool

true ならば太文字。

font.capitalization: Capitalization

テキスト描画時に小文字を大文字にする方法。以下の方法が用意されている。
列挙値 説明
Font.MixedCase 0 そのままで何も変えない
Font.AllUppercase 1 小文字を大文字に変える
Font.AllLowercase 2 大文字を小文字に変える
Font.SmallCaps 3 小文字をサイズの小さい大文字に変える
Font.Capitalize 4 語の先頭文字を大文字にする。語の区切りはホワイトスペース

font.family: QString

ファミリー名。

font.hintingPreference: HintingPreference

font.italic: bool

true ならばイタリック体。

font.kerning: bool

true ならばカーニングを行う。

font.letterSpacing: qreal

文字間隔を指定値に変更する。正負値共に可能。QFont::setLetterSpacing(QFont::AbsoluteSpacing, 指定値) を呼び出して変更している。

font.overline: bool

true ならば上線を付ける。

font.pixelSize: int

ピクセルサイズ。pointSize を設定した場合に QFontInfo の pixelSize になる。

font.pointSize: qreal

ポイントサイズ。pixelSize を設定した場合に QFontInfo の pointSize になる。

font.preferShaping: bool

true ならば QFont::setStyleStrategy() を呼び出して QFont::PreferNoShaping ビットを落とす。false ならばビットを立てる。

Text タイプのリファレンスに false に設定すると大抵の場合に効率がよくなると書かれている。しかし、拗音や捨て仮名、全角ギリシア文字の小文字などの語幅が広がってしまうため使い道は限られる。

font.strikeout: bool

true ならば取り消し線を付ける。

font.styleName: QString

スタイル名。

font.underline: bool

true ならば下線を付ける。

font.weight: FontWeight

フォントウェイト。0 から 99 までの値で、以下の FontWeight 型の列挙値で設定する。
列挙値
Font.Thin0
Font.ExtraLight12
Font.Light25
Font.Normal50
Font.Medium57
Font.DemiBold63
Font.Bold75
Font.ExtraBold81
Font.Black87

font.wordSpacing: qreal

語間隔を指定値に変更する。正負値共に可能。語の区切りはホワイトスペース。

注意


指定した通りのフォントが使われるのではない。Text では実際に使われるフォントは fontInfo プロパティーでわかるようになっている。しかし、font プロパティーのあるタイプに fontInfo プロパティーがあるとは限らない。実際には Text と Text を継承した Label のみに fontInfo プロパティーがある。

family と styleName に存在しない名前を指定した場合にはデフォルト値が使われエラーにはならない。存在しない場合でも指定した名前が説明文字列に入る。

QFont ではポイントサイズとピクセルサイズを共に設定すると最後に設定したものが有効になり、もう一方は -1 になる。QML の font は QFont とは違って、QFontInfo で求めた値がもう一方の値になり、等式 pixelSize = Math.floor(pointSize * (dpi/72)) が成り立つ。font の説明文字列は QFont の説明文字列のため、どちらかを設定した場合に説明文字列中のもう一方は -1 になり、QML の font の pointSize と pixelSize 両方が説明文字列の値と一致することはない。

QML ではポイントサイズとピクセルサイズの両方を指定すると警告され、ピクセルサイズが優先して使われる。宣言的に値を設定した場合に構文的に優先順を明示する適切な方法がないためこのような制約がある。

toString() が返す説明文字列の情報がプロパティーと一致してはいない。pointSize に 12.5 を設定した場合に、説明文字列の内容は以下のようになる。styleName 設定の有無で 10 要素か 11 要素の違いがある。
QFont(.SF NS Text,12.5,-1,5,50,0,0,0,0,0)
QFont(Osaka,12.5,-1,5,50,0,0,0,0,0,Regular-Mono) (styleName に "Regular-Mono" を設定)
上記の説明文字列の各要素はこのようになる。
説明文字列要素 要素値 QFontInfo の値 QML fontInfo の値
family QString .SF NS Text/Osaka .SF NS Text/Osaka .SF NS Text/Osaka
pointSizeF qreal 12.5 13 13
pixelSize int -1 13 13
styleHint StyleHint 5 (QFont::AnyStyle) QFont::AnyStyle なし
weight int 50 50 50
style Style 0 (QFont::StyleNormal) QFont::StyleNormal なし
underline bool 0 (false) false なし
strikeout bool 0 (false) false なし
fixedPitch bool 0 (false) false なし
空き bool 常に 0 (false) なし なし
styleName QString なし/Regular-Mono Regular/Regular-Mono Regular/Regular-Mono

問題


font のリファレンスには styleName の記述が漏れている。QFont のリファレンスには記述されている。

参考情報

TextMetrics

モジュール

QtQuick 2.4

クラス継承

QQuickTextMetrics → QObject

プロパティー

advanceWidth: qreal = 0 readonly final
boundingRect: QRectF = QRectF(0, 0, 0, 0) readonly final
elide: Qt::TextElideMode = Qt::ElideNone final
elideWidth: qreal = 0 final
elidedText: QString = "" readonly final
font: QFont = プラットフォームデフォルト
height: qreal = 0 readonly final
text: QString = "" final
tightBoundingRect: QRectF = QRectF(0, 0, 0, 0) readonly final
width: qreal = 0 readonly final

シグナル

elideChanged()
elideWidthChanged()
fontChanged()
metricsChanged()
textChanged()

説明


プロパティーの説明

advanceWidth: qreal

boundingRect: QRectF

elide: Qt::TextElideMode

elideWidth: qreal

elidedText: QString

font: QFont

font を参照。

height: qreal

text: QString

tightBoundingRect: QRectF

width: qreal


注意


TextMetrics は Item を継承していないので parent プロパティーはない。従って、フォント参照はコンポーネントスコープ内のものか id 修飾が必要になる。

参考情報

FontMetrics

モジュール

QtQuick 2.4

クラス継承

QQuickFontMetrics → QObject

プロパティー

ascent: real = プラットフォームデフォルト readonly
averageCharacterWidth: real = プラットフォームデフォルト readonly
descent: real = プラットフォームデフォルト readonly
font: font = プラットフォームデフォルト
height: real = プラットフォームデフォルト readonly
leading: real = プラットフォームデフォルト readonly
lineSpacing: real = プラットフォームデフォルト readonly
lineWidth: real = プラットフォームデフォルト readonly
maximumCharacterWidth: real = プラットフォームデフォルト readonly
minimumLeftBearing: real = プラットフォームデフォルト readonly
minimumRightBearing: real = プラットフォームデフォルト readonly
overlinePosition: real = プラットフォームデフォルト readonly
strikeOutPosition: real = プラットフォームデフォルト readonly
underlinePosition: real = プラットフォームデフォルト readonly
xHeight: real = プラットフォームデフォルト readonly

シグナル

fontChanged(font font)

メソッド

real advanceWidth(string text)
rect boundingRect(string text)
rect tightBoundingRect(string text)
string elidedText(string text, Qt::TextElideMode mode, real width, int flags = Qt::TextShowMnemonic)

説明


QFontMetricsF の機能を部分的に利用できるようにしたラッパータイプ。

プロパティーの説明

ascent: real

QFontMetricsF::ascent() を呼び出しその戻り値を返す。

averageCharacterWidth: real

QFontMetricsF::averageCharWidth() を呼び出しその戻り値を返す。

descent: real

QFontMetricsF::descent() を呼び出しその戻り値を返す。

font: font

font を参照。

height: real

QFontMetricsF::height() を呼び出しその戻り値を返す。

leading: real

QFontMetricsF::leading() を呼び出しその戻り値を返す。

lineSpacing: real

QFontMetricsF::lineSpacing() を呼び出しその戻り値を返す。

lineWidth: real

QFontMetricsF::lineWidth() を呼び出しその戻り値を返す。

maximumCharacterWidth: real

QFontMetricsF::maxWidth() を呼び出しその戻り値を返す。

minimumLeftBearing: real

QFontMetricsF::leftBearing() を呼び出しその戻り値を返す。

minimumRightBearing: real

QFontMetricsF::minRightBearing() を呼び出しその戻り値を返す。

overlinePosition: real

QFontMetricsF::overlinePos() を呼び出しその戻り値を返す。

strikeOutPosition: real

QFontMetricsF::strikeOutPos() を呼び出しその戻り値を返す。

underlinePosition: real

QFontMetricsF::underlinePos() を呼び出しその戻り値を返す。

xHeight: real

QFontMetricsF::xHeight() を呼び出しその戻り値を返す。

シグナルの説明

fontChanged(font font)

font および当タイプの独自プロパティーのプロパティー変更通知シグナル。

メソッドの説明

real advanceWidth(string text)

QFontMetricsF::width() を呼び出しその戻り値を返す。

rectf boundingRect(string text)

QFontMetricsF::boundingRect() を呼び出しその戻り値を返す。

rectf tightBoundingRect(string text)

QFontMetricsF::tightBoundingRect() を呼び出しその戻り値を返す。

string elidedText(string text, Qt::TextElideMode mode, real width, int flags)

QFontMetricsF::elidedText() を呼び出しその戻り値を返す。

注意


FontMetrics は Item を継承していないので parent プロパティーはない。従って、フォント参照はコンポーネントスコープ内のものか id 修飾が必要になる。

font 以外の独自プロパティーに対してはそれらのシグナルハンドラーは使わずに font のシグナルハンドラーを使い、シグナルハンドラーで設定した処理中でプロパティーが変更されているかを判断しなければならない。

問題


FontMetrics のリファレンスに fontChanged() シグナルが一般的な動作と異なることが説明されていない。

fontChanged() シグナルは、font プロパティーが変更されたときしか送信されていない。

onAscentChanged や onHeightChanged のように、font 以外の当タイプの独自プロパティーに対してシグナルハンドラーを記述できる。しかし独自プロパティーのすべてのプロパティー変更通知シグナルが fontChanged() になっているため、font を変更するとプロパティー値が同一であってもシグナルハンドラーで設定した処理が実行されてしまう。このため font 以外の独自プロパティーについて、その値が変わったときにのみシグナルハンドラーで設定した処理を呼び出させない。

参考情報

2018年4月7日

コーディング規約

サンプルコードやコード断片のコーディング規約。
  • import
    • QML モジュール
    • QtQuick モジュール
    • JavaScript ファイル
    • QML ディレクトリー
    • QML プラグイン
  • id 宣言
  • プロパティー宣言
  • シグナル宣言
  • JavaScript 関数定義
  • プロパティー設定
    • 位置とサイズ設定
    • アンカー設定
    • ポジショナーとレイアウトのアタッチトプロパティー
    • 継承プロパティー設定
    • カスタムプロパティー設定
    • アタッチトプロパティー設定
  • 子オブジェクト生成
  • シグナルハンドラー
  • ステート宣言
  • トランジション宣言
Window タイプ系列のみ id 宣言の後に visible プロパティー設定。

2018年4月5日

DragHandler

モジュール

QtQuick 2.12

クラス継承

QQuickDragHandler → QQuickMultiPointHandler (internal) → QQuickPointerDeviceHandler (internal) → QQuickPointerHandler (internal) → QObject

プロパティー

xAxis: QQuickDragAxis* = QQuickDragAxis(this) readonly constant
xAxis.minimum: qreal = −DBL_MAX/−FLT_MAX
xAxis.maximum: qreal = DBL_MAX/FLT_MAX
xAxis.enabled: bool = true
yAxis: QQuickDragAxis* = QQuickDragAxis(this) readonly constant
yAxis.minimum: qreal = −DBL_MAX/−FLT_MAX
yAxis.maximum: qreal = DBL_MAX/FLT_MAX
yAxis.enabled: bool = true
translation: QVector2D = QVector2D(0, 0) readonly

シグナル

translationChanged()

メソッド

void enforceConstraints()

説明


プロパティーの説明

xAxis: QQuickDragAxis*

横方向のドラグ範囲。

xAxis.minimum: qreal

横方向のドラグ範囲の最小値。

xAxis.maximum: qreal

横方向のドラグ範囲の最大値。

xAxis.enabled: bool

true ならば横方向ドラグ可能、false ならば不可。

yAxis: QQuickDragAxis*

縦方向のドラグ範囲。

yAxis.minimum: qreal

縦方向のドラグ範囲の最大値。

yAxis.maximum: qreal

縦方向のドラグ範囲の最小値。

yAxis.enabled: bool

true ならば縦方向ドラグ可能、false ならば不可。

translation: QVector2D

ドラグ開始点からの移動量。

メソッドの説明

void enforceConstraints()

ドラグ対象が範囲外にある場合に範囲内へ移動する。

参考情報

2018年4月3日

VisualDataGroup

モジュール

QtQuick 2.0

クラス継承

QQmlDelegateModelGroup → QObject

説明


タイプ登録のクラスは QQmlDelegateModelGroup で DelegateModelGroup と同一。互換性のために残されている。

参考情報

VisualItemModel

モジュール

QtQuick 2.0

クラス継承

QQmlObjectModel → QQmlInstanceModel (internal) → QObject

説明


タイプ登録のクラスは QQmlObjectModel で ObjectModel と同一。互換性のために残されている。

参考情報

VisualDataModel

モジュール

QtQuick 2.0

クラス継承

QQmlDelegateModel → QQmlInstanceModel (internal) → QObject

説明


タイプ登録のクラスは QQmlDelegateModel で DelegateModel と同一。互換性のために残されている。

参考情報

TextEdit

モジュール

QtQuick 2.7

クラス継承

QQuickTextEdit → QQuickImplicitSizeItem (internal) → QQuickItemQObject

プロパティー

activeFocusOnPress: bool = true
baseUrl: url = 現在ファイル
bottomPadding: real = 0
canPaste: bool = true readonly
canUndo: bool = false readonly
canRedo: bool = false readonly
color: color = #ff000000
contentHeight: real = プラットフォームデフォルト readonly
contentWidth: real = 0 readonly
cursorDelegate: Component = null
cursorPosition: int = 0
cursorRectangle: rect = Qt.rect(0, 0, 1, プラットフォームデフォルト) readonly
cursorVisible: bool = false
effectiveHorizontalAlignment: HAlignment = TextEdit.AlignLeft readonly
font: font = プラットフォームデフォルト
horizontalAlignment: HAlignment = TextEdit.AlignLeft
hoveredLink: string = "" readonly
inputMethodComposing: bool = false readonly
inputMethodHints: Qt::InputMethodHints = 0
leftPadding: real = 0
length: int = 0 readonly
lineCount: int = 1 readonly
mouseSelectionMode: SelectionMode = TextEdit.SelectCharacters
overwriteMode: bool = false
padding: real = 0
paintedWidth: real = 0 readonly
paintedHeight: real = プラットフォームデフォルト readonly
persistentSelection: bool = false
preeditText: string = "" readonly
readOnly: bool = false
renderType: RenderType = TextEdit.QtRendering
rightPadding: real = 0
selectByKeyboard: bool = true
selectByMouse: bool = false
selectedText: string = "" readonly
selectedTextColor: color = #ffffffff
selectionColor: color = #ff000080
selectionEnd: int = 0 readonly
selectionStart: int = 0 readonly
tabStopDistance: real = 80
text: string = ""
textDocument: QQuickTextDocument* = QQuickTextDocument(this) readonly final
textFormat: TextFormat = TextEdit.PlainText
textMargin: real = 0
topPadding: real = 0
verticalAlignment: VAlignment = TextEdit.AlignTop
wrapMode: WrapMode = TextEdit.NoWrap

implicitWidth: real = 0 readonly inherited override
implicitHeight: real = プラットフォームデフォルト readonly inherited override

シグナル

editingFinished()
linkActivated(string link)
linkHovered(string link)
activeFocusOnPressChanged(bool activeFocusOnPressed)
baseUrlChanged()
bottomPaddingChanged()
canPasteChanged()
canRedoChanged()
canUndoChanged()
colorChanged(color color)
contentSizeChanged()
cursorDelegateChanged()
cursorPositionChanged()
cursorRectangleChanged()
cursorVisibleChanged(bool isCursorVisible)
effectiveHorizontalAlignmentChanged()
fontChanged(font font)
horizontalAlignmentChanged(TextEdit::HAlignment alignment)
inputMethodComposingChanged()
inputMethodHintsChanged()
leftPaddingChanged()
lineCountChanged()
mouseSelectionModeChanged(TextEdit::SelectionMode mode)
overwriteModeChanged(bool overwriteMode)
paddingChanged()
persistentSelectionChanged(bool isPersistentSelection)
preeditTextChanged()
readOnlyChanged(bool isReadOnly)
renderTypeChanged()
rightPaddingChanged()
selectByKeyboardChanged(bool selectByKeyboard)
selectByMouseChanged(bool selectByMouse)
selectedTextChanged()
selectedTextColorChanged(color color)
selectionColorChanged(color color)
selectionEndChanged()
selectionStartChanged()
tabStopDistanceChanged(real distance)
textChanged()
textFormatChanged(TextEdit::TextFormat textFormat)
textMarginChanged(real textMargin)
topPaddingChanged()
verticalAlignmentChanged(TextEdit::VAlignment alignment)
wrapModeChanged()

メソッド

string getText(int start, int end)
string getFormattedText(int start, int end)
QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument)
string linkAt(real x, real y)
void moveCursorSelection(int pos, SelectionMode mode = TextEdit.SelectCharacters)
rect positionToRectangle(int)
int positionAt(real x, real y)

スロット

void append(string text)
void clear()
void copy()
void cut()
void deselect()
void insert(int position, string text)
bool isRightToLeft(int start, int end)
void paste()
void redo()
void remove(int start, int end)
void select(int start, int end)
void selectAll()
void selectWord()
void undo()

列挙

HAlignment
    AlignLeft
    AlignRight
    AlignHCenter
    AlignJustify
VAlignment
    AlignTop
    AlignBottom
    AlignVCenter
TextFormat
    PlainText
    RichText
    AutoText
WrapMode
    NoWrap
    WordWrap
    WrapAnywhere
    WrapAtWordBoundaryOrAnywhere
    Wrap
SelectionMode
    SelectCharacters
    SelectWords
RenderType
    QtRendering
    NativeRendering

説明


プロパティーの説明

activeFocusOnPress: bool

baseUrl: url

bottomPadding: real

canPaste: bool

canUndo: bool

canRedo: bool

color: color

contentHeight: real

contentWidth: real

cursorDelegate: Component

cursorPosition: int

cursorRectangle: rect

cursorVisible: bool

effectiveHorizontalAlignment: HAlignment

font: font

font を参照。

horizontalAlignment: HAlignment

hoveredLink: string

inputMethodComposing: bool

inputMethodHints: Qt::InputMethodHints

leftPadding: real

length: int

lineCount: int

mouseSelectionMode: SelectionMode

overwriteMode: bool

padding: real

paintedWidth: real

paintedHeight: real

persistentSelection: bool

preeditText: string

readOnly: bool

renderType: RenderType

rightPadding: real

selectByKeyboard: bool

selectByMouse: bool

selectedText: string

selectedTextColor: color

selectionColor: color

selectionEnd: int

selectionStart: int

tabStopDistance: real

text: string

textDocument: QQuickTextDocument*

textFormat: TextFormat

textMargin: real

topPadding: real

verticalAlignment: VAlignment

wrapMode: WrapMode

シグナルの説明

editingFinished()

linkActivated(string link)

linkHovered(string link)

メソッドの説明

string getText(int start, int end)

string getFormattedText(int start, int end)

QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument)

string linkAt(real x, real y)

void moveCursorSelection(int pos, SelectionMode mode = TextEdit.SelectCharacters)

rect positionToRectangle(int)

int positionAt(real x, real y)

スロットの説明

void append(string text)

void clear()

void copy()

void cut()

void deselect()

void insert(int position, string text)

bool isRightToLeft(int start, int end)

void paste()

void redo()

void remove(int start, int end)

void select(int start, int end)

void selectAll()

void selectWord()

void undo()

参考情報

2018年4月2日

TextInput

モジュール

QtQuick 2.9

クラス継承

QQuickTextInput → QQuickImplicitSizeItem (internal) → QQuickItemQObject

プロパティー

acceptableInput: bool = true readonly
activeFocusOnPress: bool = true
autoScroll: bool = true
bottomPadding: real = 0
canPaste: bool = true readonly
canUndo: bool = false readonly
canRedo: bool = false readonly
color: color = #ff000000
contentHeight: real = プラットフォームデフォルト readonly
contentWidth: real = 0 readonly
cursorDelegate: Component = null
cursorPosition: int = 0
cursorRectangle: rect = Qt.rect(0, 0, 1, プラットフォームデフォルト) readonly
cursorVisible: bool = false
displayText: string = "" readonly
echoMode: EchoMode = TextInput.Normal
effectiveHorizontalAlignment: HAlignment = TextInput.AlignLeft readonly
font: font = プラットフォームデフォルト final
horizontalAlignment: HAlignment = TextInput.AlignLeft
inputMask: string = ""
inputMethodComposing: bool = false readonly
inputMethodHints: Qt::InputMethodHints = 0
leftPadding: real = 0
length: int = 0 readonly
maximumLength: int = 32767
mouseSelectionMode: SelectionMode = TextInput.SelectCharacters
overwriteMode: bool = false
padding: real = 0
passwordCharacter: string = "•"
passwordMaskDelay: int = 0
persistentSelection: bool = false
preeditText: string = "" readonly
readOnly: bool = false
renderType: RenderType = TextInput.QtRendering
rightPadding: real = 0
selectByMouse: bool = false
selectedText: string = "" readonly
selectedTextColor: color = #ffffffff
selectionColor: color = #ff000080
selectionEnd: int = 0 readonly
selectionStart: int = 0 readonly
text: string = ""
topPadding: real = 0
validator: QValidator* = null
verticalAlignment: VAlignment = TextInput.AlignTop
wrapMode: WrapMode = TextInput.NoWrap

implicitWidth: real = 0 readonly inherited override
implicitHeight: real = プラットフォームデフォルト readonly inherited override

シグナル

accepted()
editingFinished()
textEdited()
acceptableInputChanged()
activeFocusOnPressChanged(bool activeFocusOnPress)
autoScrollChanged(bool autoScroll)
bottomPaddingChanged()
canPasteChanged()
canRedoChanged()
canUndoChanged()
colorChanged()
contentSizeChanged()
cursorDelegateChanged(
cursorPositionChanged()
cursorRectangleChanged()
cursorVisibleChanged(bool isCursorVisible)
displayTextChanged()
echoModeChanged(TextInput::EchoMode echoMode)
effectiveHorizontalAlignmentChanged()
fontChanged(QFont font)
horizontalAlignmentChanged(TextInput::HAlignment alignment)
inputMaskChanged(QString inputMask)
inputMethodComposingChanged()
inputMethodHintsChanged()
leftPaddingChanged()
maximumLengthChanged(int maximumLength)
mouseSelectionModeChanged(TextInput::SelectionMode mode)
overwriteModeChanged(bool overwriteMode)
paddingChanged()
passwordCharacterChanged()
passwordMaskDelayChanged(int delay)
persistentSelectionChanged()
preeditTextChanged()
readOnlyChanged(bool isReadOnly)
renderTypeChanged()
rightPaddingChanged()
selectByMouseChanged(bool selectByMouse)
selectedTextChanged()
selectedTextColorChanged()
selectionColorChanged()
selectionEndChanged()
selectionStartChanged()
textChanged()
topPaddingChanged()
validatorChanged()
verticalAlignmentChanged(TextInput::VAlignment alignment)
wrapModeChanged()

implicitWidthChanged() inherited
void implicitHeightChanged() inherited

メソッド

QString getText(int start, int end)
QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument)
void moveCursorSelection(int pos, SelectionMode mode = TextInput.SelectCharacters)
int positionAt(real x, real y, CursorPosition position = TextInput.CursorBetweenCharacters);
QRectF positionToRectangle(int pos)

スロット

void clear()
void copy()
void cut()
void deselect()
void ensureVisible(int position)
bool isRightToLeft(int start, int end)
void insert(int position, string text)
void paste()
void redo()
void remove(int start, int end)
void select(int start, int end)
void selectAll()
void selectWord()
void undo()

列挙

EchoMode
    Normal
    NoEcho
    Password
    PasswordEchoOnEdit
HAlignment
    AlignLeft
    AlignRight
    AlignHCenter
VAlignment
    AlignTop
    AlignBottom
    AlignVCenter
WrapMode
    NoWrap
    WordWrap
    WrapAnywhere
    WrapAtWordBoundaryOrAnywhere
    Wrap
SelectionMode
    SelectCharacters
    SelectWords
CursorPosition
    CursorBetweenCharacters
    CursorOnCharacter
RenderType
    QtRendering
    NativeRendering

説明


プロパティーの説明

acceptableInput: bool

activeFocusOnPress: bool

autoScroll: bool

bottomPadding: real

canPaste: bool

canUndo: bool

canRedo: bool

color: color

contentHeight: real

contentWidth: real

cursorDelegate: Component

cursorPosition: int

cursorRectangle: rect

cursorVisible: bool

displayText: string

echoMode: EchoMode

effectiveHorizontalAlignment: HAlignment

font: font

font を参照。

horizontalAlignment: HAlignment

inputMask: string

inputMethodComposing: bool

inputMethodHints: Qt::InputMethodHints

leftPadding: real

length: int

maximumLength: int

mouseSelectionMode: SelectionMode

overwriteMode: bool

padding: real

passwordCharacter: string

passwordMaskDelay: int

persistentSelection: bool

preeditText: string

readOnly: bool

renderType: RenderType

rightPadding: real

selectByMouse: bool

selectedText: string

selectedTextColor: colo

selectionColor: color

selectionEnd: int

selectionStart: int

text: string

topPadding: real

validator: QValidator*

verticalAlignment: VAlignment

wrapMode: WrapMode

シグナルの説明

accepted()

editingFinished()

textEdited()

メソッドの説明

QString getText(int start, int end)

QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument)

void moveCursorSelection(int pos, SelectionMode mode = TextInput.SelectCharacters)

int positionAt(real x, real y, CursorPosition position = TextInput.CursorBetweenCharacters)

QRectF positionToRectangle(int pos)

スロットの説明

void clear()

void copy()

void cut()

void deselect()

void ensureVisible(int position)

bool isRightToLeft(int start, int end)

void insert(int position, string text)

void paste()

void redo()

void remove(int start, int end)

void select(int start, int end)

void selectAll()

void selectWord()

void undo()

問題


参考情報

2018年4月1日

ObjectModel

モジュール

QtQml.Models 2.3

クラス継承

QQmlObjectModel → QQmlInstanceModel (internal) → QObject

プロパティー

children: list<QtObject> = [] readonly default

count: int = 0 readonly inherited

アタッチトプロパティー

ObjectModel.index: int

シグナル

OjbectModel.indexChanged()
childrenChanged()
countChanged() inherited
createdItem(int index, QtObject object) inherited
destroyingItem(QtObject object) inherited
initItem(int index, QtObject object) inherited
modelUpdated(QQmlChangeSet changeSet, bool reset) inherited

メソッド

void append(QtObject object)
QtObject get(int index)
void insert(int index, QtObject object)
void move(int from, int to, int n = 1)
void remove(int index, int n = 1)

スロット

void clear()

説明


プロパティーの説明

children: list<QtObject>

count: int

アタッチトプロパティーの説明

ObjectModel.index: int

シグナルの説明

createdItem(int index, QtObject object)

destroyingItem(QtObject object)

initItem(int index, QtObject object)

modelUpdated(QQmlChangeSet changeSet, bool reset)

OjbectModel.indexChanged()

メソッドの説明

void append(QtObject object)

QtObject get(int index)

void insert(int index, QtObject object)

void move(int from, int to, int n = 1)

void remove(int index, int n = 1)

スロットの説明

void clear()

問題


children プロパティーは ObjectModel で定義されている。リファレンスに記載されていないのは間違い。リファレンスはシグナルも漏れている。

参考情報

Text

モジュール

QtQuick 2.9

クラス継承

QQuickText → QQuickItemQObject

プロパティー

advance: size = Qt.size(-1, -1) readonly
baseUrl: url = 現在ファイル
bottomPadding: real = 0
color: color = #ff000000
contentHeight: real = プラットフォームデフォルト readonly
contentWidth: real = 0 readonly
effectiveHorizontalAlignment: HAlignment = Text.AlignLeft readonly
elide: TextElideMode = Text.ElideNone
font: font = プラットフォームデフォルト
fontInfo: QJSValue readonly
fontSizeMode: FontSizeMode = Text.FixedFont
horizontalAlignment: HAlignment = Text.AlignLeft
hoveredLink: string = "" readonly
leftPadding: real = 0
lineCount: int = 1 readonly
lineHeight: real = 1
lineHeightMode: LineHeightMode = Text.ProportionalHeight
linkColor: color = #ff0000ff
maximumLineCount: int = 2147483647
minimumPixelSize: int = 12
minimumPointSize: int = 12
padding: real = 0
paintedHeight: real = プラットフォームデフォルト readonly
paintedWidth: real = 0 readonly
renderType: RenderType = Text.QtRendering
rightPadding: real = 0
style: TextStyle = Text.Normal
styleColor: color = #ff000000
text: string = ""
textFormat: TextFormat = Text.AutoText
topPadding: real = 0
truncated: bool = false readonly
verticalAlignment: VAlignment = Text.AlignTop
wrapMode: WrapMode = Text.NoWrap

シグナル

contentSizeChanged()
linkActivated(string link)
linkHovered(string link)
lineLaidOut(QQuickTextLine* line)
baseUrlChanged()
bottomPaddingChanged()
colorChanged()
effectiveHorizontalAlignmentChanged()
elideModeChanged(Text::TextElideMode mode)
fontChanged(font font)
fontInfoChanged()
fontSizeModeChanged()
horizontalAlignmentChanged(Text::HAlignment alignment)
leftPaddingChanged()
lineCountChanged()
lineHeightChanged(real lineHeight)
lineHeightModeChanged(LineHeightMode mode)
lineLaidOut(QQuickTextLine* line)
maximumLineCountChanged()
minimumPixelSizeChanged()
minimumPointSizeChanged()
paddingChanged()
renderTypeChanged()
rightPaddingChanged()
styleChanged(Text::TextStyle style)
styleColorChanged()
textChanged(string text)
textFormatChanged(Text::TextFormat textFormat)
topPaddingChanged()
truncatedChanged()
verticalAlignmentChanged(Text::VAlignment alignment)
wrapModeChanged()

メソッド

void doLayout()
void forceLayout()
string linkAt(qreal x, qreal y)

列挙

HAlignment
    AlignLeft
    AlignRight
    AlignHCenter
    AlignJustify
VAlignment
    AlignTop
    AlignBottom
    AlignVCenter
TextStyle
    Normal
    Outline
    Raised
    Sunken
TextFormat
    PlainText
    RichText
    AutoText
    StyledText
TextElideMode
    ElideLeft
    ElideRight
    ElideMiddle
    ElideNone
WrapMode
    NoWrap
    WordWrap
    WrapAnywhere
    WrapAtWordBoundaryOrAnywhere
    Wrap
RenderType
    QtRendering
    NativeRendering
LineHeightMode
    ProportionalHeight
    FixedHeight
FontSizeMode
    FixedSize
    HorizontalFit
    VerticalFit
    Fit

説明


プロパティーの説明

advance: size

baseUrl: url

bottomPadding:

color: color

contentHeight: real

contentWidth: real

effectiveHorizontalAlignment: HAlignment

elide: TextElideMode

font: font

font を参照。

fontInfo: QJSValue

設定フォントと fontSizeMode から求められ実際に使われているフォントの情報。fontInfo を参照。

fontSizeMode: FontSizeMode

horizontalAlignment: HAlignment

hoveredLink: string

leftPadding: real

lineCount: int

lineHeight: real

lineHeightMode: LineHeightMode

linkColor: color

maximumLineCount: int

minimumPixelSize: int

minimumPointSize: int

padding: real

paintedHeight: real

paintedWidth: real

renderType: RenderType

rightPadding: real

style: TextStyle

styleColor: color

text: string

textFormat: TextFormat

topPadding: real

truncated: bool

verticalAlignment: VAlignment

wrapMode: WrapMode

シグナルの説明

contentSizeChanged()

advance、contentWidth、contentHeight、paintedWidth、paintedHeight のいずれが変更されると送信される通知シグナル。

linkActivated(string link)

linkHovered(string link)

lineLaidOut(QQuickTextLine* line)

メソッドの説明

void doLayout()

廃止、Qt 6 で削除予定。代わりに forceLayout() を使う。

void forceLayout()

string linkAt(real x, real y)

列挙の説明


問題


リファレンスのプロパティーに clip が入っているがオーバーライドされていないので Text のプロパティーではなく Item のプロパティーが正しい。

下線がベースラインの下に引かれるプラットフォームで renderType を Text.NativeRendering に設定してもテキスト最下端に下線が引かれてしまうので見栄えが劣る。

elide の型が TextElideMode だが、FontMetrics の elidedText() の mode  仮引数の型は Qt::TextElideMode になっていて一貫性を欠いている。

参考情報

Text QML Type