mirror of
https://github.com/Serial-Studio/Serial-Studio.git
synced 2025-01-15 05:22:53 +08:00
Render widgets on framebuffer
This commit is contained in:
parent
40e4b94697
commit
00640a3f4e
@ -51,6 +51,7 @@ Item {
|
||||
WidgetLoader {
|
||||
id: loader
|
||||
widgetIndex: root.widgetIndex
|
||||
renderTarget: PaintedItem.FramebufferObject
|
||||
anchors {
|
||||
fill: parent
|
||||
leftMargin: window.borderWidth
|
||||
@ -113,6 +114,7 @@ Item {
|
||||
widgetIndex: root.widgetIndex
|
||||
widgetVisible: _window.visible
|
||||
anchors.margins: _window.radius
|
||||
renderTarget: PaintedItem.FramebufferObject
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -145,6 +145,7 @@ Item {
|
||||
maximumBlockCount: 12000
|
||||
font.family: app.monoFont
|
||||
autoscroll: Cpp_IO_Console.autoscroll
|
||||
renderTarget: PaintedItem.FramebufferObject
|
||||
wordWrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
placeholderText: qsTr("No data received so far") + "..."
|
||||
|
||||
|
@ -51,10 +51,11 @@ WidgetLoader::WidgetLoader(QQuickItem *parent)
|
||||
, m_widgetVisible(false)
|
||||
, m_isExternalWindow(false)
|
||||
{
|
||||
// Set item flags
|
||||
setFlag(ItemHasContents, true);
|
||||
setFlag(ItemIsFocusScope, true);
|
||||
setFlag(ItemAcceptsInputMethod, true);
|
||||
// Set render flags
|
||||
setOpaquePainting(true);
|
||||
setAcceptHoverEvents(true);
|
||||
setRenderTarget(FramebufferObject);
|
||||
setPerformanceHints(FastFBOResizing);
|
||||
setAcceptedMouseButtons(Qt::AllButtons);
|
||||
|
||||
// Resize widget to fit QML item size
|
||||
@ -66,6 +67,9 @@ WidgetLoader::WidgetLoader(QQuickItem *parent)
|
||||
// Automatically update the widget's visibility
|
||||
connect(Dashboard::getInstance(), &Dashboard::widgetVisibilityChanged, this,
|
||||
&WidgetLoader::updateWidgetVisible);
|
||||
|
||||
// Draw widget
|
||||
QTimer::singleShot(0, this, SLOT(update()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -57,10 +57,12 @@ Terminal::Terminal(QQuickItem *parent)
|
||||
, m_copyAvailable(false)
|
||||
, m_textEdit(new QPlainTextEdit)
|
||||
{
|
||||
// Set item flags
|
||||
setFlag(ItemHasContents, true);
|
||||
setFlag(ItemAcceptsInputMethod, true);
|
||||
setFlag(ItemIsFocusScope, true);
|
||||
// Set render flags
|
||||
setAntialiasing(true);
|
||||
setOpaquePainting(true);
|
||||
setAcceptHoverEvents(true);
|
||||
setRenderTarget(FramebufferObject);
|
||||
setPerformanceHints(FastFBOResizing);
|
||||
setAcceptedMouseButtons(Qt::AllButtons);
|
||||
m_escapeCodeHandler.setTextEdit(textEdit());
|
||||
|
||||
@ -100,6 +102,9 @@ Terminal::Terminal(QQuickItem *parent)
|
||||
|
||||
// React to widget events
|
||||
connect(textEdit(), SIGNAL(copyAvailable(bool)), this, SLOT(setCopyAvailable(bool)));
|
||||
|
||||
// Draw widget
|
||||
QTimer::singleShot(0, this, SLOT(update()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user