QwtDynGridLayout::~QwtDynGridLayout() { #if QT_VERSION < 0x040000 deleteAllItems(); #endif delete d_data; }
void CGroupSearchResultPage::OnRefresh() { deleteAllItems(); CGroupSearchWizard *wiz = (CGroupSearchWizard *) GetParent(); if (wiz->modePage.m_mode == 0) { int type = wiz->typePage.getGroupType(); wiz->seq = getUdpSession()->getGroupList(type); } else { uint32 id = wiz->modePage.m_groupID; wiz->seq = getUdpSession()->searchGroup(id); } GetDlgItem(IDC_REFRESH)->EnableWindow(FALSE); }
//========================================================================= // // Destructor. // //========================================================================= InvPartEditor::~InvPartEditor() { deleteAllItems(); }
void ListItems::connectionLost() { unSubscribe(); Watch::unsubscribe( eventsOnOff); deleteAllItems(); }
void CGroupSearchResultPage::OnDestroy() { deleteAllItems(); CPropertyPage::OnDestroy(); }
FlowLayout::~FlowLayout() { deleteAllItems(); }
UserFunctionListWidget::UserFunctionListWidget(QWidget* parent) : QWidget(parent) , m_filterTimer(new QTimer(this)) , m_userFunctions(new QTreeWidget(this)) , m_noMatchLabel(new QLabel(m_userFunctions)) , m_searchFilter(new QLineEdit(this)) , m_searchLabel(new QLabel(this)) { m_filterTimer->setInterval(500); m_filterTimer->setSingleShot(true); m_userFunctions->setAlternatingRowColors(true); m_userFunctions->setAutoScroll(true); m_userFunctions->setColumnCount(2); m_userFunctions->setEditTriggers(QTreeWidget::NoEditTriggers); m_userFunctions->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); m_userFunctions->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel); m_userFunctions->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); m_userFunctions->setRootIsDecorated(false); m_userFunctions->setSelectionBehavior(QTreeWidget::SelectRows); m_userFunctions->setCursor(QCursor(Qt::PointingHandCursor)); m_noMatchLabel->setAlignment(Qt::AlignCenter); m_noMatchLabel->adjustSize(); m_noMatchLabel->hide(); QWidget* searchBox = new QWidget(this); QHBoxLayout* searchLayout = new QHBoxLayout; searchLayout->addWidget(m_searchLabel); searchLayout->addWidget(m_searchFilter); searchLayout->setMargin(0); searchBox->setLayout(searchLayout); QVBoxLayout* layout = new QVBoxLayout; layout->setMargin(3); layout->addWidget(searchBox); layout->addWidget(m_userFunctions); setLayout(layout); QMenu* contextMenu = new QMenu(m_userFunctions); m_insertAction = new QAction("", contextMenu); m_editAction = new QAction("", contextMenu); m_deleteAction = new QAction("", contextMenu); m_deleteAllAction = new QAction("", contextMenu); m_userFunctions->setContextMenuPolicy(Qt::ActionsContextMenu); m_userFunctions->addAction(m_insertAction); m_userFunctions->addAction(m_editAction); m_userFunctions->addAction(m_deleteAction); m_userFunctions->addAction(m_deleteAllAction); QWidget::setTabOrder(m_searchFilter, m_userFunctions); retranslateText(); connect(m_filterTimer, SIGNAL(timeout()), SLOT(fillTable())); connect(m_searchFilter, SIGNAL(textChanged(const QString&)), SLOT(triggerFilter())); connect(m_userFunctions, SIGNAL(itemActivated(QTreeWidgetItem*, int)), SLOT(activateItem())); connect(m_insertAction, SIGNAL(triggered()), SLOT(activateItem())); connect(m_editAction, SIGNAL(triggered()), SLOT(editItem())); connect(m_deleteAction, SIGNAL(triggered()), SLOT(deleteItem())); connect(m_deleteAllAction, SIGNAL(triggered()), SLOT(deleteAllItems())); }
BorderLayout::~BorderLayout() { deleteAllItems(); }
SimpleFlow::~SimpleFlow() { deleteAllItems(); }
/*! \brief TreeModel::setObject */ void TreeModel::setObject( QObject* object ) { // Clean up workspace if necessary. if ( mp_object && mp_object != object ) { // Remove connections. for ( int i = 0 ; i < mp_object->metaObject()->propertyCount(); ++i ) { if ( mp_object->metaObject()->property( i ).hasNotifySignal() ) { QMetaMethod signal = mp_object->metaObject()->property( i ).notifySignal(); bool res = disconnect( mp_object, signal, this, m_updateSlot ); Q_ASSERT( res ); } } // Delete items. deleteAllItems(); // Clear the mapping. m_propertyIndexToItemMap.clear(); } mp_object = object; if ( !object ) { // No object is passed, nothing needs to be done. return; } // A valdid object is passed, fill the QTreeView with it's properties. int propertyCount = object->metaObject()->propertyCount(); for ( int i = 0; i < propertyCount; ++i ) { QMetaProperty metaProperty = object->metaObject()->property( i ); QString typeName = metaProperty.name(); QVariant value = object->property( metaProperty.name() ); QList<QStandardItem*> itemRow; QStandardItem* first = createItem( metaProperty, typeName, false ); itemRow.append( first ); // if ( metaProperty.isEnumType() ) // { // qDebug() << metaProperty.type(); // qDebug() << metaProperty.typeName(); // QString name = metaProperty.typeName(); // if ( name == "SkeletonData::Joints" ) // { // qDebug() << "GOT IT"; // } // } // Unwrap special QVariant types. if ( value.canConvert<QVector3D>() ) { // Case: QVector3D QVector3D vec = qvariant_cast<QVector3D>( value ); QList<QStandardItem*> nextRow; // Extract values from QVector3D QStandardItem* tmp = nullptr; // x-coordinate tmp= createItem( metaProperty, "x", false ); nextRow.append( tmp ); tmp = createItem( metaProperty, vec.x(), true ); nextRow.append( tmp ); tmp = createItem( metaProperty, "float", false ); nextRow.append( tmp ); first->appendRow( nextRow ); nextRow.clear(); // y-coordinate tmp= createItem( metaProperty, "y", false ); nextRow.append( tmp ); tmp = createItem( metaProperty, vec.y(), true ); nextRow.append( tmp ); tmp = createItem( metaProperty, "float", false ); nextRow.append( tmp ); first->appendRow( nextRow ); nextRow.clear(); // z-coordinte tmp= createItem( metaProperty, "z", false ); nextRow.append( tmp ); tmp = createItem( metaProperty, vec.z(), true ); nextRow.append( tmp ); tmp = createItem( metaProperty, "float", false ); nextRow.append( tmp ); first->appendRow( nextRow ); // Append second and third item on the top level. tmp = createItem( metaProperty, value, false ); itemRow.append( tmp ); tmp = createItem( metaProperty, "QVector3D", false ); itemRow.append( tmp ); } else if ( value.canConvert<cv::Size>() ) { // Case: cv::Size cv::Size size = qvariant_cast<cv::Size>( value ); QList<QStandardItem*> nextRow; // Extract values from cv::Size QStandardItem* tmp = nullptr; // Width tmp= createItem( metaProperty, tr( "width" ), false ); nextRow.append( tmp ); tmp = createItem( metaProperty, size.width, true ); nextRow.append( tmp ); tmp = createItem( metaProperty, "uchar", false ); nextRow.append( tmp ); first->appendRow( nextRow ); nextRow.clear(); // Height tmp= createItem( metaProperty, tr( "height" ), false ); nextRow.append( tmp ); tmp = createItem( metaProperty, size.height, true ); nextRow.append( tmp ); tmp = createItem( metaProperty, "uchar", false ); nextRow.append( tmp ); first->appendRow( nextRow ); nextRow.clear(); // Append editable data. tmp = createItem( metaProperty, value, false ); connectProperty( mp_object, metaProperty, tmp ); itemRow.append( tmp ); } else if ( value.canConvert<FixedPropertyVector>() ) { // Case: FixedPropertyVector FixedPropertyVector vec = qvariant_cast<FixedPropertyVector>( value ); QList<QStandardItem*> nextRow; QStandardItem* tmp; for ( int i = 0; i < vec.size(); ++i ) { nextRow.clear(); // Append name. tmp = createItem( metaProperty, QString::number( i ), false ); nextRow.append( tmp ); // Append data. tmp = createItem( metaProperty, vec.at( i ), true ); nextRow.append( tmp ); // Append type informations. tmp = createItem( metaProperty, "float", false ); nextRow.append( tmp ); first->appendRow( nextRow ); } // Append editable data. tmp = createItem( metaProperty, value, false ); connectProperty( mp_object, metaProperty, tmp ); itemRow.append( tmp ); } else { // Append editable data. QStandardItem* tmp = createItem( metaProperty, value, true ); connectProperty( mp_object, metaProperty, tmp ); itemRow.append( tmp ); } // Append type informations. QStandardItem* tmp = createItem( metaProperty, value.typeName(), false ); itemRow.append( tmp ); // Append the row to the invisible root item. appendRow( itemRow ); } }