Entry Dialog

More
05 Oct 2020 10:54 #184959 by phillc54
Entry Dialog was created by phillc54
Is it possible to change the colors on the popup, I tried with QMenu in the .qss file but no go. In the same vein is it possible to customise the Calculator that pops up from the CALCULATOR dialog_code_string of an Entry Dialog.

I also see in the ScreenOptions widget there is a EntryDialogSoftkey, I took that as meaning a popup soft keyboard but nothing seems to happen.

Please Log in or Create an account to join the conversation.

More
05 Oct 2020 19:35 #184999 by cmorley
Replied by cmorley on topic Entry Dialog
I see an error in sceenoptions that make the dialogs standalone rather then objects of the main window. i will correct that soon.
then you can use
QDialog{ background: qradialgradient(cx: 0.3, cy: -0.4,
fx: 0.3, fy: -0.4,
radius: 1.35, stop: 0 #fff, stop: 1 #888);
}
(for all) or say ToolDialog{} for just the tool dialog.

The softkey option requires you to tap the entry widget (set focus) for the pop up keyboard to show.

Please Log in or Create an account to join the conversation.

More
05 Oct 2020 22:47 #185013 by phillc54
Replied by phillc54 on topic Entry Dialog

I see an error in sceenoptions that make the dialogs standalone rather then objects of the main window. i will correct that soon.
then you can use
QDialog{ background: qradialgradient(cx: 0.3, cy: -0.4,
fx: 0.3, fy: -0.4,
radius: 1.35, stop: 0 #fff, stop: 1 #888);
}
(for all) or say ToolDialog{} for just the tool dialog.

Thanks Chris, that will be great.


The softkey option requires you to tap the entry widget (set focus) for the pop up keyboard to show.

Ahh, now I get it. Is it possible to bring up the soft keys when the entry widget is displayed, is seems a bit unintuitive to me. And of course I am going to ask is the entry widget able to be styled?

Please Log in or Create an account to join the conversation.

More
06 Oct 2020 04:15 #185028 by cmorley
Replied by cmorley on topic Entry Dialog
ok i pushed some work.
in 2.8 + you can style the dialogs such as:
EntryDialog, ToolDialog FileDialog CalculatorDialog etc

in master you can also style the entry widget's keyboard with something like:
SoftInputWidget is a QDialog and MtFlatPushButtons are QPushButtons - so they can be styled similarly.

Something like this is a start:
MyFlatPushButton, SoftInputWidget {
color: red;
font-weight: bold;
border: 2px solid #555;
border-radius: 11px;
padding: px;
background: qradialgradient(cx: 0.3, cy: -0.4,
fx: 0.3, fy: -0.4,
radius: 1.35, stop: 0 #fff, stop: 1 #333);
min-width: 30px;
}

This touched a few widgets and hopefully i haven't broken anything.

I might add that anywhere there is an entry dialog, you can change it to a calculator widget if you prefer.
I requires a small line in the handler file.
for instance a axistoolbutton:
self.w.AXISTOOLBUTTON_NAME.dialog_code = 'CALCULATOR'
it defaults to 'ENTRY'

Please Log in or Create an account to join the conversation.

More
06 Oct 2020 04:20 #185030 by phillc54
Replied by phillc54 on topic Entry Dialog
Great, thanks Chris.

I am trying to do this work on master with a python3 build. I have tested a bit on 2.8 but am not too concerned with that. I am sure I will have many more questions.

Please Log in or Create an account to join the conversation.

More
06 Oct 2020 04:33 #185031 by cmorley
Replied by cmorley on topic Entry Dialog
ah python 3 - I should check that too...

Please Log in or Create an account to join the conversation.

More
06 Oct 2020 04:34 #185032 by phillc54
Replied by phillc54 on topic Entry Dialog
I figured I may as well go that route as that seems to be where we are heading.

Please Log in or Create an account to join the conversation.

More
07 Oct 2020 01:43 - 07 Oct 2020 02:03 #185176 by phillc54
Replied by phillc54 on topic Entry Dialog
Thanks again, that all seems to work great.

The only thing left to change is the little menu popup when you press an AxisToolButton.

Are there no equivalents to the Gladevcp hal_spinbutton and hal_label.

Do you know if it is possible to have the hal pin names use hyphens instead underscores. I see in Designer that it won't allow hyphens in widget names but if I manually change them in the .ui file they appear to work ok.
EDIT: don't worry too much about the hal pin names, it won't be as much of an issue as I thought it would.
Last edit: 07 Oct 2020 02:03 by phillc54.

Please Log in or Create an account to join the conversation.

More
07 Oct 2020 02:23 #185179 by cmorley
Replied by cmorley on topic Entry Dialog
I'll look into the AxisToolButton. Am I understanding right - you want the popup keyboard for the entry widget that pops when you select 'set'?

spinbutton - DoubleScale may be what you are looking for - (no docs added yet)

There is no equivalent to hal_label presently but you can combine some widgets to build it:
Connecting a GeneralHALInput to a standard label using designer's signal/slot selector will give a (boring) label that tracks a HAL pin. using stylesheets can make it look at bit better.
You could of course do a little handler file magic to have more control on a label too.
I will look into this missing widget soon though.

I never noticed the hyphen problem - yes it's a designer restriction on widget names not qtvcp and in fact some widgets have an entry for the HAL name and you can use a hyphen. I'll have to think about whether to change all the widgets to use this (better) way.

Chris

Please Log in or Create an account to join the conversation.

More
07 Oct 2020 02:27 #185182 by cmorley
Replied by cmorley on topic Entry Dialog
loadusr qtvcp test_panel

will show an example of the DoubleScale widgets and show the labels as outputs.
though in this case the labels are showing the output of the DoubleScale rather then a plain HAL pin - but the principle is the same.

Please Log in or Create an account to join the conversation.

Moderators: cmorley
Time to create page: 0.305 seconds
Powered by Kunena Forum