- Timestamp:
- Sep 2, 2008 11:11:58 AM (16 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxSettingsUtils.h
r10468 r11968 219 219 emit currentChanged (aCurrent); 220 220 } 221 222 void focusInEvent (QFocusEvent *aEvent) 223 { 224 /* Restore edit-mode on focus in. */ 225 QTableView::focusInEvent (aEvent); 226 if (model()->flags (currentIndex()) & Qt::ItemIsEditable) 227 edit (currentIndex()); 228 } 221 229 }; 222 230 -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsHD.h
r11186 r11968 196 196 private: 197 197 198 void keyPressEvent (QKeyEvent *aEvent); 198 199 void populate (const HDSltValue &aIncluding); 199 200 … … 228 229 229 230 private: 231 232 void keyPressEvent (QKeyEvent *aEvent); 230 233 231 234 static HDVdiEditor *mInstance; … … 326 329 QAction *mDelAction; 327 330 QAction *mVdmAction; 331 bool mWasTableSelected; 328 332 }; 329 333 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsHD.cpp
r11530 r11968 243 243 } 244 244 245 void HDSltEditor::keyPressEvent (QKeyEvent *aEvent) 246 { 247 /* Make F2 key to show the popup. */ 248 if (aEvent->key() == Qt::Key_F2) 249 { 250 aEvent->accept(); 251 showPopup(); 252 } 253 else 254 aEvent->ignore(); 255 QComboBox::keyPressEvent (aEvent); 256 } 257 245 258 void HDSltEditor::populate (const HDSltValue &aIncluding) 246 259 { … … 313 326 { 314 327 emit readyToCommit (this); 328 } 329 330 void HDVdiEditor::keyPressEvent (QKeyEvent *aEvent) 331 { 332 /* Make F2 key to show the popup. */ 333 if (aEvent->key() == Qt::Key_F2) 334 { 335 aEvent->accept(); 336 showPopup(); 337 } 338 else 339 aEvent->ignore(); 340 VBoxMediaComboBox::keyPressEvent (aEvent); 315 341 } 316 342 … … 395 421 VBoxVMSettingsHD::VBoxVMSettingsHD() 396 422 : mValidator (0) 423 , mWasTableSelected (false) 397 424 { 398 425 /* Apply UI decorations */ … … 859 886 break; 860 887 } 888 } else 889 if (aEvent->type() == QEvent::WindowDeactivate) 890 { 891 /* Store focus state if it is on temporary editor. */ 892 if (widget->hasFocus()) 893 mWasTableSelected = true; 861 894 } 862 895 } else … … 869 902 (index.row() == mModel->rowCount() - 1 || !index.isValid())) 870 903 newClicked(); 904 } else 905 if (aEvent->type() == QEvent::WindowActivate) 906 { 907 if (mWasTableSelected) 908 { 909 /* Restore focus state if it was on temporary editor. */ 910 mWasTableSelected = false; 911 mTwAts->setFocus(); 912 } 871 913 } 872 914
Note:
See TracChangeset
for help on using the changeset viewer.