#include <QMessageBox>
if ( obj_schedule_table != 0 )
{
for(int i=0; i<obj_schedule_table->rowCount(); i++)
{
QWidget * widget1
= obj_schedule_table
->cellWidget
(i,
3);
if ( widget1 != 0 )
{
QComboBox * combo
= dynamic_cast<QComboBox
*>
(widget1
->children
().
at(1));
if ( combo != 0 )
{
combo->setEditable(false);
mapper->setMapping(combo, i);
connect(combo,
SIGNAL(activated
(QString)), mapper,
SLOT (map
()));
}
else
QMessageBox::critical( this,
"Error",
"Pointer to combo is NULL" );
}
else
QMessageBox::critical( this,
"Error",
"Pointer to widget1 is NULL" );
}
}
else
QMessageBox::critical( this,
"Error",
"Pointer to obj_schedule_table is NULL" );
connect(mapper, SIGNAL(mapped(int)), this, SLOT(set_item_combobox_type(int)));
#include <QMessageBox>
mapper = new QSignalMapper ();
if ( obj_schedule_table != 0 )
{
for(int i=0; i<obj_schedule_table->rowCount(); i++)
{
QWidget * widget1 = obj_schedule_table->cellWidget(i,3);
if ( widget1 != 0 )
{
QComboBox * combo = dynamic_cast<QComboBox*>(widget1->children().at(1));
if ( combo != 0 )
{
combo->setEditable(false);
mapper->setMapping(combo, i);
connect(combo, SIGNAL(activated(QString)), mapper, SLOT (map()));
}
else
QMessageBox::critical( this, "Error", "Pointer to combo is NULL" );
}
else
QMessageBox::critical( this, "Error", "Pointer to widget1 is NULL" );
}
}
else
QMessageBox::critical( this, "Error", "Pointer to obj_schedule_table is NULL" );
connect(mapper, SIGNAL(mapped(int)), this, SLOT(set_item_combobox_type(int)));
To copy to clipboard, switch view to plain text mode
Bookmarks