#define BLOCK_SIGNALS blockSignals(TRUE)
#define ALLOW_SIGNALS blockSignals(FALSE)
#define BLOCK_SIGNALS blockSignals(TRUE)
#define ALLOW_SIGNALS blockSignals(FALSE)
To copy to clipboard, switch view to plain text mode
void AcquisitionBrowserWidget::Read_Only_Checked(bool value)
{
BLOCK_SIGNALS;
// Change the state of the 'Update Header' button appropriately.
Acquisition_Browser->Update_Header_Button->setEnabled(!value);
// If 'Read only' checkbox is not checked (edit possible), then the
// editable fields should be dark green otherwise, it should be black.
if(!value)
{
// Change the color of the editable fields to green.
DICOM_Information__Patient_Information__Name
->setTextColor
(1,
QColor(Qt
::darkGreen));
DICOM_Information__Patient_Information__ID->setTextColor(1,Qt::darkGreen);
DICOM_Information__Study__Description->setTextColor(1,Qt::darkGreen);
DICOM_Information__Study__UID->setTextColor(1,Qt::darkGreen);
DICOM_Information__Series__Description->setTextColor(1,Qt::darkGreen);
DICOM_Information__Series__UID->setTextColor(1,Qt::darkGreen);
// Set the fields so that they are not editable.
DICOM_Information__Patient_Information__Name->setFlags(Qt::ItemIsEditable);
DICOM_Information__Patient_Information__ID->setFlags(Qt::ItemIsEditable);
//DICOM_Information__Study__Description->setFlags(Qt::ItemIsEditable);
DICOM_Information__Study__UID->setFlags(Qt::ItemIsEditable);
//DICOM_Information__Series__Description->setFlags(Qt::ItemIsEditable);
DICOM_Information__Series__UID->setFlags(Qt::ItemIsEditable);
Acquisition_Browser
->Update_Header_Button
->setIcon
(QIcon("greenball.png"));
DICOM_Tree_Data_Changed = false;
DICOM_Tree_Data_Updated = false;
}
else
{
// Change the color of the editable fields to black.
DICOM_Information__Patient_Information__Name
->setTextColor
(1,
QColor(Qt
::black));
DICOM_Information__Patient_Information__ID->setTextColor(1,Qt::black);
DICOM_Information__Study__Description->setTextColor(1,Qt::black);
DICOM_Information__Study__UID->setTextColor(1,Qt::black);
DICOM_Information__Series__Description->setTextColor(1,Qt::black);
DICOM_Information__Series__UID->setTextColor(1,Qt::black);
// Set the fields so that they are not editable.
DICOM_Information__Patient_Information__Name->setFlags(!Qt::ItemIsEditable);
DICOM_Information__Patient_Information__ID->setFlags(!Qt::ItemIsEditable);
DICOM_Information__Study__UID->setFlags(!Qt::ItemIsEditable);
DICOM_Information__Series__UID->setFlags(!Qt::ItemIsEditable);
// If the data changed, then notify the user.
if(DICOM_Tree_Data_Updated && DICOM_Tree_Data_Changed)
{
QMessageBox::information(this,
"DICOM Inspector Warning",
"The DICOM information has changed but was not updated.");
}
// Update the colored indicator on the button.
ALLOW_SIGNALS;
}
void AcquisitionBrowserWidget::Read_Only_Checked(bool value)
{
BLOCK_SIGNALS;
// Change the state of the 'Update Header' button appropriately.
Acquisition_Browser->Update_Header_Button->setEnabled(!value);
// If 'Read only' checkbox is not checked (edit possible), then the
// editable fields should be dark green otherwise, it should be black.
if(!value)
{
// Change the color of the editable fields to green.
DICOM_Information__Patient_Information__Name->setTextColor(1,QColor(Qt::darkGreen));
DICOM_Information__Patient_Information__ID->setTextColor(1,Qt::darkGreen);
DICOM_Information__Study__Description->setTextColor(1,Qt::darkGreen);
DICOM_Information__Study__UID->setTextColor(1,Qt::darkGreen);
DICOM_Information__Series__Description->setTextColor(1,Qt::darkGreen);
DICOM_Information__Series__UID->setTextColor(1,Qt::darkGreen);
// Set the fields so that they are not editable.
DICOM_Information__Patient_Information__Name->setFlags(Qt::ItemIsEditable);
DICOM_Information__Patient_Information__ID->setFlags(Qt::ItemIsEditable);
//DICOM_Information__Study__Description->setFlags(Qt::ItemIsEditable);
DICOM_Information__Study__UID->setFlags(Qt::ItemIsEditable);
//DICOM_Information__Series__Description->setFlags(Qt::ItemIsEditable);
DICOM_Information__Series__UID->setFlags(Qt::ItemIsEditable);
Acquisition_Browser->Update_Header_Button->setIcon(QIcon("greenball.png"));
DICOM_Tree_Data_Changed = false;
DICOM_Tree_Data_Updated = false;
}
else
{
// Change the color of the editable fields to black.
DICOM_Information__Patient_Information__Name->setTextColor(1,QColor(Qt::black));
DICOM_Information__Patient_Information__ID->setTextColor(1,Qt::black);
DICOM_Information__Study__Description->setTextColor(1,Qt::black);
DICOM_Information__Study__UID->setTextColor(1,Qt::black);
DICOM_Information__Series__Description->setTextColor(1,Qt::black);
DICOM_Information__Series__UID->setTextColor(1,Qt::black);
// Set the fields so that they are not editable.
DICOM_Information__Patient_Information__Name->setFlags(!Qt::ItemIsEditable);
DICOM_Information__Patient_Information__ID->setFlags(!Qt::ItemIsEditable);
DICOM_Information__Study__UID->setFlags(!Qt::ItemIsEditable);
DICOM_Information__Series__UID->setFlags(!Qt::ItemIsEditable);
// If the data changed, then notify the user.
if(DICOM_Tree_Data_Updated && DICOM_Tree_Data_Changed)
{
QMessageBox::information(this,"DICOM Inspector Warning","The DICOM information has changed but was not updated.");
}
// Update the colored indicator on the button.
ALLOW_SIGNALS;
}
To copy to clipboard, switch view to plain text mode
Bookmarks