Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to add third party plug in qt ?

How to add third party plug in qt ?

Scheduled Pinned Locked Moved Solved Mobile and Embedded
16 Posts 3 Posters 1.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #2

    Hi,

    What did you write that works on your desktop ?

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    Q 1 Reply Last reply
    0
    • SGaistS SGaist

      Hi,

      What did you write that works on your desktop ?

      Q Offline
      Q Offline
      Qt embedded developer
      wrote on last edited by Qt embedded developer
      #3

      @SGaist i have installed florence keyboard on my target device.

      on pc my on_lineEdit_Title_textChanged slot get called when i click on virtual keyboard key. But on target device it not take input.

      i have written below code :

      #include "main_keyboard.h"
      #include "ui_main_keyboard.h"
      
      
      #define KEYBOARD_CMD        "florence"
      #define SPLITTER_START_Y    310
      
      Main_keyboard::Main_keyboard(QWidget *parent, MainKeyboardType eMainKeyboardType , UINT8 u8StringLimit, QString sDisplayData) :
          QWidget(parent),
          ui(new Ui::Main_keyboard)
      {
          ui->setupUi(this);
          FUNCTION_IN;
          eLangWhileKayboardOpen = (LanguageItem)pMainApp.ObjStationInfo.sCurrentLanguage.toUInt();
      
          
      
          if(eLangWhileKayboardOpen == LAN_ENGLISH)
          {
              /* Design keyboard dynamically */
              AddKeyBoardButton();
          }
          else
          {
              bIsVirtualKeyboardOpen = false;
              //Delete Keyframe and removed two buttons
              delete(ui->frame);
              ui->splitter->setGeometry(QRect(56,SPLITTER_START_Y,368,80));
              ui->lineEdit_Title->setGeometry(QRect(56, SPLITTER_START_Y-45,368,45));
              ui->Label_Main->setGeometry(56, SPLITTER_START_Y-45-70, 365, 70);
              ui->pushButton_Exit->setGeometry(388, SPLITTER_START_Y-45-70-45+11, 70, 70);
      
              delete(ui->pushButton_Backspace);
              delete(ui->pushButton_Caps);
              ui->pushButton_Save->setFixedWidth(368);
      
              OpenVirtualKeyboard();
              if(bIsVirtualKeyboardOpen)
              {
                  ChangeKeyboardLanguage(eLangWhileKayboardOpen);
              }
          }
      
          QFont font;
          font.setFamily(FONT_FAMILY_AWESOME);
          font.setPixelSize(BACK_BUTTON_FONTSIZE);
      
          //ui->pushButton_Exit->setFont(font);
          //ui->pushButton_Exit->setText(CLEAR_BUTTON_FONT);
      
          ui->pushButton_Save->setEnabled(false);
      
          sTypedData = sDisplayData;
          ui->lineEdit_Title->setFocus();
          ui->lineEdit_Title->setText (sTypedData);
          ui->lineEdit_Title->setCursorPosition(sTypedData.length());
      
          eReceivedMainKeyboardType = eMainKeyboardType;
          bCapsOn = false;
      
          switch(eMainKeyboardType)
          {
          case KEYBOARD_USER_NAME:
          {
              ui->pushButton_Save->setStyleSheet(SAVEBUTTONSytesheetEnable);
              ui->Label_Main->setText((sEnterName()));                      // "ENTER NAME");
      
              if(eLangWhileKayboardOpen == LAN_ENGLISH)
              {
                  SetLowercaseButton();
                  keyButton[ZERO_KEY_INDEX]->hide();
              }
          }
              break;
      
          case KEYBOARD_WIFI_PASSWORD:
          {
              ui->pushButton_Save->setStyleSheet(ENTERBUTTONStylesheet);
              ui->Label_Main->setText((sEnterPassword()));                  // "ENTER PASSWORD");
      
              if(eLangWhileKayboardOpen == LAN_ENGLISH)
                  SetLowercaseButton();
          }
              break;
      
          case KEYBOARD_LOT_NUMBER:
          {
              ui->pushButton_Save->setStyleSheet(ENTERBUTTONStylesheet);
              ui->Label_Main->setText(sEnterLotNumber());            //"ENTER LOT NUMBER");
      
              if(eLangWhileKayboardOpen == LAN_ENGLISH)
                  SetLowercaseButton();
          }
              break;
      
          case KEYBOARD_PART_NUMBER:
          {
              ui->pushButton_Save->setStyleSheet(ENTERBUTTONStylesheet);
              ui->Label_Main->setText(sEnterPartNumber());          //"ENTER PART NUMBER");
      
              if(eLangWhileKayboardOpen == LAN_ENGLISH)
                  SetLowercaseButton();
          }
      
              break;
      
          case MAX_MAIN_KEYBOARD:
          default:
              break;
      
          }
          u8WordLimit = u8StringLimit;
          FUNCTION_OUT;
      }
      
      Main_keyboard::~Main_keyboard()
      {
          if(eLangWhileKayboardOpen != LAN_ENGLISH)
              CloseVirtualKeyboard();
          delete ui;
      }
      
      void Main_keyboard::AddKeyBoardButton()
      {
          FUNCTION_IN;
          UINT8 u8MenuItemIndex, u8RowIndex, u8ColumnIndex;
          QGridLayout *controlsLayout = new QGridLayout;
      
          for(u8MenuItemIndex = 0; u8MenuItemIndex < MAX_KEY; u8MenuItemIndex++)
          {
              u8RowIndex = u8MenuItemIndex / KEYS_PER_ROW;
              u8ColumnIndex = u8MenuItemIndex % KEYS_PER_ROW;
      
              //Add PushButton
              keyButton[u8MenuItemIndex] = new QPushButton();
              keyButton[u8MenuItemIndex]->setObjectName(QString::number(u8MenuItemIndex));
              keyButton[u8MenuItemIndex]->setMinimumHeight(KEYBOARD_BUTTON_HEIGHT);
              keyButton[u8MenuItemIndex]->setMinimumWidth(KEYBOARD_BUTTON_WIDTH);
              keyButton[u8MenuItemIndex]->setFlat(true);
              keyButton[u8MenuItemIndex]->setStyleSheet ("border: 0px solid black;font-family:'Open Sans';font-weight:600;font-size:12pt;");
              QObject::connect(keyButton[u8MenuItemIndex], &QPushButton::released, this, &Main_keyboard::onKeyRelease);
      
              //Add Pushbutton in GridLayout
              controlsLayout-> addWidget(keyButton[u8MenuItemIndex], u8RowIndex, u8ColumnIndex, 1, 1, Qt::AlignCenter);
          }
          controlsLayout->setMargin(0);
          controlsLayout->setHorizontalSpacing(0);
          controlsLayout->setVerticalSpacing(0);
      
          ui->verticalLayout->addLayout(controlsLayout);
          FUNCTION_OUT;
      }
      
      void Main_keyboard::SetUppercaseButton()
      {    
          ui->pushButton_Caps->setStyleSheet(CAPS_LOCK_ON_COLOR);
          bCapsOn = true;
          if(eLangWhileKayboardOpen == LAN_ENGLISH)
          {
              for(UINT8 u8ButtonIndex = 0; u8ButtonIndex < MAX_KEY; u8ButtonIndex++)
              {
                  keyButton[u8ButtonIndex]->setText(sUpperKey[u8ButtonIndex]);
              }
          }
      }
      
      void Main_keyboard::SetLowercaseButton()
      {
          ui->pushButton_Caps->setStyleSheet(CAPS_LOCK_OFF_COLOR);
          bCapsOn = false;
          if(eLangWhileKayboardOpen == LAN_ENGLISH)
          {
              for(UINT8 u8ButtonIndex = 0; u8ButtonIndex < MAX_KEY; u8ButtonIndex++)
              {
                  keyButton[u8ButtonIndex]->setText(sLowerKey[u8ButtonIndex]);
              }
          }
      }
      
      void Main_keyboard::onKeyRelease()
      {
          QObject *senderObj = sender();
          QString senderObjName = senderObj->objectName();
          u_int8_t u8MenuItemIndex = senderObjName.toInt();
      
          if(u8MenuItemIndex == SPACE_KEY_INDEX)
          {
              GetEntry(" ");
          }
          else
          {
              GetEntry(keyButton[u8MenuItemIndex]->text());
          }
      }
      
      void Main_keyboard::GetEntry(QString get_char)
      {
          if(sTypedData.length() < u8WordLimit)
          {
              u8CursorPosition = ui->lineEdit_Title->cursorPosition();
              sTypedData.insert(u8CursorPosition , get_char.at(0));
              ui->lineEdit_Title->setText (sTypedData);
              ui->lineEdit_Title->setCursorPosition(++u8CursorPosition);
          }
      }
      
      void Main_keyboard::on_lineEdit_Title_textChanged(const QString &arg1)
      {
      #ifdef QDEBUG_ENABLE
          pMainApp.ObjStationInfo.DebugStation("Text Changed: "   + arg1 + "length" + sTypedData.length());
      #endif
          sTypedData= arg1;
      
          if(sTypedData.isEmpty())
              ui->pushButton_Save->setEnabled(false);
          else
              ui->pushButton_Save->setEnabled(true);
      
          if(sTypedData.length() > u8WordLimit)
          {
              u8CursorPosition = ui->lineEdit_Title->cursorPosition();
              sTypedData.remove(u8CursorPosition ,1);
              ui->lineEdit_Title->setText (sTypedData);
              ui->lineEdit_Title->setCursorPosition(--u8CursorPosition);
          }
          ui->lineEdit_Title->repaint();
      }
      
      
      void Main_keyboard::on_pushButton_Caps_released()
      {
          //border: 3px solid black;background:rgb(0, 85, 127);color: rgb(255, 255, 255);  //white
          //border: 3px solid black;background:rgb(0, 85, 127);color: rgb(0, 0, 0); //black
          if(eLangWhileKayboardOpen == LAN_ENGLISH)
          {
              if(bCapsOn ==false)
              {
                  SetUppercaseButton();
              }
              else
              {
                  SetLowercaseButton();
              }
          }
      }
      
      void Main_keyboard::on_pushButton_Backspace_released()
      {
          if(eLangWhileKayboardOpen == LAN_ENGLISH)
          {
              if(sTypedData.length()>0)
              {
                  u8CursorPosition = ui->lineEdit_Title->cursorPosition();
                  sTypedData.remove(--u8CursorPosition , 1);
                  ui->lineEdit_Title->setText (sTypedData);
                  ui->lineEdit_Title->setCursorPosition(u8CursorPosition);
              }
          }
      }
      
      void Main_keyboard::on_pushButton_Exit_released()
      {
          CloseVirtualKeyboard();
          this->close();
          delete this;
      }
      
      void Main_keyboard::on_pushButton_Save_released()
      {
          qApp->setOverrideCursor(QCursor( Qt::WaitCursor));
      
          switch(eReceivedMainKeyboardType)
          {
          case KEYBOARD_USER_NAME:
              break;
      
          case KEYBOARD_WIFI_PASSWORD:
          {
              Network_Setting* parent = qobject_cast<Network_Setting*>(this->parent());
              parent->SaveConnectNetWork(parent->sSelectedSsid ,sTypedData, "1", true);
          }
              break;
      
      
          case KEYBOARD_LOT_NUMBER:
          {
              Cal_Gas_Information* parent = qobject_cast<Cal_Gas_Information*>(this->parent());
              parent->DisplayLotNumber(sTypedData);
          }
              break;
      
          case KEYBOARD_PART_NUMBER:
          {
              Cal_Gas_Information* parent = qobject_cast<Cal_Gas_Information*>(this->parent());
              parent->DisplayPartNumber(sTypedData);
          }
              break;
      
          case MAX_MAIN_KEYBOARD:
          default:
              break;
          }
      #ifdef BOARD_APP
          qApp->setOverrideCursor(QCursor( Qt::BlankCursor));
      #else
          qApp->setOverrideCursor(QCursor(Qt::ArrowCursor));
      #endif
      
          if(eLangWhileKayboardOpen != LAN_ENGLISH)
              CloseVirtualKeyboard();
      
          this->close();
          delete this;
      }
      
      //void Main_keyboard::on_pushButton_Clear_released()
      //{
      //    sTypedData.clear();
      //    ui->lineEdit_Title->clear();
      //}
      
      void Main_keyboard::on_lineEdit_Title_cursorPositionChanged(int , int )
      {
          if(eLangWhileKayboardOpen != LAN_ENGLISH)
          {
              if(bIsVirtualKeyboardOpen == false)
              {
                  OpenVirtualKeyboard();
                  ChangeKeyboardLanguage((LanguageItem)pMainApp.ObjStationInfo.sCurrentLanguage.toUInt());
              }
          }
      }
      
      
      void Main_keyboard::ChangeKeyboardLanguage(LanguageItem eLanguageItem)
      {
          QString sResponse, sError;
          bool bIsCmdFailed = false;
          QString sLocale;
      
          switch(eLanguageItem)
          {
          case LAN_ENGLISH:
          case MAX_LANGUAGE:
          default:
              sLocale = "us";
              break;
      
          case LAN_TURKISH:
              sLocale = "tr";
              break;
          }
      
          QString sKeyLanChangeCmd = QString("%1 %2").arg("setxkbmap", sLocale);
          do
          {
              bIsCmdFailed = pMainApp.ObjSysOperation.SendSystemCommand(sKeyLanChangeCmd, sResponse, sError);
              if(bIsCmdFailed)
              {
                  AppLog::AddLog(LOG_ERROR, __FUNCTION__, __LINE__, "Failed to set Language");
      #ifdef QDEBUG_ENABLE
                  pMainApp.ObjStationInfo.DebugStation("Failed to set Language");
      #endif
                  break;
              }
              else
              {
      
              }
          }while(false);
      }
      
      void Main_keyboard::OpenVirtualKeyboard()
      {
          QString sResponse, sError;
          bool bIsCmdFailed = false;
      
          do
          {
              if(!bIsVirtualKeyboardOpen)
              {
                  //bIsCmdFailed = SendSystemCommand(KEYBOARD_CMD" &", sResponse, sError);
                  bIsCmdFailed = pMainApp.ObjSysOperation.SendSystemCommand("florence -u /usr/share/florence/florence.conf &", sResponse, sError);
                  if(bIsCmdFailed)
                  {
                      AppLog::AddLog(LOG_ERROR, __FUNCTION__, __LINE__, "Failed to open florence keyboard");
      #ifdef QDEBUG_ENABLE
                      pMainApp.ObjStationInfo.DebugStation("Failed to open florence keyboard");
      #endif
                      break;
                  }
                  else
                  {
                      bIsVirtualKeyboardOpen = true;
                  }
              }
          }while(false);
      }
      
      void Main_keyboard::CloseVirtualKeyboard()
      {
          ChangeKeyboardLanguage(LAN_ENGLISH);
      
          QString sResponse, sError;
          pMainApp.ObjSysOperation.SendSystemCommand("pkill "KEYBOARD_CMD, sResponse, sError);
          bIsVirtualKeyboardOpen = false;
      }
      
      
      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #4

        Are you sure that that keyboard is working properly on your target ?
        By the way, did you consider Qt's own Virtual Keyboard module ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        Q 1 Reply Last reply
        1
        • SGaistS SGaist

          Are you sure that that keyboard is working properly on your target ?
          By the way, did you consider Qt's own Virtual Keyboard module ?

          Q Offline
          Q Offline
          Qt embedded developer
          wrote on last edited by Qt embedded developer
          #5

          @SGaist it get open but not take i/p.

          Why it just get open but not take i/p?

          Yes I started to use qt keyboard. But i am not much more about it.

          What library I need to install on linux? How to use it?

          How I can add it on my existing program with minimum steps?

          Note that i want virtual keyboard to use on qt c++ based. Not on qt qml based.

          Thanks for reply

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #6

            Can you give more information about that Florence keyboard ?
            Some documentation link, sources, etc ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #7

              As for C++, did you try to simply use it with a minimal widget application ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              Q 2 Replies Last reply
              0
              • SGaistS SGaist

                As for C++, did you try to simply use it with a minimal widget application ?

                Q Offline
                Q Offline
                Qt embedded developer
                wrote on last edited by
                #8

                @SGaist to use qt virtual keyboard

                What library I need to install on linux? How to use it?

                How I can add it on my existing program with minimum steps?

                Note that i want virtual keyboard to use on qt c++ based. Not on qt qml based.

                SGaistS 1 Reply Last reply
                0
                • SGaistS SGaist

                  As for C++, did you try to simply use it with a minimal widget application ?

                  Q Offline
                  Q Offline
                  Qt embedded developer
                  wrote on last edited by Qt embedded developer
                  #9

                  @SGaist link for Florence keyboard

                  http://florence.sourceforge.net/english.html

                  I have installed it on pc. On pc my code is working fine but on target device it is not working

                  1 Reply Last reply
                  0
                  • Q Qt embedded developer

                    @SGaist to use qt virtual keyboard

                    What library I need to install on linux? How to use it?

                    How I can add it on my existing program with minimum steps?

                    Note that i want virtual keyboard to use on qt c++ based. Not on qt qml based.

                    SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #10

                    @Qt-embedded-developer said in How to add third party plug in qt ?:

                    @SGaist to use qt virtual keyboard

                    What library I need to install on linux? How to use it?

                    How I can add it on my existing program with minimum steps?

                    Note that i want virtual keyboard to use on qt c++ based. Not on qt qml based.

                    Did you read the documentation page I linked ? The one that explains the module, provides a link to installation / build instructions, etc ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    Q 1 Reply Last reply
                    1
                    • SGaistS SGaist

                      @Qt-embedded-developer said in How to add third party plug in qt ?:

                      @SGaist to use qt virtual keyboard

                      What library I need to install on linux? How to use it?

                      How I can add it on my existing program with minimum steps?

                      Note that i want virtual keyboard to use on qt c++ based. Not on qt qml based.

                      Did you read the documentation page I linked ? The one that explains the module, provides a link to installation / build instructions, etc ?

                      Q Offline
                      Q Offline
                      Qt embedded developer
                      wrote on last edited by
                      #11

                      @SGaist Can i use it on Qt version 5.5.1 as open source code?

                      I have already installed qt on my linux pc. How to install packages related to virtual keyboard on my pc? From where i can find qt maintenance tool on linux ?

                      jsulmJ 1 Reply Last reply
                      0
                      • Q Qt embedded developer

                        @SGaist Can i use it on Qt version 5.5.1 as open source code?

                        I have already installed qt on my linux pc. How to install packages related to virtual keyboard on my pc? From where i can find qt maintenance tool on linux ?

                        jsulmJ Offline
                        jsulmJ Offline
                        jsulm
                        Lifetime Qt Champion
                        wrote on last edited by
                        #12

                        @Qt-embedded-developer said in How to add third party plug in qt ?:

                        From where i can find qt maintenance tool on linux ?

                        Install Qt using Qt Online Installer, then you will also get maintenance tool.

                        https://forum.qt.io/topic/113070/qt-code-of-conduct

                        Q 1 Reply Last reply
                        1
                        • jsulmJ jsulm

                          @Qt-embedded-developer said in How to add third party plug in qt ?:

                          From where i can find qt maintenance tool on linux ?

                          Install Qt using Qt Online Installer, then you will also get maintenance tool.

                          Q Offline
                          Q Offline
                          Qt embedded developer
                          wrote on last edited by
                          #13

                          @jsulm if I want to install on existing version of qt then how to install it on linux with out qt online installer

                          1 Reply Last reply
                          0
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on last edited by
                            #14

                            Then use something more recent to run in your board. Qt 5.5 is more than 10 minor releases behind. Yocto comes to mind for example.

                            Interested in AI ? www.idiap.ch
                            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                            Q 1 Reply Last reply
                            1
                            • SGaistS SGaist

                              Then use something more recent to run in your board. Qt 5.5 is more than 10 minor releases behind. Yocto comes to mind for example.

                              Q Offline
                              Q Offline
                              Qt embedded developer
                              wrote on last edited by
                              #15

                              @SGaist sorry but can you elaborate more your reply. Because I am novice to understand your reply.

                              1 Reply Last reply
                              0
                              • SGaistS Offline
                                SGaistS Offline
                                SGaist
                                Lifetime Qt Champion
                                wrote on last edited by
                                #16

                                Current Qt versions is Qt 5.15.2 for OpenSource for the Qt 5 series and 6.2 is around the corner for the Qt 6 series.

                                Qt 5.5.1 was released in September 2015 so that 6 years ago. Therefore it's not a good idea to start a new project with it.

                                As for Yocto, you should read the project description.

                                Interested in AI ? www.idiap.ch
                                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                1 Reply Last reply
                                0

                                • Login

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • Users
                                • Groups
                                • Search
                                • Get Qt Extensions
                                • Unsolved