[Qt] make most Windows appear centered on main GUI
- remove default value for parent variable in dialogs, which should appear centered over main GUI and pass appropriate value - add some addition NULL pointer checks
This commit is contained in:
@@ -158,6 +158,9 @@ void AddressBookPage::onCopyLabelAction()
|
||||
|
||||
void AddressBookPage::onEditAction()
|
||||
{
|
||||
if(!model)
|
||||
return;
|
||||
|
||||
if(!ui->tableView->selectionModel())
|
||||
return;
|
||||
QModelIndexList indexes = ui->tableView->selectionModel()->selectedRows();
|
||||
@@ -165,9 +168,9 @@ void AddressBookPage::onEditAction()
|
||||
return;
|
||||
|
||||
EditAddressDialog dlg(
|
||||
tab == SendingTab ?
|
||||
EditAddressDialog::EditSendingAddress :
|
||||
EditAddressDialog::EditReceivingAddress);
|
||||
tab == SendingTab ?
|
||||
EditAddressDialog::EditSendingAddress :
|
||||
EditAddressDialog::EditReceivingAddress, this);
|
||||
dlg.setModel(model);
|
||||
QModelIndex origIndex = proxyModel->mapToSource(indexes.at(0));
|
||||
dlg.loadRow(origIndex.row());
|
||||
@@ -180,9 +183,9 @@ void AddressBookPage::on_newAddress_clicked()
|
||||
return;
|
||||
|
||||
EditAddressDialog dlg(
|
||||
tab == SendingTab ?
|
||||
EditAddressDialog::NewSendingAddress :
|
||||
EditAddressDialog::NewReceivingAddress, this);
|
||||
tab == SendingTab ?
|
||||
EditAddressDialog::NewSendingAddress :
|
||||
EditAddressDialog::NewReceivingAddress, this);
|
||||
dlg.setModel(model);
|
||||
if(dlg.exec())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user