Teacher not available times - Button for swap X with empty

Started by infoo_, February 21, 2025, 06:05:55 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gradgrind

I know you have done this now, but QTableView does have a way of getting a click on the corner button. It may not be ideal, but clicking on the corner button calls the slot "selectAll", which you can override in a subclass.

Liviu Lalescu

Thank you! I am not sure, but I think I tried this approach some time ago and I could not. Maybe I tried this same approach, but the table selection is set to none.

I might try this approach, soon, but not now, because I just released the new version. I will let you know.

Liviu Lalescu

@gradgrind ,

I tried, and on a small example it works, but in FET it doesn't work. Maybe you would like to try it - I attach the code (k.cpp and t-try.pro are a small test, and work, but the two add... .h & .cpp do not work - they should be placed in fet-7.0.4/interface - you can diff them with the official files).

@Volker Dirr , maybe you would like also to have a look.

PS: Only works in unix (on Windows, you don't have a command-line interface).

infoo_

Thank you for the implementation, Liviu and team! It works smoothly :)

gradgrind

I had a look at the code. If you delete the call "setStretchAvailabilityTableNicely(timesTable)" in addormodifytimeconstraint.cpp, the corner click works. Is there a reason why this call was there?

Also, "timesTable->setCornerButtonEnabled(true)" is not necessary as this is the default (of course, putting it in makes it explicit, which might be a good thing).

But maybe the version with the swap button is better (clearer) anyway?

Liviu Lalescu

#20
Hmm... thank you for your observation! Indeed, in "setStretchAvailabilityTableNicely(timesTable)" I do a setCornerButtonEnabled(false), I don't know why. So, I assume if I set this to true, it will work.

@gradgrind , @infoo_ , @Volker Dirr , please tell me, how is it better, in your opinion? To remove the button "Toggle all" and the user needs to click on the corner, or leave as it is now? I am afraid users won't know to press on the corner.

Also, if we implement the corner and remove a button, I think best would be to remove "Swap" and leave "Toggle all", and Toggle all will invert all the cells (as does Swap now).

Liviu Lalescu

I think it is best to add the corner behavior, remove "Swap" and make "Toggle all" to invert all cells. I will do this now. But if you object, I will revert.

Volker Dirr

Less then 2 hours time to answer? Liviu, you are too fast.
But I think both variants are ok. You can choose. If you are not sure, you might even do both: Support the button and the corner.

infoo_

Quote from: Liviu Lalescu on February 23, 2025, 09:55:58 AMI think it is best to add the corner behavior, remove "Swap" and make "Toggle all" to invert all cells. I will do this now. But if you object, I will revert.


I agree with you

infoo_

Corner behaviour is present in, for example, Excel with a small icon:

You cannot view this attachment.

Maybe it can be implemented in FET for warning users there is a functionality there

Liviu Lalescu

I searched the internet and it seems it is possible to style/put an icon on the top-left corner, but I am not sure which icon would be best. I prefer to keep the default (none), hoping users will know.

Also, the corner may be smaller or larger, depending on the hours' names.

I did this, it is working. I will put a snapshot soon (I am waiting for feed-back on another suggestion).

infoo_

Quote from: Liviu Lalescu on February 23, 2025, 04:28:15 PMAlso, the corner may be smaller or larger, depending on the hours' names.

Agree

Maybe not an icon but this concepts seem to fit nicely:

You cannot view this attachment.

You cannot view this attachment.

Liviu Lalescu

I will think about it, thank you! But colors might be different. For instance I use GNU/Linux and dark mode.

Volker Dirr

#28
Can you also just write text? As a mathematician i suggest the symbol "for all": ∀

Liviu Lalescu