QML Loader strange behavior - qml

I'm having issues rendering using OpenGL with a QQuickItem.
The setup:
I've partitioned the app window into a status bar and a display area. The display area will be used to render output from various Qt plugins. I'm using the QML Loader object to dynamically load the objects from the plugins as needed.
The problem:
I've duplicated the opengl rendering with qml example. If I load it into the display area directly it works perfectly. If I load it into the display area using a Loader it displays nothing. I've logged debugging messages and it's definitely running. I've debugged the app using GDebugger and it appears to be sending OpenGL calls.
Does the loader object mess with the window context?
Any suggestions on how to get this to work?
Is source for the loader object available somewhere?

The problem was not that the custom control wasn't drawing. It was my misuse of QML.
The dynamic loader was adding the content to a 'column' control. The layout controls exhibit 'undefined behavior' if you use them incorrectly. Changing to manual layout using anchors corrected the issue.

Related

How to detect map container resize due to slow loading image?

I am creating an app with a Leaflet map in Nuxt using Vue2Leaflet plugin.
I am having a problem though: I am using Bootstrap columns to size the map and accompanying image, but the image loads too slow (this cannot be resolved at this time), so the container is not the proper size when the map loads.
This causes the map to be half grey. I have attempted to call map.invalidateSize() in the mounted event, but even that must be happening before the image finishes loading.
I have setup a sandbox at: https://codesandbox.io/s/eager-bohr-c3453?file=/src/App.vue
In order to see the bug, you have to view the rendered app at https://c3453.csb.app/ (the internal codesandbox render does not show the problem)
I think I need some way to wait until the image has completed loading (so the BS col is the proper size), then call map.invalidateSize(), but I am not sure how...
You can attach an onload listener on your <img>, so that you can call (again?) your Leaflet map invalidateSize() method.

(MacOS) How to get a pointer to an application's NSStatusItem

I am working in a system where I do not have reference to the application's NSStatusItem (or anything really). Is there a way to snag a reference to a previously created NSStatisItem? I can construct a new icon with statusItemWithLength but the associated menu and actions are lost.
A little bit of background, this is actually a Java application and there is currently no way to set a status icon to use Mac's template behavior. Previously we just changed the icon color manually, but BigSur doesn't throw an event when it decides to change the statusBar's color. I was going to attempt to set statusItem.button.image.template to true using native calls, but while prototyping in obj-c I ran into this issue.
Any help is appreciated.

How to Set Scrollbar theme in XAML webview?

I'm creating a windows 10 xaml app. One of the views contains a webview which fetches some html.
My problem is that although the default theme on the app is set to dark, the scrollbar in the webview is always light, which jars against the rest of the UI.
I've tried setting the RequestedTheme=dark on the webview, but no joy
Unfortunately this isn't possible since the WebView is based off of Edge and Edge doesn't currently support it, as you can see here. If Edge gets this feature, you could simply insert a STYLE into your head element to define the color.

Change style of the widgets in GTK#

Are there other methods for changing style of the widgets in GTK# like gtkrc themes? I already tried to use themes but not successfully. Pixbuf engine is the only engine which correctly rendered in my GTK# application, but when I trying to resize any widget, my UI is working slowly and freezes. So are there any other methods for changing style of the widgets in GTK# app without gtkrc?
You must using cairo library to draw new widget.
below references is useful:
http://pygtk.org/articles/cairo-pygtk-widgets/cairo-pygtk-widgets.htm
http://www.tortall.net/mu/wiki/PyGTKCairoTutorial
http://manwhocodes.blogspot.com/2013/04/drawing-with-cairo-in-pygtk.html
http://zetcode.com/gui/pygtk/
you can inherit from a gtk widget similar EventBox and change face of this and draw different face on firing different events.

Compute rendering time in a Qt5 QML Application

I am using QT5 alpha for developing a QML app for a linux based tablet. The app gets slow upon having a certain number of qml widgets. I need to know how much time is spent to render each frame. Which component performs the rendering of the qml scenegraph and how can I compute frame time?
Thanks
You need to checkout qtdeclarative module. Rendering class is in src/quick/scenegraph/coreapi/ check qsgdefaultrenderer.cpp. However it may not help, because scenegraph renders everything at once. Each QML item is translated into much simplier nodes. Those nodes then combined into a list and then whole list is rendered. You may want to use QML profiler which comes with QT Creator.
Have you looked at the QML profiler in Qt Creator? In addition to rendering time it displays the cost of binding evaluation, component creation, and signal handling.