mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-07-04 16:25:27 +08:00
6.5.3 clean
This commit is contained in:
37
tests/manual/examples/widgets/touch/dials/CMakeLists.txt
Normal file
37
tests/manual/examples/widgets/touch/dials/CMakeLists.txt
Normal file
@ -0,0 +1,37 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
project(dials LANGUAGES CXX)
|
||||
|
||||
if(NOT DEFINED INSTALL_EXAMPLESDIR)
|
||||
set(INSTALL_EXAMPLESDIR "examples")
|
||||
endif()
|
||||
|
||||
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/touch/dials")
|
||||
|
||||
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
|
||||
|
||||
qt_standard_project_setup()
|
||||
|
||||
qt_add_executable(dials
|
||||
dials.ui
|
||||
main.cpp
|
||||
)
|
||||
|
||||
set_target_properties(dials PROPERTIES
|
||||
WIN32_EXECUTABLE TRUE
|
||||
MACOSX_BUNDLE TRUE
|
||||
)
|
||||
|
||||
target_link_libraries(dials PRIVATE
|
||||
Qt6::Core
|
||||
Qt6::Gui
|
||||
Qt6::Widgets
|
||||
)
|
||||
|
||||
install(TARGETS dials
|
||||
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
|
||||
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
|
||||
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
|
||||
)
|
8
tests/manual/examples/widgets/touch/dials/dials.pro
Normal file
8
tests/manual/examples/widgets/touch/dials/dials.pro
Normal file
@ -0,0 +1,8 @@
|
||||
QT += widgets
|
||||
|
||||
SOURCES += main.cpp
|
||||
FORMS += dials.ui
|
||||
|
||||
# install
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/touch/dials
|
||||
INSTALLS += target
|
77
tests/manual/examples/widgets/touch/dials/dials.ui
Normal file
77
tests/manual/examples/widgets/touch/dials/dials.ui
Normal file
@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Dials</class>
|
||||
<widget class="QWidget" name="Dials">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QDial" name="dial_1">
|
||||
<property name="notchesVisible">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QDial" name="dial_2">
|
||||
<property name="notchesVisible">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QDial" name="dial_3">
|
||||
<property name="notchesVisible">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QDial" name="dial_4">
|
||||
<property name="notchesVisible">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QDial" name="dial_5">
|
||||
<property name="notchesVisible">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QDial" name="dial_6">
|
||||
<property name="notchesVisible">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QDial" name="dial_7">
|
||||
<property name="notchesVisible">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QDial" name="dial_8">
|
||||
<property name="notchesVisible">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
@ -0,0 +1,14 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
||||
|
||||
/*!
|
||||
\example touch/dials
|
||||
\title Touch Dials Example
|
||||
\ingroup touchinputexamples
|
||||
\brief Shows how to apply touch to a set of standard Qt widgets.
|
||||
|
||||
The Touch Dials example shows how to apply touch to a set of
|
||||
standard Qt widgets.
|
||||
|
||||
\image touch-dials-example.png
|
||||
*/
|
21
tests/manual/examples/widgets/touch/dials/main.cpp
Normal file
21
tests/manual/examples/widgets/touch/dials/main.cpp
Normal file
@ -0,0 +1,21 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
||||
|
||||
#include <QApplication>
|
||||
#include <QWidget>
|
||||
#include <QDial>
|
||||
|
||||
#include "ui_dials.h"
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
QWidget window;
|
||||
Ui::Dials dialsUi;
|
||||
dialsUi.setupUi(&window);
|
||||
const QList<QAbstractSlider *> sliders = window.findChildren<QAbstractSlider *>();
|
||||
for (QAbstractSlider *slider : sliders)
|
||||
slider->setAttribute(Qt::WA_AcceptTouchEvents);
|
||||
window.showMaximized();
|
||||
return app.exec();
|
||||
}
|
Reference in New Issue
Block a user