Infragistics toolbar, how to show PopupMenu checked state? - toolbar

I have a toolbar managed by UltraToolbarsManager with a StateButton and a PopupMenu tool on it.
Both these controls have a Checked setting.
When I set Checked = true on both controls the StateButton changes appearance but the PopupMenu does not. As I am using the PopupMenu as a glorified multistate checkbox I would like them to behave similarly
i.e. if any of the StateButtons under the PopupMenu are checked then the PopupMenu should display checked as if it were a StateButton

You can have the PopupMenu display as a state button by setting the DropDownArrowStyle of the PopupMenuTool to SegmentedStateButton. The following links in the NetAdvantage for Windows Forms help explain this further:
http://help.infragistics.com/NetAdvantage/WinForms/Current/CLR2.0/?page=Infragistics2.Win.UltraWinToolbars.v11.2~Infragistics.Win.UltraWinToolbars.PopupToolBase~DropDownArrowStyle.html
http://help.infragistics.com/NetAdvantage/WinForms/Current/CLR2.0/?page=Infragistics2.Win.UltraWinToolbars.v11.2~Infragistics.Win.UltraWinToolbars.DropDownArrowStyle.html

Related

qml how to keep focus on TextField

I want to keep focus on TextField. For example i am typing something then tap to button. The focus on TextField is moving to button, that's why keyboard is automatically hiding on Android. I am using Qt 5.9.2. Thanks in advance!
In Qt Quick Controls 2, each control has a focusPolicy property which determines how the control gets focus. The default for controls like Button is Qt.StrongFocus, which means that buttons get focus after being clicked or tabbed into. If you're seeing that a control has focus and you don't want it to, just set its focusPolicy to Qt.NoFocus:
focusPolicy: Qt.NoFocus

Is there a way to show tooltip on disabled QWidget

I have a Qt form, where I have a button and menu. For various reasons I can disable certain elements, e.g button or some actions in the menu.
Is there a way I could show a tooltip or when the mouse is hovered over the disabled button or menu item with an explanation as to why it is disabled?
I am using Qt 4.8.
Thanks!
You can set the tooltip dynamically based on the state of the QWidget or by simply toggling both at the same time. Upon disabling/enabling the widget from somewhere just call QWidget::setToolTip(...) with the QString you want the tooltip to display when hovering with the mouse over the given widget. For example if you have a public slot called toggleButton(bool toggleFlag) which toggles the enable-setting of a button you can do:
void MyWidget::toggleButton(bool toggleFlag) {
this->ui->myButton->setEnabled(toggleFlag);
this->ui->myButton->setToolTip(toggleFlag ? QString("Enabled wohoo!") : QString("Disabled because I like it"));
}
You can of course do also change the tooltip by calling QWidget::isEnabled() and act upon its return value. Since you haven't given any code I can only assume how you toggle your button(s) so that's all I can give you for now.
UPDATE: It was pointed in the comments that tooltips don't work with disabled widgets due not receiving mouse events. Both statements are not true (note that I have used the same tooltip message since due to lack of minimal working example I didn't want to write a whole new project from scratch and used an existing one of mine instead):
Hovering a disabled button triggers the tooltip
Hovering an enabled button triggers the tooltip

open new tabs on NavBarItem clicked in Devexpress

I'm developing some Windows forms app with Devexpress, and I have something like below, a set of tabs are open which are related to "System parameters" and I want to a new set of tabs to open in place of older tabs when I click on Error navBarItem and also it should be vise versa, I saw this in demos but I don't know how to do it myself, thanks
I suggest you use a UserControl for each set of options, and when you click on an item of your navigation bar, you do the following :
Set the visible property of the current user control to false
Check if the user control associed to the clicked item exist, if yes, set it's visible property to true (reactivate it), otherwise, create an new instance of it, and dock it.
To manage this, you should have a a list of the user controls already opened, so you can reactivate them when needed.
This link may help you :-)

How to select TextEdit after Enabled in Qt?

I want to design a layout with a PushButton and TextEdit. The TextEdit is disabled at first and only enabled when the PushButton is clicked. When the TextEdit is enabled, it should also be selected.
In other words, what I mean is I can start typing straightway in the TextEdit without click to select it after it is enabled. Like when you open a new tab in your browser, the text cursor will automatically go to the address bar without any clicking.
Thanks.
You can use the QWidget::setFocus() function, docs here.

Are there any keyboard shortcuts for RadioButton and Checkbox?

I have a lot of data-entryists using my ASP.NET application and we have all been wondering if there are any keyboard keys or shortcuts that you can press to trigger:
Check a RadioButton
Uncheck a RadioButton
Check a Checkbox
Uncheck a Checkbox
I know that you can write Javascript and do it yourself, but do any keyboard keys/shortcuts already exist without using the mouse?
Spacebar is the standard button for those, with arrow keys to move between radio buttons.

Resources