MCPcopy Create free account
hub / github.com/Zalafina/QKeyMapper / initMouseDeviceTable

Method initMouseDeviceTable

QKeyMapper/qinputdevicelistwindow.cpp:403–434  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

401}
402
403void QInputDeviceListWindow::initMouseDeviceTable()
404{
405 ui->mouseDeviceTable->setFocusPolicy(Qt::NoFocus);
406 ui->mouseDeviceTable->setColumnCount(MOUSE_TABLE_COLUMN_COUNT);
407 ui->mouseDeviceTable->horizontalHeader()->setStretchLastSection(true);
408 ui->mouseDeviceTable->horizontalHeader()->setHighlightSections(false);
409 ui->mouseDeviceTable->verticalHeader()->setVisible(false);
410 ui->mouseDeviceTable->verticalHeader()->setDefaultSectionSize(25);
411 ui->mouseDeviceTable->setSelectionBehavior(QAbstractItemView::SelectRows);
412 ui->mouseDeviceTable->setSelectionMode(QAbstractItemView::NoSelection);
413 ui->mouseDeviceTable->setEditTriggers(QAbstractItemView::NoEditTriggers);
414
415 int number_width = 26;
416 int devicedesc_width = ui->mouseDeviceTable->width()/7;
417 int vendorid_width = 60;
418 int productid_width = 60;
419 int vendorstr_width = ui->mouseDeviceTable->width()/7 - 40;
420 int productstr_width = ui->mouseDeviceTable->width()/5 - 30;
421 int manufacturer_width = vendorstr_width;
422 int disable_width = 30;
423 int hardwareid_width = ui->mouseDeviceTable->width() - number_width - devicedesc_width - vendorid_width - productid_width - vendorstr_width - productstr_width - manufacturer_width - disable_width - 12;
424
425 ui->mouseDeviceTable->setColumnWidth(DEVICE_TABLE_NUMBER_COLUMN, number_width);
426 ui->mouseDeviceTable->setColumnWidth(DEVICE_TABLE_DEVICEDESC_COLUMN, devicedesc_width);
427 ui->mouseDeviceTable->setColumnWidth(DEVICE_TABLE_HARDWAREID_COLUMN, hardwareid_width);
428 ui->mouseDeviceTable->setColumnWidth(DEVICE_TABLE_VENDORID_COLUMN, vendorid_width);
429 ui->mouseDeviceTable->setColumnWidth(DEVICE_TABLE_PRODUCTID_COLUMN, productid_width);
430 ui->mouseDeviceTable->setColumnWidth(DEVICE_TABLE_VENDORSTR_COLUMN, vendorstr_width);
431 ui->mouseDeviceTable->setColumnWidth(DEVICE_TABLE_PRODUCTSTR_COLUMN, productstr_width);
432 ui->mouseDeviceTable->setColumnWidth(DEVICE_TABLE_MANUFACTURER_COLUMN, manufacturer_width);
433 ui->mouseDeviceTable->setColumnWidth(DEVICE_TABLE_DISABLE_COLUMN, disable_width);
434}
435
436void QInputDeviceListWindow::onKeyboardListCellChanged(int row, int col)
437{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected