Advance Wayland and KDE package bring-up
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
include(ECMMarkAsTest)
|
||||
|
||||
find_package(Qt6Test REQUIRED)
|
||||
|
||||
add_executable(qimageitemtest qimageitemtest.cpp)
|
||||
|
||||
ecm_mark_as_test(qimageitemtest)
|
||||
target_link_libraries(qimageitemtest
|
||||
Qt6::Quick
|
||||
Qt6::Test
|
||||
)
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
SPDX-FileCopyrightText: 2015 David Edmundson <davidedmundson@kde.org>
|
||||
|
||||
SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
*/
|
||||
|
||||
import QtQuick 2.1
|
||||
import org.kde.kquickcontrols 2.0
|
||||
|
||||
Rectangle {
|
||||
width: 300
|
||||
height: 300
|
||||
color: "white"
|
||||
|
||||
ColorButton {
|
||||
id: btn
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.margins: 10
|
||||
|
||||
dialogTitle: "I am title"
|
||||
showAlphaChannel: true
|
||||
|
||||
color: "blue" //a default colour
|
||||
}
|
||||
|
||||
|
||||
Rectangle {
|
||||
anchors.top: parent.top
|
||||
anchors.left: btn.right
|
||||
anchors.margins: 10
|
||||
|
||||
width: 20
|
||||
height: 20
|
||||
|
||||
color: btn.color
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import QtQuick 2.0
|
||||
|
||||
import org.kde.kquickcontrols 2.0
|
||||
import QtQuick.Layouts 1.1
|
||||
|
||||
RowLayout {
|
||||
|
||||
KeySequenceItem
|
||||
{
|
||||
id: sequenceItem
|
||||
modifierOnlyAllowed: true
|
||||
}
|
||||
Text
|
||||
{
|
||||
text: sequenceItem.keySequence
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Window 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
|
||||
import org.kde.kirigami 2.11 as Kirigami
|
||||
import org.kde.kquickcontrols 2.0
|
||||
|
||||
Kirigami.ApplicationWindow {
|
||||
width: 640
|
||||
height: 480
|
||||
visible: true
|
||||
title: qsTr("Test")
|
||||
|
||||
ColumnLayout {
|
||||
KeySequenceItem {
|
||||
checkForConflictsAgainst: ShortcutType.None
|
||||
modifierlessAllowed: true
|
||||
}
|
||||
KeySequenceItem {
|
||||
checkForConflictsAgainst: ShortcutType.None
|
||||
modifierlessAllowed: true
|
||||
}
|
||||
KeySequenceItem {
|
||||
checkForConflictsAgainst: ShortcutType.None
|
||||
modifierlessAllowed: true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
SPDX-FileCopyrightText: 2014 David Edmundson <davidedmundson@kde.org>
|
||||
|
||||
SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
*/
|
||||
|
||||
import org.kde.qtextracomponents 2.0
|
||||
import QtQuick 2.1
|
||||
import QtQuick.Layouts 1.0
|
||||
|
||||
|
||||
Item
|
||||
{
|
||||
width: 800
|
||||
height: 400
|
||||
Row {
|
||||
anchors.fill: parent
|
||||
MouseEventListener {
|
||||
width: 400
|
||||
height: 400
|
||||
id: mouseListener
|
||||
acceptedButtons: Qt.LeftButton
|
||||
hoverEnabled: true
|
||||
onPressed: {
|
||||
updateDebug("Pressed", mouse);
|
||||
}
|
||||
onPressAndHold: {
|
||||
updateDebug("Held", mouse);
|
||||
}
|
||||
onReleased: {
|
||||
mouseState.text = "";
|
||||
mousePos.text = "";
|
||||
screenPos.text = "";
|
||||
}
|
||||
|
||||
function updateDebug(state, mouse) {
|
||||
mouseState.text = state
|
||||
mousePos.text = mouse.x + "," + mouse.y
|
||||
screenPos.text = mouse.screenX + "," + mouse.screenY
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
color: "red"
|
||||
anchors.fill: parent
|
||||
|
||||
//MouseEventListener should still get events, even though this has a mousearea
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GridLayout {
|
||||
width: 400
|
||||
columns: 2
|
||||
Text {
|
||||
text: "Mouse status:"
|
||||
}
|
||||
Text {
|
||||
id: mouseState
|
||||
}
|
||||
Text {
|
||||
text: "Contains Mouse: "
|
||||
}
|
||||
Text {
|
||||
text: mouseListener.containsMouse
|
||||
}
|
||||
Text {
|
||||
text: "Mouse Position: "
|
||||
}
|
||||
Text {
|
||||
id: mousePos
|
||||
}
|
||||
Text {
|
||||
text: "Screen Position: "
|
||||
}
|
||||
Text {
|
||||
id: screenPos
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
SPDX-FileCopyrightText: 2011 Marco Martin <mart@gmail.com>
|
||||
|
||||
SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include <QGuiApplication>
|
||||
#include <QQmlContext>
|
||||
#include <QQuickView>
|
||||
|
||||
#include <qtestcase.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QGuiApplication app(argc, argv);
|
||||
|
||||
QQuickView view;
|
||||
QQmlContext *context = view.rootContext();
|
||||
|
||||
QImage image;
|
||||
if (app.devicePixelRatio() < 2) {
|
||||
image = QImage(QFINDTESTDATA("testimage.png"));
|
||||
} else {
|
||||
image = QImage(QFINDTESTDATA("testimage@2x.png"));
|
||||
image.setDevicePixelRatio(2);
|
||||
}
|
||||
|
||||
context->setContextProperty(QStringLiteral("testImage"), image);
|
||||
|
||||
view.setSource(QUrl::fromLocalFile(QFINDTESTDATA("qimageitemtest.qml")));
|
||||
view.show();
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
import QtQuick 2.0
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Controls 2.15
|
||||
import org.kde.kquickcontrolsaddons 2.0 as KQCA
|
||||
|
||||
//this file should be used via qimageitemtest executable
|
||||
//unless you want to test isNull
|
||||
|
||||
Rectangle {
|
||||
color: "white"
|
||||
width: 500
|
||||
height: 500
|
||||
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
KQCA.QImageItem {
|
||||
implicitWidth: 300
|
||||
implicitHeight: 300
|
||||
|
||||
id: image
|
||||
image: testImage
|
||||
fillMode: fillModeCombo.currentIndex
|
||||
}
|
||||
GridLayout {
|
||||
columns: 2
|
||||
Text {text: "fillMode"}
|
||||
ComboBox {
|
||||
id: fillModeCombo
|
||||
model: ListModel{
|
||||
ListElement {
|
||||
display: "Stretch"
|
||||
}
|
||||
ListElement {
|
||||
display: "PreserveAspectFit"
|
||||
}ListElement {
|
||||
display: "PreserveAspectCrop"
|
||||
}ListElement {
|
||||
display: "Tile"
|
||||
}ListElement {
|
||||
display: "TileVertically"
|
||||
}
|
||||
ListElement {
|
||||
display: "TileHorizontally"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Text {text: "isNull:"}
|
||||
Text {text: image.null}
|
||||
Text {text: "nativeWidth:"}
|
||||
Text {text: image.nativeWidth}
|
||||
Text {text: "nativeHeight:"}
|
||||
Text {text: image.nativeHeight}
|
||||
Text {text: "paintedWidth:"}
|
||||
Text {text: image.paintedWidth}
|
||||
Text {text: "paintedHeight:"}
|
||||
Text {text: image.paintedHeight}
|
||||
|
||||
Text {text: "rect size is 300x300"}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 8.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
Reference in New Issue
Block a user