Unsolved QSplitter::handle:pressed not working on external stylesheet
-
@mrjj RHEL version is 7.7 and Qt version is 5.14.1
-
@Robert-Sanson
Ok so not due being old version :)
I tried and older ubuntu and a mint and both worked.
But its using XFCE4REL 7 is using gnome or ?
sorry for my blondness but mostly used debian based linuxes. :)Would you say CentOS 7.7 would be the same ? ( to test on )
-
@mrjj Yea, I'm not sure. From searching it looks like CentOS would be similar.
-
@Robert-Sanson
yeah i also read it as very close to RHEL, at least from a system perspective.Btw could you try to tell me what
qDebug() << QApplication::style()->metaObject()->className();
(in main.cpp after QApplication is created)
says ? -
@mrjj said in QSplitter::handle:pressed not working on external stylesheet:
qDebug() << QApplication::style()->metaObject()->className();
Looks like it says QFusionStyle (without the previous code for setting it to that).
-
@Robert-Sanson
Ok that very odd then
as same style on the Mint Linux where it does color it.So can we talk about
"external stylesheet"in what way extern ?
im just setting it on the splitter with right click.Did you try in clean project ?
Just new default GUI project and place 2 buttons on MainWindow, then select both and right click and layout menu and apply splitter
then right click splitter (in widget tree to teh right) and Change stylesheet. -
Hi
Installed a CentOs and Qt but seems the gcc i get is 4.8.5
and i cant run anything. ( no c++ 11 it seems)
So didnt really found out more.Update.
I compiled a new GCC (7.3) and made it run.Oddly enough your stylesheet does work. !
-
I'm guessing it has something to do with my code instead of the style sheet (even though I find it weird that the hover works). Maybe its because I have overridden the mouse events.
What I mean about the external stylesheet is that the style sheet is in a file called MyStyleSheet.qss and gets read in by the program.
Thanks for the help.
-
@Robert-Sanson
Hi
loading it from file should really not matter.So yes, i think it mus tbe somthing in the code. But that easy to test with clean default GUI project :)
-
I've decided to sub class the QSplitterHandle and have overridden the mousePressEvent, mouseMoveEvent and mouseReleaseEvent. I did have the ::handle:pressed stylesheet pseudo-state working but now it has stopped working since I have overridden these functions. My assumption is that I need to set this pseudo-state of pressed to true, but I'm not sure how to get this working again. How would I go about doing this?
-
@Robert-Sanson
Hi
You must call base class version of mousePressEvent etc so
it can do its normal handling too.