This is the class I'm invoking wherever I need the keyboard, I hope it gives you a little idea where I'm going wrong.
#include "keyboard.h"
#include <QProcess>
#ifdef WIN32
#include <windows.h>
#include <QString>
#include <QStringList>
#include <QDebug>
#endif
#include "entrysettings.h"
{
#ifdef WIN32
QString folder
= "C:\\Windows\\System32\\osk.exe";
QString tt
= "C:\\Progra~1\\Common~1\\micros~1\\ink\\TabTip.exe";
if( EntrySettings::windowsMajorVersion() >= 10 ) {
qDebug() << "Setting Win 10 OSK";
if( process ) {
delete process;
}
else {
}
}
else {
qDebug() << "Windows pre-10 identified";
if( process ) delete process;
}
#endif
}
Keyboard::~Keyboard()
{
#ifdef WIN32
if( process ) delete process;
#endif
}
#include "keyboard.h"
#include <QProcess>
#ifdef WIN32
#include <windows.h>
#include <QString>
#include <QStringList>
#include <QDebug>
#endif
#include "entrysettings.h"
Keyboard::Keyboard(QObject *parent) : QObject(parent), process(0)
{
#ifdef WIN32
QString program = "explorer.exe";
QString folder = "C:\\Windows\\System32\\osk.exe";
QString tt = "C:\\Progra~1\\Common~1\\micros~1\\ink\\TabTip.exe";
if( EntrySettings::windowsMajorVersion() >= 10 ) {
qDebug() << "Setting Win 10 OSK";
if( process ) {
delete process;
process = new QProcess(this);
process->start(program, QStringList() << folder);
}
else {
process = new QProcess(this);
process->start(program, QStringList() << folder);
}
}
else {
qDebug() << "Windows pre-10 identified";
if( process ) delete process;
process = new QProcess(this);
process->start(program, QStringList() << tt);
}
#endif
}
Keyboard::~Keyboard()
{
#ifdef WIN32
if( process ) delete process;
#endif
}
To copy to clipboard, switch view to plain text mode
Bookmarks