LINUX.ORG.RU

Два вопроса по qt добавление виртуальной клавиатуры и как сделать невидимую кнопку

 ,


0

1

Я новичок в qt creator и не знаю как правильно добавить виртуальную клавиатуру. Выбрал вот эту https://store.kde.org/p/1132203/ Можете посоветовать что-то другое.

Версия qt4.7.8.

И как можно сделать невидимую активную кнопку на весь экран ? В этот момент на экране будут присутствовать другие виджиты. Когда на нее нажимаешь переходишь во второе окно.

Ответ на: комментарий от Alex_Golubev

В общем ввел данные в блокнот сохранил открыл снова в блокноте проверил.

Собрал проект запустил не работает зараза.

Alex_Golubev
() автор топика
Ответ на: комментарий от Alex_Golubev

чтобы проверить

Ты же вроде микросхемы прогишь? Не? Я что то перепутал? От чего такая нездоровая тяга к GUI?

anonymous
()
Ответ на: комментарий от anonymous

В softwareinputpanel.ui - это клава

<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
 <class>softwareinputpanel</class>
 <widget class="QWidget" name="softwareinputpanel">
  <property name="geometry">
   <rect>
    <x>0</x>
    <y>0</y>
    <width>640</width>
    <height>240</height>
   </rect>
  </property>
  <property name="windowTitle">
   <string>Form</string>
  </property>
  <widget class="QPushButton" name="panelButton_0">
   <property name="geometry">
    <rect>
     <x>30</x>
     <y>30</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
   <property name="autoDefault">
    <bool>false</bool>
   </property>
   <property name="default">
    <bool>false</bool>
   </property>
   <property name="flat">
    <bool>false</bool>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_1">
   <property name="geometry">
    <rect>
     <x>150</x>
     <y>40</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_4">
   <property name="geometry">
    <rect>
     <x>260</x>
     <y>50</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_5">
   <property name="geometry">
    <rect>
     <x>390</x>
     <y>50</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_6">
   <property name="geometry">
    <rect>
     <x>500</x>
     <y>40</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_7">
   <property name="geometry">
    <rect>
     <x>20</x>
     <y>100</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_8">
   <property name="geometry">
    <rect>
     <x>140</x>
     <y>120</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_9">
   <property name="geometry">
    <rect>
     <x>270</x>
     <y>120</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_star">
   <property name="geometry">
    <rect>
     <x>390</x>
     <y>120</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_hash">
   <property name="geometry">
    <rect>
     <x>500</x>
     <y>130</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="pushButton_9">
   <property name="geometry">
    <rect>
     <x>30</x>
     <y>190</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_2">
   <property name="geometry">
    <rect>
     <x>160</x>
     <y>180</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_3">
   <property name="geometry">
    <rect>
     <x>310</x>
     <y>190</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
 </widget>
 <resources/>
 <connections>
  <connection>
   <sender>btn_close_</sender>
   <signal>clicked()</signal>
   <receiver>SoftKeyBoard</receiver>
   <slot>hide()</slot>
   <hints>
    <hint type="sourcelabel">
     <x>114</x>
     <y>209</y>
    </hint>
    <hint type="destinationlabel">
     <x>83</x>
     <y>116</y>
    </hint>
   </hints>
  </connection>
 </connections>
</ui>

Alex_Golubev
() автор топика
Ответ на: комментарий от Alex_Golubev

В softwareinputpanel.ui

 <class>softwareinputpanel</class>
...
   <receiver>SoftKeyBoard</receiver>

Надо быть внимательней!

anonymous
()
Ответ на: комментарий от Alex_Golubev

Хочу научится.

Учись на здоровье. Ток я не за то. Для тебя должно быть понятнее писать в «блокноте», а не по всяким GUI-шкам лазить. Не?

anonymous
()
Ответ на: комментарий от Alex_Golubev

Поправил не заработала

