QtWebAssembly - Push button does not work - qt

I am new to QtWebAssembly. I am trying to build a simple app "Hello World" as a starting point to understand. The app contains a push button and when it is clicked a qlabel with text is set to visible using slot.
When i build and run the app, my firefox browser runs and opens a page as shown below:
ex-app
But, i am not able to access the button or the button is not working.
I am working on OS - Ubuntu 20.x
I need an helping hand on what i am missing so that when I press the button the qlabel should be visible.
Thank you.
Bhimesh G K

Related

Showing a QMessageBox breaks QLineEdit highlighting

I have a C++ Qt 4 application written for Raspberry Pi. I'm experiencing an odd side-effect of showing a QMessageBox and I don't know enough about Qt to debug it.
The pi has a touchscreen, so I launch the application with unclutter to hide the mouse cursor. (Though this doesn't affect my issue... I have tried without unclutter just in case.)
I have sub-classed QLineEdit to override focusInEvent() and focusOutEvent() to select-all when a LineEdit gets focus, and deselect-all when it loses focus.
Before showing any QMessageBoxes, everything works perfectly - tapping on a QLineEdit selects all the text; tapping the next one de-selects the previous QLineEdit, and selects the new QLineEdit.
After showing a QMessageBox, my overridden events stop working, and QLineEdits no longer auto-select and de-select.
If I add:
msgBox.setWindowFlags(msgBox.windowFlags() | Qt::Popup);
before I exec() the QMessageBox, then text highlighting continues working normally, but the cursor is displayed and flickers while the QMessageBox is on the screen.
It seems like there is a side-effect of showing the QMessageBox that affects the calling window and my sub-classed QLineEdit boxes... but not if the QMessageBox has the Popup flag set!
I've tried storing and manually re-loading the flags on the main window, and that does nothing, so it doesn't appear to be flags on the main window.
One more oddity: everything works fine if I run the application remotely over XMing and SSH... it's only when it's run locally on the Pi in plain-old X11 that it freaks out.
Any thoughts on how to debug this? Thank you!
I was able to work around this by doing two things.
First, I updated the flags of the QMessageBox before opening it:
msgBox.setWindowFlags(Qt::Popup);
msgBox.exec();
and second, I hid the cursor in Qt code, rather than relying on Unclutter; this fixed the flickering cursor issue:
QApplication::setOverrideCursor(Qt::BlankCursor);

Misplaced button in dialog window of JqGrid, works fine while developers tools opened

The strangest behaviour occured and I can't handle it myself.
I have ASP .NET MVC application with Jqgrid version 5.1.0. Everything works fine, beside one dialog window.
In my grid I use default deletion method. There is delete button defined by $(tableHtmlId).navGrid( ... ) function. After clicking delete button, confirmation dialog window appears. This dialog has misplaced cancel button (the one on top-right corner), as shown on following screen:
I thought about editing css styles, so I hit the console button, and as soon as develpers tool window appeard, look what happened:
Everything look fine. However, when I put cursor over cancel button, it goes back to wrong:
This behaviour occurs on Chrome, Firefox and IE. This bug is too atomic for me to solve. Please help. :)

Java FX 8 Popup does not move focus back to application

I have a Java FX application in which I show a Popup that contains a text field. I intentionally keep this popup visible even when the user clicks away from it. This works fine except for one case:
When the user has focus on the text field in the Popup, then clicks on a separate application, and then clicks back onto the text field. The FX application does not regain focus from the OS. If the user types on the keyboard, the other application will still receive the keyboard input. To work around this, the user has to click on the main FX application window outside of the popup.
The strange thing is that, in debugging, I can see that the text field in the Popup is getting focus, but the OS does not show that the FX application is now in focus. Is there a way that I can force the OS to move focus to my application?
This occurs on Windows and Mac. I tested with jdk 8 update 45 and jdk 8 update 92.
I did a test with a minimum Popup:
static class TestPopup extends Popup {
TestPopup() {
content.add(new TextField("Hello"))
}
}
and I show it by calling:
new TestPopup().show(somePaneInMainWindow, 0, 0)
After some research I found that this is expected behavior.
Answer found here:
http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8123137
From the link:
This is the right behavior. All the JavaFX popup windows are
unfocusable, so they can receive input only if the owner window is
currently focused. Usually popups are set to auto hide, when the owner
gets unfocused, but this is not the case in this test, so the popup
just stays around.

How to show exteranal window in qml-based application

I have an application that gui is made up with QML. The task is to start an external program (LibreOffice) "inside" my application. It means that when you press the button on the app's face, external program must be shown in the same window as the main program is. And also it can be closed by app's button that is drown under the external window.
The only thing that I could do for the moment is to start lowriter with QProcess using this article. But it is still shown in separate window and I don't know how to make a button that will close lowriter.
If somebody have any thoughts about how to do this, it would be great if you share it.. Thanks!

Unity3d 4.6 GUI - Button On Click script dissapears from prefab

I am using the new Unity3d 4.6 GUI Beta. I have created a canvas and attached a button to the canvas. I have attached a script to an empty game object with a method in it to be used by the button. When I click the button everything works fine. However, if I turn the same canvas into a prefab, when I instantiate the prefab the "On Click" portion of the button becomes empty and the button no longer functions. I also tried making just the button a prefab instead of the canvas with the button as its child and it was the same thing. I am really hoping someone knows how to make a button prefab where the button still works.
You can get around this like I did - I ended up adding the button listener manually in code (see below). Just make sure this is executed when your prefab is instantiated. The "UI way" to do this that you were trying seems broken even in the latest Unity client.
var buttonTransform = this.transform.FindChild("Button");
_buttonScript = buttonTransform.GetComponent<Button>();
_buttonScript.onClick.AddListener(() => Flip());
There is more info on this issue on the Unity site, http://answers.unity3d.com/questions/794720/on-click-paramaters-disappear-from-button-prefab.html but I couldn't find a corresponding issue logged with their team.

Resources