bookmarkNameLineEditPointer->setText(bookmarkName);
bookmarkUrlLineEditPointer->setText(bookmarkUrl);
- // Scroll to the beginning of the line edits.
- bookmarkNameLineEditPointer->setCursorPosition(0);
+ // Scroll to the beginning of the bookmark URL line edit.
bookmarkUrlLineEditPointer->setCursorPosition(0);
+ // Focus the bookmark name line edit.
+ bookmarkNameLineEditPointer->setFocus();
+
// Add buttons to the dialog button box.
addButtonPointer = dialogButtonBoxPointer->addButton(i18nc("The add bookmark button", "Add"), QDialogButtonBox::AcceptRole);
bookmarkNameLineEditPointer->setText(bookmarkStructPointer->name);
bookmarkUrlLineEditPointer->setText(bookmarkStructPointer->url);
- // Scroll to the beginning of the line edits.
- bookmarkNameLineEditPointer->setCursorPosition(0);
+ // Scroll to the beginning of the bookmark URL line edit.
bookmarkUrlLineEditPointer->setCursorPosition(0);
+ // Focus the bookmark name line edit.
+ bookmarkNameLineEditPointer->setFocus();
+
// Connect the buttons.
connect(browseButtonPointer, SIGNAL(clicked()), this, SLOT(browse()));
connect(dialogButtonBoxPointer, SIGNAL(accepted()), this, SLOT(save()));
// Populate the line edits.
folderNameLineEditPointer->setText(bookmarkStructPointer->name);
- // Scroll to the beginning of the line edits.
- folderNameLineEditPointer->setCursorPosition(0);
+ // Focus the folder name line edit.
+ folderNameLineEditPointer->setFocus();
// Connect the buttons.
connect(browseButtonPointer, SIGNAL(clicked()), this, SLOT(browse()));