Recent

Author Topic: TSpeedButton qt6 stylesheet  (Read 1100 times)

big_M

  • Full Member
  • ***
  • Posts: 104
TSpeedButton qt6 stylesheet
« on: January 13, 2026, 08:22:29 pm »
Hey. I'm currently creating a stylesheet for my app. So far everything works fine, however I just cannot find how to style TSpeedButtons. It's not with QPushbutton, and not with QToolButton it seems. Anyone has an idea?

I have this as the qt6 reference: https://doc.qt.io/qt-6/stylesheet-reference.html

Soner

  • Sr. Member
  • ****
  • Posts: 328
Re: TSpeedButton qt6 stylesheet
« Reply #1 on: January 13, 2026, 08:37:28 pm »
TSpeedButton isn't QT-Control, LCL draws it itself. You have to use TButton.

big_M

  • Full Member
  • ***
  • Posts: 104
Re: TSpeedButton qt6 stylesheet
« Reply #2 on: January 13, 2026, 09:23:24 pm »
Hm, I feared something like this. Problem is, I need a toggle button with an icon. Can't do that with a TButton. TToggleBox can't do icons, and I think TBitBtn can't do toggling. TSpeedButton can do both, but no styling which I need also...

Soner

  • Sr. Member
  • ****
  • Posts: 328
Re: TSpeedButton qt6 stylesheet
« Reply #3 on: January 14, 2026, 04:30:39 pm »
Then use TToggleBox. It looks as if it is drawn by the underlying widget set.

big_M

  • Full Member
  • ***
  • Posts: 104
Re: TSpeedButton qt6 stylesheet
« Reply #4 on: January 14, 2026, 04:53:29 pm »
TToggleBox can't have an icon though, which I need.

zeljko

  • Hero Member
  • *****
  • Posts: 1906
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: TSpeedButton qt6 stylesheet
« Reply #5 on: March 09, 2026, 09:32:27 pm »
Hm, I feared something like this. Problem is, I need a toggle button with an icon. Can't do that with a TButton. TToggleBox can't do icons, and I think TBitBtn can't do toggling. TSpeedButton can do both, but no styling which I need also...

I've written methods where WE (LCL) draw TBitBtn, so you can get an idea :) You can mimic same drawing , just create your TMySpeedBtn and hook Paint method ?

dsiders

  • Hero Member
  • *****
  • Posts: 1596
Re: TSpeedButton qt6 stylesheet
« Reply #6 on: March 09, 2026, 09:40:21 pm »
Is TToolbar and TToolButton.Style =  tbsDropDown being intentionally avoided?

 

TinyPortal © 2005-2018