mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-04-20 03:25:02 +00:00
准备qml动画
This commit is contained in:
parent
64aef1ef73
commit
fb4ddd216c
5 changed files with 37 additions and 2 deletions
|
@ -5,7 +5,7 @@
|
|||
#-------------------------------------------------
|
||||
|
||||
QT += core gui
|
||||
QT += network
|
||||
QT += network quickwidgets
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
|
|
BIN
QtScrcpy/qml/images/pinwheel.png
Normal file
BIN
QtScrcpy/qml/images/pinwheel.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
19
QtScrcpy/qml/pinwheel.qml
Normal file
19
QtScrcpy/qml/pinwheel.qml
Normal file
|
@ -0,0 +1,19 @@
|
|||
import QtQuick 2.5
|
||||
import QtGraphicalEffects 1.0
|
||||
Image {
|
||||
Image {
|
||||
id: wheel
|
||||
anchors.centerIn: parent
|
||||
source: "images/pinwheel.png"
|
||||
|
||||
RotationAnimation {
|
||||
id:rotationAnimation
|
||||
target: wheel
|
||||
to:360000
|
||||
direction: RotationAnimation.Clockwise
|
||||
duration: 800000
|
||||
}
|
||||
|
||||
onStatusChanged: if (wheel.status == Image.Ready) rotationAnimation.start()
|
||||
}
|
||||
}
|
|
@ -4,5 +4,7 @@
|
|||
<file>res/fontawesome-webfont.ttf</file>
|
||||
<file>res/phone-h.png</file>
|
||||
<file>res/phone-v.png</file>
|
||||
<file>qml/pinwheel.qml</file>
|
||||
<file>qml/images/pinwheel.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#ifdef Q_OS_WIN32
|
||||
#include <Windows.h>
|
||||
#endif
|
||||
#include <QQuickWidget>
|
||||
|
||||
#include "videoform.h"
|
||||
#include "ui_videoform.h"
|
||||
|
@ -19,7 +20,8 @@ VideoForm::VideoForm(const QString& serial, QWidget *parent) :
|
|||
m_serial(serial)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
QPixmap phone;
|
||||
if (phone.load(":/res/phone.png")) {
|
||||
|
@ -116,6 +118,18 @@ VideoForm::VideoForm(const QString& serial, QWidget *parent) :
|
|||
bool vertical = size().height() > size().width();
|
||||
updateStyleSheet(vertical);
|
||||
|
||||
/*
|
||||
ui->videoWidget->hide();
|
||||
// qquickwidget
|
||||
QQuickWidget* pinwheel = new QQuickWidget(this);
|
||||
pinwheel->setObjectName(QString::fromUtf8("pinwheel"));
|
||||
pinwheel->setAutoFillBackground(false);
|
||||
pinwheel->setResizeMode(QQuickWidget::SizeRootObjectToView);
|
||||
pinwheel->setSource(QUrl(QString::fromUtf8("qrc:/qml/pinwheel.qml")));
|
||||
pinwheel->setClearColor(QColor(Qt::transparent));
|
||||
pinwheel->setGeometry(ui->videoWidget->geometry());
|
||||
pinwheel->show();
|
||||
*/
|
||||
ToolForm* mw = new ToolForm(this, ToolForm::AP_OUTSIDE_RIGHT);
|
||||
mw->move(pos().x() + geometry().width(), pos().y() + 30);
|
||||
mw->show();
|
||||
|
|
Loading…
Add table
Reference in a new issue