1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-07 03:22:33 +01:00

Add refresh ability of widgets via F5

This commit is contained in:
Elias 2020-01-23 09:48:48 +01:00
parent 789abb1535
commit 4c4f5356e9
3 changed files with 21 additions and 0 deletions

View File

@ -23,6 +23,21 @@ Item {
}
}
Action {
shortcut: "F5"
onTriggered: {
loader.sourceComponent = undefined
loader.source = ""
Widget.clearComponentCache()
if (Widget.type === "qmlWidget") {
loader.source = Qt.resolvedUrl(Widget.sourcePath)
} else if (Widget.type === "htmlWidget") {
loader.sourceComponent = webViewComponent
}
}
}
OpacityAnimator {
id: animFadeOut
from: 1

View File

@ -90,6 +90,11 @@ void WidgetWindow::setWidgetSize(const int with, const int height)
m_window.setHeight(height);
}
void WidgetWindow::clearComponentCache()
{
m_window.engine()->clearComponentCache();
}
#ifdef Q_OS_WIN
void WidgetWindow::setWindowBlur(unsigned int style)
{

View File

@ -68,6 +68,7 @@ public slots:
void setPos(int xPos, int yPos);
void setClickPos(const QPoint& clickPos);
void setWidgetSize(const int with, const int height);
void clearComponentCache();
void setAppID(QString appID)
{