how to refresh a qwidget for image display? - qt

I m using widget to display a set of images.each time only one image is displayed..a slider is also attached with this widget as i move the slider another images of set are displayed on widget according to slider value...there is a push button to start the operation of displaying images.
Now my problem is when i click on push button first time.everything works fine but if i click on it second time to display another set of images.it doesn't get updated but if i move the slider it display images correctly even if i move back the slider it works fine..
so problem is only with the first time display of second set of images..so how to resolve it??

I had the same problem.
Use
QCoreApplication::processEvents(0);
to refresh.

Related

How to display ngx-timepicker-field timepicker next to a div , instead of showing it as a pop up

I want to display a time picker in my application in which either user can enter the time manually or pick it from a time picker.
And for this, I am using the ngx-timepicker-field and it works perfectly fine.
The issue is instead of showing the time picker pop up in the middle of the page is there any option available to show it near to the input filed or a div. similar to appends to input option available for ngx-material-timepicker
Reference link: https://agranom.github.io/ngx-material-timepicker/
Any help would be highly appreciated.
Thanks

Console preview panel - how to reset size?

So the console preview panel at the bottom of the page remembers how big you had it last time you previewed. Usually this is great! But somehow mine is currently maximized, so the only thing that shows up is the Page dropdown at the top of the page (and anything in the console, if I switch between pages and the pages have things that log on load). The rest is just white console. Any idea how to get back the default view where the console is 20% of the bottom of the page? There is no visible dragging bar frame thing anywhere.
I can change my preview to console=0 to be able to use it, but I'd like a way to restore the default position of the panel.
Normally you should be able to hover on the top border of the console panel and resize it as you wish. An icon will appear, similar as in the image below:
Nonetheless, if you are doing your previews on a mobile device such as a tablet, then such thing is not possible to do. Therefore; a hacky way to do it would be to put the following code on the onAttach event handler of the page that is loading:
var splitPanel = widget.root.getElement().parentElement
.parentElement.parentElement.parentElement
.parentElement.parentElement.children[0].children[3];
splitPanel.style.height = "75px";
Nota bene: this is intended to ONLY work in preview

Dragged element appearing behind <md-tabs>

I'm having a button md-tab- Drag-me that have kept inside a tab. And am having another tab that needs to hold the dragged button.
Scenario:
When I try to drag the button it appears to go behind the tab.I need to ensure that it displays all the time whenever I start dragging and dropping ..
Please find the below example demo on codepen
I have used angular-dragdrop for dragging and dropping button.

Google VR Reticle Click on UI Button

So I am having this issue with using Google VR reticle where I cannot click a button. I have an image attached showing the heirarchy and the PlayButton is what I am trying to click. The Canvas has a Graphic Raycaster, the button has an Event Trigger that calls the method to navigate to the next scene. The UpScrollPanel, and DownScrollPanel work just fine. The EventSystem has the Gaze Input Module, as well as Event System, and Touch Input Module.
Any ideas on how to get this working? I have watched a few videos from NurFACEGAMES and while they helped a little, I haven't gotten the click to work yet.
Oh, and I am using Unity 5.3.4f
Sometimes things can get in the way of the button, make sure that no other UI elements overlap it, for example text borders (which are actually larger than they appear). You can also fix this by moving the button up the hierarchy among its siblings, I believe the first child is top.
Also try moving the button up the hierarchy if possible, sometimes UI having certain parents makes them not work
The canvas object should have a graphic raycaster
I found the issue to be unrelated to anything I thought it was. The menu I was using is a prefab I also use in another view that isn't VR. The scrollrect was loading that prefab, instead of the modified one I was using in the VR menu, and therefore the triggers I had added to the button were no being used when the app loaded.

Show context menu of QSystemTrayIcon without user click

I have a QSystemTrayIcon, that displays a QMenu on click, but I want to display the menu as soon as the tray icon is displayed. I have tried calling the show method on the QMenu, but the menu only seems to display when it is clicked. Any idea on how to change this behaviour?
I'm not sure if it's possible to trigger the behaviour triggered by operating system when user clicks the system tray, but at least you should be able to use QMenu::popup method to just show the menu returned by QSystemTrayIcon::contextMenu method.
Note that you should use the menu's size hint, when you calculate the menu postion relative to QSystemTrayIcon::geometry. Also you may need to use QDesktopWidget::availableGeometry to make sure the menu pops up inside the screen, no matter where the task bar is.

Resources