Code: Alles auswählen
If OpenWindow(0, 0, 0, 200, 200, "QT-Test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ButtonGadget(0, 25, 10, 150, 25, "Juhu!!!")
ButtonGadget(1, 25, 40, 150, 25, "Juhu!!!")
ButtonGadget(2, 25, 70, 150, 25, "Juhu!!!")
ButtonGadget(3, 25, 100, 150, 25, "Juhu!!!")
ButtonGadget(4, 25, 130, 150, 25, "Juhu!!!")
; Workaround mit dem Border habe ich hier gefunden:
; https://forum.qt.io/topic/23800/solved-change-background-color-of-qtoolbar-doesn-t-work-in-linux
QtScript(~"gadget(0).styleSheet = \"background-color: red; border: none\" ") ; funktioniert bei mir
QtScript(~"gadget(1).styleSheet = \"background: red; border: none\" ") ; funktioniert bei mir
QtScript(~"gadget(2).styleSheet = \"background: red; border: 1px solid black\" ") ; funktioniert bei mir
; QtScript("gadget(3).setAutoFillBackground(true)")
; Waiting for executable to start...
; Executable type: Linux - x64 (64bit, Unicode, Purifier)
; Executable started.
; [ERROR] Line: 13
; [ERROR] JavaScript error: TypeError: Property 'setAutoFillBackground' of object QPushButton(0x55e84768d020) is not a function
; The Program was killed.
QtScript(~"gadget(3).styleSheet = \"background-color: red\" ") ; funktioniert bei mir NICHT
; QtScript("gadget(3).repaint(true)") ; funktioniert bei mir NICHT
; QtScript("gadget(3).repaint(false)") ; funktioniert bei mir NICHT
QtScript(~"gadget(4).styleSheet = \"background: red\" ") ; funktioniert bei mir NICHT
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf