forked from qt-creator/qt-creator
Generic highlighter: Add convenience buttons to download dialog interface.
Buttons Select All/Clear Selection/Invert Selection.
This commit is contained in:
@@ -64,6 +64,9 @@ ManageDefinitionsDialog::ManageDefinitionsDialog(
|
||||
populateDefinitionsWidget();
|
||||
|
||||
connect(ui.downloadButton, SIGNAL(clicked()), this, SLOT(downloadDefinitions()));
|
||||
connect(ui.allButton, SIGNAL(clicked()), this, SLOT(selectAll()));
|
||||
connect(ui.clearButton, SIGNAL(clicked()), this, SLOT(clearSelection()));
|
||||
connect(ui.invertButton, SIGNAL(clicked()), this, SLOT(invertSelection()));
|
||||
}
|
||||
|
||||
void ManageDefinitionsDialog::populateDefinitionsWidget()
|
||||
@@ -117,6 +120,28 @@ void ManageDefinitionsDialog::downloadDefinitions()
|
||||
accept();
|
||||
}
|
||||
|
||||
void ManageDefinitionsDialog::selectAll()
|
||||
{
|
||||
ui.definitionsTable->selectAll();
|
||||
ui.definitionsTable->setFocus();
|
||||
}
|
||||
|
||||
void ManageDefinitionsDialog::clearSelection()
|
||||
{
|
||||
ui.definitionsTable->clearSelection();
|
||||
}
|
||||
|
||||
void ManageDefinitionsDialog::invertSelection()
|
||||
{
|
||||
const QModelIndex &topLeft = ui.definitionsTable->model()->index(0, 0);
|
||||
const QModelIndex &bottomRight =
|
||||
ui.definitionsTable->model()->index(ui.definitionsTable->rowCount() - 1,
|
||||
ui.definitionsTable->columnCount() - 1);
|
||||
QItemSelection itemSelection(topLeft, bottomRight);
|
||||
ui.definitionsTable->selectionModel()->select(itemSelection, QItemSelectionModel::Toggle);
|
||||
ui.definitionsTable->setFocus();
|
||||
}
|
||||
|
||||
void ManageDefinitionsDialog::changeEvent(QEvent *e)
|
||||
{
|
||||
QDialog::changeEvent(e);
|
||||
|
||||
Reference in New Issue
Block a user