<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
 <class>softwareinputpanel</class>
 <widget class="QWidget" name="softwareinputpanel">
  <property name="geometry">
   <rect>
    <x>0</x>
    <y>0</y>
    <width>640</width>
    <height>240</height>
   </rect>
  </property>
  <property name="windowTitle">
   <string>Form</string>
  </property>
  <widget class="QPushButton" name="panelButton_0">
   <property name="geometry">
    <rect>
     <x>30</x>
     <y>30</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
   <property name="autoDefault">
    <bool>false</bool>
   </property>
   <property name="default">
    <bool>false</bool>
   </property>
   <property name="flat">
    <bool>false</bool>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_1">
   <property name="geometry">
    <rect>
     <x>150</x>
     <y>40</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_4">
   <property name="geometry">
    <rect>
     <x>260</x>
     <y>50</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_5">
   <property name="geometry">
    <rect>
     <x>390</x>
     <y>50</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_6">
   <property name="geometry">
    <rect>
     <x>500</x>
     <y>40</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_7">
   <property name="geometry">
    <rect>
     <x>20</x>
     <y>100</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_8">
   <property name="geometry">
    <rect>
     <x>140</x>
     <y>120</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_9">
   <property name="geometry">
    <rect>
     <x>270</x>
     <y>120</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_star">
   <property name="geometry">
    <rect>
     <x>390</x>
     <y>120</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_hash">
   <property name="geometry">
    <rect>
     <x>500</x>
     <y>130</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="pushButton_9">
   <property name="geometry">
    <rect>
     <x>30</x>
     <y>190</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_2">
   <property name="geometry">
    <rect>
     <x>160</x>
     <y>180</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_3">
   <property name="geometry">
    <rect>
     <x>310</x>
     <y>190</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
 </widget>
 <resources/>
 <connections>
  <connection>
   <sender>btn_close_</sender>
   <signal>clicked()</signal>
   <receiver>softwareinputpanel</receiver>
   <slot>hide()</slot>
   <hints>
    <hint type="sourcelabel">
     <x>114</x>
     <y>209</y>
    </hint>
    <hint type="destinationlabel">
     <x>83</x>
     <y>116</y>
    </hint>
   </hints>
  </connection>
 </connections>
</ui>

Alex_Golubev
() автор топика
Ответ на: комментарий от Alex_Golubev

Поправил не заработала

Китаец:

$ grep btn_close *
SoftKeyBoard.ui:1784:       <widget class="QPushButton" name="btn_close_">
SoftKeyBoard.ui:1969:   <sender>btn_close_</sender>

Ты:

$ grep btn_close *

Надо быть внимательней.

anonymous
()
Ответ на: комментарий от Alex_Golubev
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
 <class>softwareinputpanel</class>
 <widget class="QWidget" name="softwareinputpanel">
  <property name="geometry">
   <rect>
    <x>0</x>
    <y>0</y>
    <width>640</width>
    <height>240</height>
   </rect>
  </property>
  <property name="windowTitle">
   <string>Form</string>
  </property>
  <widget class="QPushButton" name="panelButton_0">
   <property name="geometry">
    <rect>
     <x>30</x>
     <y>30</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
   <property name="autoDefault">
    <bool>false</bool>
   </property>
   <property name="default">
    <bool>false</bool>
   </property>
   <property name="flat">
    <bool>false</bool>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_1">
   <property name="geometry">
    <rect>
     <x>150</x>
     <y>40</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_4">
   <property name="geometry">
    <rect>
     <x>260</x>
     <y>50</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_5">
   <property name="geometry">
    <rect>
     <x>390</x>
     <y>50</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_6">
   <property name="geometry">
    <rect>
     <x>500</x>
     <y>40</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_7">
   <property name="geometry">
    <rect>
     <x>20</x>
     <y>100</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_8">
   <property name="geometry">
    <rect>
     <x>140</x>
     <y>120</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_9">
   <property name="geometry">
    <rect>
     <x>270</x>
     <y>120</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_star">
   <property name="geometry">
    <rect>
     <x>390</x>
     <y>120</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_hash">
   <property name="geometry">
    <rect>
     <x>500</x>
     <y>130</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="btn_close_">
   <property name="geometry">
    <rect>
     <x>30</x>
     <y>190</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_2">
   <property name="geometry">
    <rect>
     <x>160</x>
     <y>180</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
  <widget class="QPushButton" name="panelButton_3">
   <property name="geometry">
    <rect>
     <x>310</x>
     <y>190</y>
     <width>82</width>
     <height>23</height>
    </rect>
   </property>
   <property name="text">
    <string>PushButton</string>
   </property>
  </widget>
 </widget>
 <resources/>
 <connections>
  <connection>
   <sender>btn_close_</sender>
   <signal>clicked()</signal>
   <receiver>softwareinputpanel</receiver>
   <slot>hide()</slot>
   <hints>
    <hint type="sourcelabel">
     <x>114</x>
     <y>209</y>
    </hint>
    <hint type="destinationlabel">
     <x>83</x>
     <y>116</y>
    </hint>
   </hints>
  </connection>
 </connections>
</ui>

Alex_Golubev
() автор топика
Ответ на: комментарий от anonymous

Добавил кнопку в произвольную область экрана. Кнопка не имеет не каких слотов. Просто кнопка. И как только нажимаю на неё сразу возникает событие CloseSoftwareInputPanel и клавиатура пропадает.

anonymous
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.