Changeset 81405 in vbox
- Timestamp:
- Oct 21, 2019 12:29:48 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 134119
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.cpp
r81399 r81405 144 144 }; 145 145 146 struct UsageCode147 {148 LONG usageId;149 LONG usagePage;150 bool fRelease;151 };152 153 146 154 147 /********************************************************************************************************************************* … … 196 189 197 190 void setLockKey(int iKeyPosition, UISoftKeyboardKey *pKey); 198 UISoftKeyboardKey *lockKey(int iKeyPosition) const;199 191 void updateLockKeyStates(bool fCapsLockState, bool fNumLockState, bool fScrollLockState); 200 192 void reset(); … … 402 394 403 395 void addScanCodePrefix(LONG scanCode); 404 const QVector<LONG> &scanCodePrefix() const;405 396 406 397 void setUsageId(LONG usageId); … … 512 503 bool isFromResources() const; 513 504 514 void updateUIKeyCaptions(int iKeyPosition, UIKeyCaptions &newCaptions);515 516 505 void setEditable(bool fEditable); 517 506 bool editable() const; … … 520 509 const QUuid &physicalLayoutUuid() const; 521 510 522 void setKeyCapMap(const QMap<int, UIKeyCaptions> &keyCaptionsMap);523 511 void addOrUpdateUIKeyCaptions(int iKeyPosition, const UIKeyCaptions &keyCaptions); 524 UIKeyCaptions keyCaptions(int iKeyPosition) ;512 UIKeyCaptions keyCaptions(int iKeyPosition) const; 525 513 526 514 bool operator==(const UISoftKeyboardLayout &otherLayout); … … 670 658 virtual void mouseMoveEvent(QMouseEvent *pEvent) /* override */; 671 659 virtual void retranslateUi() /* override */; 672 673 private slots:674 675 void sltPhysicalLayoutForLayoutChanged(int iIndex);676 660 677 661 private: … … 923 907 { 924 908 m_lockKeys[iKeyPosition] = pKey; 925 }926 927 UISoftKeyboardKey *UISoftKeyboardPhysicalLayout::lockKey(int iKeyPosition) const928 {929 return m_lockKeys.value(iKeyPosition, 0);930 909 } 931 910 … … 1180 1159 connect(m_pLayoutNativeNameEdit, &QLineEdit::textChanged, this, &UIKeyboardLayoutEditor::sltLayoutNativeNameChanged); 1181 1160 1182 1183 1161 m_pLayoutNameLabel = new QLabel; 1184 1162 m_pLayoutNameEdit = new QLineEdit; … … 1593 1571 { 1594 1572 m_scanCodePrefix << scanCodePrefix; 1595 }1596 1597 const QVector<LONG> &UISoftKeyboardKey::scanCodePrefix() const1598 {1599 return m_scanCodePrefix;1600 1573 } 1601 1574 … … 1796 1769 } 1797 1770 1798 void UISoftKeyboardLayout::updateUIKeyCaptions(int iKeyPosition, UIKeyCaptions &newCaptions)1799 {1800 if (!m_keyCaptionsMap.contains(iKeyPosition))1801 return;1802 m_keyCaptionsMap[iKeyPosition] = newCaptions;1803 }1804 1805 1771 QString UISoftKeyboardLayout::nameString() const 1806 1772 { … … 1875 1841 } 1876 1842 1877 void UISoftKeyboardLayout::setKeyCapMap(const QMap<int, UIKeyCaptions> &keyCaptionsMap)1878 {1879 m_keyCaptionsMap = keyCaptionsMap;1880 }1881 1882 1843 void UISoftKeyboardLayout::addOrUpdateUIKeyCaptions(int iKeyPosition, const UIKeyCaptions &keyCaptions) 1883 1844 { … … 1889 1850 } 1890 1851 1891 UIKeyCaptions UISoftKeyboardLayout::keyCaptions(int iKeyPosition) 1852 UIKeyCaptions UISoftKeyboardLayout::keyCaptions(int iKeyPosition) const 1892 1853 { 1893 1854 return m_keyCaptionsMap[iKeyPosition]; … … 2644 2605 } 2645 2606 2646 void UISoftKeyboardWidget::sltPhysicalLayoutForLayoutChanged(int iIndex)2647 {2648 if (!m_pCurrentKeyboardLayout)2649 return;2650 if (iIndex < 0 || iIndex >= m_physicalLayouts.size())2651 return;2652 2653 if (m_pCurrentKeyboardLayout->physicalLayoutUuid() == m_physicalLayouts[iIndex].uid())2654 return;2655 m_pCurrentKeyboardLayout->setPhysicalLayoutUuid(m_physicalLayouts[iIndex].uid());2656 update();2657 }2658 2659 2607 void UISoftKeyboardWidget::setNewMinimumSize(const QSize &size) 2660 2608 { … … 3215 3163 int iDefaultHeight = attributes.value("defaultHeight").toInt(); 3216 3164 QVector<UISoftKeyboardRow> &rows = physicalLayout.rows(); 3217 int iRowCount = 0; 3165 3218 3166 while (m_xmlReader.readNextStartElement()) 3219 3167 { 3220 3168 if (m_xmlReader.name() == "row") 3221 {3222 3169 parseRow(iDefaultWidth, iDefaultHeight, rows); 3223 ++iRowCount;3224 }3225 3170 else if (m_xmlReader.name() == "name") 3226 3171 physicalLayout.setName(m_xmlReader.readElementText()); … … 3821 3766 m_pKeyboardWidget->parentDialogDeactivated(); 3822 3767 } 3823 else if (pEvent->type() == QEvent::WindowDeactivate)3824 {3825 if (m_pKeyboardWidget)3826 m_pKeyboardWidget->parentDialogDeactivated();3827 }3828 3829 3768 return QMainWindowWithRestorableGeometryAndRetranslateUi::event(pEvent); 3830 3769 }
Note:
See TracChangeset
for help on using the changeset viewer.