statusBar don't get updated by setStatusTip PyQT5 - pyqt5

I try this simple example (self is a QMainWindow) :
self.statusBar().showMessage('test') #checking if the statusBar is here and works
resetInterfaceAct = QAction('&Interface de Base', self)
resetInterfaceAct.setStatusTip('Remet l\'interface de base')
resetInterfaceAct.triggered.connect(self.interfaceStd)
menuBar = self.menuBar()
interfaceMenu = menuBar.addMenu('Interface')
interfaceMenu.addAction(resetInterfaceAct)
But when I pass my mouse over the Action, nothing happens in the statusBar.
I'm coding on Ubuntu, and every example or video I looked, the code seems to be the same as I write it, but for me it don't works.
So any help will be great, thanks !

Related

Checkable Tool Button Icon Color Changes

I want to have effect like VLC Play Pause Button. Based on other posts, I have
Have created resource file with play pause icons(transparent background).
Have created checkable toolbutton through qt designer.
Have assigned icon for normal off/on through qt designer.
However, when I run the application and click button(IsCkecked is true), the icon turns slightly grey. I do not want background color to change. I am not sure, what is causing this behaviour as well.
Does anyone know reason behind this?
Thanks in advance.
Set stylesheet to the play button.
Like this...
QPushButton
{
background-color:#fffff;
}
QPushButton:pressed
{
background-color:#fffff;
}
Set stylesheet to the play button.
Like this.....
QPushButton
{
background-color:#fffff;(this color can be changed as you want)
}
QPushButton:pressed
{
background-color:#fffff;( same as above )
}

how to make recyclerview slide horizontal

i made a recycleview that works just fine and gets the data and show it but i want that instead of vertical scroll it will be horizontal scroll.
i searched and read that to control the scroll orientation behavior i need to use the LinearLayoutManager and set it like this:
LinearLayoutManager mLayoutManager = new LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL,false);
recyleview.setLayoutManager(mLayoutManager);
but it dosent work and i dont know why all the examples i saw are with this at the core
anyone have any idea why?\
thanks for any help :)
it was about this line:
LinearLayoutManager mLayoutManager = new LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL,false);
but since i tried a couple of tutorials i had this line somewhere else in my code that i forgot to delete it. the problem it was set with .VERTICAL so when it run the code with .HORIZONTAL was running just fine but because later in the adapter initialize i had the same line but with .VERTICAL so it just overwrite the .HORIZONTAL
so in conclusion just make sure you have ONE LinearLayoutManager initialize at a time :D

Receive "Siri remote" event in background on tvOS

I have made a radio player for tvOS and I wan't the audio stream to keep playing while in background. All this works nicely and was pretty easy.
However I would like to stop the stream/audio if "play/pause" button is pressed while in background. But I can't figure out how to do this.
I only want it to stop, not pause. This is how Apple Radio works.
I'm handling all my input with Press events and Actions, setup from the interface builder.
What I've found so far is how it works on iOS, and I've been suggested to use, but remoteControlReceivedWithEvent is never called (not even in foreground).
Any help on this is highly appreciated, especially if you've had the luck with implementing it yourself ;)
UIApplication.sharedApplication().beginReceivingRemoteControlEvents()
override func remoteControlReceivedWithEvent(event: UIEvent?) {}
thisI was able to get working using MediaPlayer's MPRemoteCommandCenter
func setupRemoteCommandCenter() {
let remoteCommandCenter = MPRemoteCommandCenter.sharedCommandCenter()
let pauseCommand = remoteCommandCenter.pauseCommand
pauseCommand.enabled = true
pauseCommand.addTarget(self, action: "pauseEvent")
}
func pauseEvent() {
pause()
}

AppBarButton.Icon doesn't change on runtime

I have a problem updating AppBarButton Icon on runtime depending on some conditions.
<AppBarButton x:Name="WeekButton" Click="OnClick" Label="SomeText"
</AppBarButton>
I'm trying to update Icon property in some code behind with this code
WeekButton.Icon = new FontIcon() { Glyph = Runtime_Value_Here};
But nothing happens. The button doesn't change. But in any random time when the code works, It MAY change the button. I always see, that the Icon is new in code, but not on screen. None of the UpdateLayout helps.
Would appreciate any help.
Thanks
UPDATE:
It seems to not working with FontIcon, as with BitmapIcon changing everything works fine.
Force InvalidateArrange and it works
WeekButton.Icon = new FontIcon() { Glyph = "\uE29B", FontFamily = new FontFamily("Segoe UI Symbol")};
WeekButton.InvalidateArrange();
I believed you already found the solution with bitmap icon.
But some people who reached this page and want to know the solution like me,
Here is using bitmap icon and changing app-bar button icon dynamically.
BitmapIcon _bitmapIcon = new BitmapIcon();
_bitmapIcon.UriSource = new Uri("ms-appx:///Assets/yourBitmapIcon.png");
WeekButton.Icon = _bitmapIcon;
Try using the IconUri in order to give the value.
WeekButton.IconUri = new Uri("/Images/pause.png", UriKind.Relative);
Reference: Disable/Enable applicationbar Button in runtime with event textchanged (Windows Phone)

change the background of the statusbar with rubymotion

I try to change the background of the statusBar like this
but any attempt fails and I do not know if I use well good method.
the constraint is that the navigationBar should be hidden and I can not do otherwise, and I do not know if it's because of ca that I can not change the background of the statusBar.
thank you
I'll take this StackOverflow answer and adapt it for RubyMotion.
if UIDevice.currentDevice.systemVersion.to_f >= 7.0
view = UIView.alloc.initWithFrame([[0, 0], [320, 20]])
view.backgroundColor = UIColor.colorWithRed(0/255.0, green:0/255.0, blue:0/255.0, alpha:1.0)
self.window.rootViewController.view.addSubview(view)
end