PDA

View Full Version : C++/Qt5 Show underscore on button caption - Windows 10



jimbo
10th May 2016, 18:06
Hello,

Windows 10
Qt Creator 3.6.1
Based on Qt 5.6.0


void MainWindow:: on_button_clicked()
{
...
QPushButton *pb = new QPushButton("&Close", choice);
pb->setGeometry(22, g1->x() + g1->height() + 5, 70, 25);
QObject::connect(pb, SIGNAL(clicked()), this, SLOT(pb_clicked()));
...
}
Alt + C works.
The underline doesn't show on the 'C' in the button caption.
Is this a problem with the fonts in Windows 10?
Is there a way round it?

Regards

Edited - Changed Ctrl for Alt.

ChrisW67
10th May 2016, 21:54
Does the ampersand show on the button? If not then Qt is probably doing the right thing with it. The lack of an underscore is probably then a function of the Windows theme.
Does the C gain an underline when hold down the Alt key? When you hover over or focus the button? When you do both?

jimbo
10th May 2016, 22:28
Hello ChrisW67,


Does the ampersand show on the button?No.

Does the C gain an underline when hold down the Alt key?Yes.

When you hover over or focus the button?No.

I 'think' I have read somewhere that Windows 10 is not using True Type anymore???
I guess I'll have to wait for the Qt developers to catch up.

Regards