mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-07-04 08:15:30 +08:00
qt 6.5.1 original
This commit is contained in:
18
tests/manual/qcursor/allcursors/CMakeLists.txt
Normal file
18
tests/manual/qcursor/allcursors/CMakeLists.txt
Normal file
@ -0,0 +1,18 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#####################################################################
|
||||
## tst_allcursors Binary:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_add_manual_test(tst_allcursors
|
||||
GUI
|
||||
SOURCES
|
||||
main.cpp
|
||||
mainwindow.cpp mainwindow.h mainwindow.ui
|
||||
LIBRARIES
|
||||
Qt::Gui
|
||||
Qt::Widgets
|
||||
ENABLE_AUTOGEN_TOOLS
|
||||
uic
|
||||
)
|
10
tests/manual/qcursor/allcursors/allcursors.pro
Normal file
10
tests/manual/qcursor/allcursors/allcursors.pro
Normal file
@ -0,0 +1,10 @@
|
||||
TARGET = tst_allcursors
|
||||
TEMPLATE = app
|
||||
QT = core gui widgets
|
||||
|
||||
SOURCES += main.cpp\
|
||||
mainwindow.cpp
|
||||
|
||||
HEADERS += mainwindow.h
|
||||
|
||||
FORMS += mainwindow.ui
|
16
tests/manual/qcursor/allcursors/main.cpp
Normal file
16
tests/manual/qcursor/allcursors/main.cpp
Normal file
@ -0,0 +1,16 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include <QApplication>
|
||||
#include "mainwindow.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
MainWindow w;
|
||||
w.showFullScreen();
|
||||
#ifdef QT_KEYPAD_NAVIGATION
|
||||
QApplication::setNavigationMode(Qt::NavigationModeCursorForceVisible);
|
||||
#endif
|
||||
return a.exec();
|
||||
}
|
49
tests/manual/qcursor/allcursors/mainwindow.cpp
Normal file
49
tests/manual/qcursor/allcursors/mainwindow.cpp
Normal file
@ -0,0 +1,49 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
|
||||
#include <QTimer>
|
||||
#include <QBitmap>
|
||||
#include <QImage>
|
||||
#include <QPainter>
|
||||
#include <QKeyEvent>
|
||||
#include <QPoint>
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent) :
|
||||
QMainWindow(parent), ui(new Ui::MainWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void MainWindow::keyPressEvent(QKeyEvent* event)
|
||||
{
|
||||
QPoint off(0, 0);
|
||||
switch (event->key()) {
|
||||
case Qt::Key_Q:
|
||||
qApp->quit();
|
||||
break;
|
||||
case Qt::Key_Up:
|
||||
off.setY(-4);
|
||||
break;
|
||||
case Qt::Key_Down:
|
||||
off.setY(4);
|
||||
break;
|
||||
case Qt::Key_Left:
|
||||
off.setX(-4);
|
||||
break;
|
||||
case Qt::Key_Right:
|
||||
off.setX(4);
|
||||
break;
|
||||
default:
|
||||
return QMainWindow::keyPressEvent(event);
|
||||
}
|
||||
off += QCursor::pos();
|
||||
QCursor::setPos(off);
|
||||
}
|
30
tests/manual/qcursor/allcursors/mainwindow.h
Normal file
30
tests/manual/qcursor/allcursors/mainwindow.h
Normal file
@ -0,0 +1,30 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
|
||||
#include <QMainWindow>
|
||||
|
||||
class QTimer;
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class MainWindow;
|
||||
}
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MainWindow(QWidget *parent = nullptr);
|
||||
~MainWindow();
|
||||
|
||||
private:
|
||||
void keyPressEvent(QKeyEvent* event);
|
||||
|
||||
Ui::MainWindow *ui;
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
210
tests/manual/qcursor/allcursors/mainwindow.ui
Normal file
210
tests/manual/qcursor/allcursors/mainwindow.ui
Normal file
@ -0,0 +1,210 @@
|
||||
<?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>240</width>
|
||||
<height>320</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Arrow</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="cursor">
|
||||
<cursorShape>UpArrowCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>up arrow</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="cursor">
|
||||
<cursorShape>CrossCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>cross</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="cursor">
|
||||
<cursorShape>WaitCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>wait</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="cursor">
|
||||
<cursorShape>IBeamCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>ibeam</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="cursor">
|
||||
<cursorShape>SizeVerCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>sizever</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="cursor">
|
||||
<cursorShape>SizeHorCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>sizehor</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="cursor">
|
||||
<cursorShape>SizeFDiagCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>sizebdiag</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="cursor">
|
||||
<cursorShape>SizeBDiagCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>sizefdiag</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="cursor">
|
||||
<cursorShape>SizeAllCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>sizeall</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="cursor">
|
||||
<cursorShape>BlankCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>blank</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="cursor">
|
||||
<cursorShape>SplitVCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>splitv</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="cursor">
|
||||
<cursorShape>SplitHCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>splith</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="cursor">
|
||||
<cursorShape>PointingHandCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>pointhand</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="QLabel" name="label_15">
|
||||
<property name="cursor">
|
||||
<cursorShape>ForbiddenCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>forbidden</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_16">
|
||||
<property name="cursor">
|
||||
<cursorShape>WhatsThisCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>whatsthis</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLabel" name="label_19">
|
||||
<property name="cursor">
|
||||
<cursorShape>BusyCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>busy</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_17">
|
||||
<property name="cursor">
|
||||
<cursorShape>OpenHandCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>openhand</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QLabel" name="label_18">
|
||||
<property name="cursor">
|
||||
<cursorShape>ClosedHandCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>closehand</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
Reference in New Issue
Block a user