示例#1
0
KexiReportFactory::KexiReportFactory(QObject *parent, const char *name, const QStringList &)
 : KFormDesigner::WidgetFactory(parent, name)
{
	KFormDesigner::WidgetInfo *wView = new KFormDesigner::WidgetInfo(this);
	wView->setPixmap("report");
	wView->setClassName("KexiReportForm");
	wView->setName(i18n("Report"));
	wView->setNamePrefix(
		i18n("Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "report"));
	wView->setDescription(i18n("A report"));
	addClass(wView);

	KFormDesigner::WidgetInfo *wLabel = new KFormDesigner::WidgetInfo(this);
	wLabel->setPixmap("label");
	wLabel->setClassName("Label");
	wLabel->setName(i18n("Label"));
	wLabel->setNamePrefix(
		i18n("Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "label"));
	wLabel->setDescription(i18n("A label to display text"));
	addClass(wLabel);

	KFormDesigner::WidgetInfo *wPicLabel = new KFormDesigner::WidgetInfo(this);
	wPicLabel->setPixmap("pixmaplabel");
	wPicLabel->setClassName("PicLabel");
	wPicLabel->setName(i18n("Picture Label"));
	wPicLabel->setNamePrefix(
		i18n("Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "picture"));
	wPicLabel->setDescription(i18n("A label to display images or icons"));
	addClass(wPicLabel);

	KFormDesigner::WidgetInfo *wLine = new KFormDesigner::WidgetInfo(this);
	wLine->setPixmap("line");
	wLine->setClassName("ReportLine");
	wLine->setName(i18n("Line"));
	wLine->setNamePrefix(
		i18n("Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "line"));
	wLine->setDescription(i18n("A simple line"));
	addClass(wLine);

	KFormDesigner::WidgetInfo *wSubReport = new KFormDesigner::WidgetInfo(this);
	wSubReport->setPixmap("report");
	wSubReport->setClassName("KexiSubReport");
	wSubReport->setName(i18n("Sub Report"));
	wSubReport->setNamePrefix(
		i18n("Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "subReport"));
	wSubReport->setDescription(i18n("A report embedded in another report"));
	addClass(wSubReport);
}
void
EmptyStatement::dumpXml(TiXmlElement *parent) const
{
	TiXmlElement *elem = addClass(parent, "EmptyStatement");
	addMember(elem, "locFirst", locFirst);
	addMember(elem, "locLast", locLast);
}
示例#3
0
/**
 * Inserts a class into memory
 */
void ClassLoader::insertClass( Class* theClass ) {
	// allocate memory for the class


	// add the class to the cache
	addClass( theClass );
}
void DescendantInvalidationSet::combine(const DescendantInvalidationSet& other)
{
    // No longer bother combining data structures, since the whole subtree is deemed invalid.
    if (wholeSubtreeInvalid())
        return;

    if (other.wholeSubtreeInvalid()) {
        setWholeSubtreeInvalid();
        return;
    }

    if (other.m_classes) {
        HashSet<AtomicString>::const_iterator end = other.m_classes->end();
        for (HashSet<AtomicString>::const_iterator it = other.m_classes->begin(); it != end; ++it)
            addClass(*it);
    }

    if (other.m_ids) {
        HashSet<AtomicString>::const_iterator end = other.m_ids->end();
        for (HashSet<AtomicString>::const_iterator it = other.m_ids->begin(); it != end; ++it)
            addId(*it);
    }

    if (other.m_tagNames) {
        HashSet<AtomicString>::const_iterator end = other.m_tagNames->end();
        for (HashSet<AtomicString>::const_iterator it = other.m_tagNames->begin(); it != end; ++it)
            addTagName(*it);
    }
}
void
NotEqual::dumpXml(TiXmlElement *parent) const
{
	TiXmlElement *elem = addClass(parent, "NotEqual");
	addMember(elem, "locFirst", locFirst);
	addMember(elem, "locLast", locLast);
}
示例#6
0
void ClassDiagram::clearGraphAndAddClass(OovStringRef const className,
        ClassGraph::eAddNodeTypes addType, int depth, bool reposition)
    {
    mClassGraph.clearGraph();
    addClass(className, addType, depth, reposition);
    setLastSelectedClassName(className);
    }
示例#7
0
 // Qualifiers are known to be appropriate for 'class'
 void Parser::classDefinition(int /*flags*/, Qualifier* qual)
 {
     // FIXME: pick up the methods plus all other flags somehow, these are available from the binding ribs
     // Maybe time to package them up conveniently (FunctionDefinition needs it too).
     eat(T_Class);
     Str* name = identifier();
     Str* extends = NULL;
     SeqBuilder<Str*> implements(allocator);
     if (match(T_Extends)) {
         extends = identifier();
     }
     if (match(T_Implements)) {
         do {
             implements.addAtEnd(identifier());
         } while (match(T_Comma));
     }
     eat(T_LeftBrace);
     pushBindingRib(RIB_Class);
     pushBindingRib(RIB_Instance);
     Seq<Stmt*>* instance_init = NULL;
     Seq<Stmt*>* class_init = directives(SFLAG_Class, &instance_init);
     popBindingRib();
     popBindingRib();
     eat(T_RightBrace);
     addClass(ALLOC(ClassDefn, (qual, name, extends, implements.get(), class_init, instance_init)));
 }
示例#8
0
// ######################################################################
void RecurBayes::learn(std::vector<double> &fv, const char *name, uint fix)
{
  //get the class id

  int cls = getClassId(name);
  if (cls == -1) //this is a new class, add it to the network
    cls = addClass(name);

  ASSERT(fv.size() == itsNumFeatures);

  //update the class freq
  ASSERT((uint)cls < itsNumClasses);
  itsClassFreq[cls]++;

  //compute the stddev and mean of each feature
  //This algorithm is due to Knuth (The Art of Computer Programming, volume 2:
  //  Seminumerical Algorithms, 3rd edn., p. 232. Boston: Addison-Wesley.)
  for (uint i=0; i<fv.size(); i++){
    double val = fv[i];
    double delta = val - itsMean[cls][fix][i];
    itsMean[cls][fix][i] += delta/itsClassFreq[cls];
    if (itsClassFreq[cls] > 3)
    {
      itsVar[cls][fix][i] = (itsVar[cls][fix][i]*(itsClassFreq[cls]-2))
        + delta*(val - itsMean[cls][fix][i]);
    }
    if (itsClassFreq[cls] > 1) //watch for divide by 0
      itsVar[cls][fix][i] /= double(itsClassFreq[cls]-1);
  }

}
示例#9
0
TEST(OOInteraction, SimpleTest)
{
	Model::Model* model = new Model::Model();

	Project* pr = nullptr;
	pr = addProject(model);

	Class* cl = nullptr;
	cl = addClass(model, pr);

	Method* divbysix = nullptr;
	divbysix = addDivBySix(model, cl);

	Model::Node* top_level = nullptr;
	if (pr) top_level = pr;
	else if (cl) top_level = cl;
	else top_level = divbysix;

	Scene* scene = new Scene();
	scene->addTopLevelItem( scene->defaultRenderer()->render(nullptr, top_level) );
	scene->scheduleUpdate();
	scene->listenToModel(model);

	// Create view
	MainView* view = new MainView(scene);

	CHECK_CONDITION(view != nullptr);
}
void
NamedType::dumpXml(TiXmlElement *parent) const
{
	TiXmlElement *elem = addClass(parent, "NamedType");
	addMember(elem, "body", body);
	addMember(elem, "locFirst", locFirst);
	addMember(elem, "locLast", locLast);
}
void
BreakStatement::dumpXml(TiXmlElement *parent) const
{
	TiXmlElement *elem = addClass(parent, "BreakStatement");
	addMember(elem, "target", target);
	addMember(elem, "locFirst", locFirst);
	addMember(elem, "locLast", locLast);
}
示例#12
0
int main(int argc, char ** argv) {
    if (argc < 2) {
        std::cerr << "Driver must be called with the .class file to test" << std::endl;
        return 1;
    }

    auto cls = new Espresso::Blender::JVMClass(argv[1]);

    auto classdb = new Espresso::VM::ClassResolver();
    classdb->addClass(new Espresso::VM::Class::DlOpen("java/lang/System"));
    classdb->addClass(cls);

    auto vmp = Espresso::Blender::VMMethodProvider(classdb);
    vmp.getNativeMethod(cls->name(), "test", "()V"); // use another method just to check if <clinit> is called

    return _called_code == 99 ? 0 : 2;
}
示例#13
0
bool CibIdMgr::loadIds(const std::string& idsFilePath)
{
  CppParser cppparser;
  auto      idCmp = cppparser.parseFile(idsFilePath.c_str());
  if (idCmp == nullptr)
    return false;
  std::unordered_map<CibFullClassNsName, CibFullClassName> nsNameToNameMap;
  traverse(idCmp, [&](const CppObj* cppObj) -> bool {
    if (cppObj->objType_ == CppObjType::kEnum)
    {
      auto* enumObj = static_cast<const CppEnum*>(cppObj);
      if (!enumObj->itemList_)
        return false;
      static const std::string kClassIdName     = "__zz_cib_classid";
      static const std::string kMethodIdName    = "__zz_cib_methodid";
      static const std::string kNextClsIdName   = "__zz_cib_next_class_id";
      auto                     extractClassName = [](const CppCompound* classObj) -> std::string {
        if (!classObj->members().empty() && (classObj->members().front()->objType_ == CppObjType::kDocComment))
        {
          static const std::string kClsNameCommentStart = "//#= FullClassName: ";
          const CppDocCommentEPtr  cmnt                 = classObj->members().front();
          auto                     startPos             = cmnt->doc_.find(kClsNameCommentStart);
          if (startPos != std::string::npos)
            return cmnt->doc_.substr(startPos + kClsNameCommentStart.size());
        }
        return "";
      };
      auto extractClassNsName = [](const CppCompound* classObj) -> std::string {
        return fullName(classObj).substr(11); // skip "__zz_cib_::"
      };
      if (cppObj->owner()->name() == kMethodIdName)
      {
        auto classNsName = extractClassNsName(cppObj->owner()->owner());
        auto itr         = nsNameToNameMap.find(classNsName);
        if (itr != nsNameToNameMap.end())
          loadMethodIds(itr->second, static_cast<const CppEnum*>(cppObj));
      }
      else if (enumObj->itemList_->front()->name_ == kClassIdName)
      {
        auto clsName   = extractClassName(enumObj->owner());
        auto clsNsName = extractClassNsName(enumObj->owner());
        auto clsId     = parseIdExpression(enumObj->itemList_->front()->val_);
        if (clsId != 0)
          addClass(clsName, clsNsName, clsId);
        if (!clsName.empty() && !clsNsName.empty())
          nsNameToNameMap[clsNsName] = clsName;
      }
      else if (enumObj->itemList_->front()->name_ == kNextClsIdName)
      {
        auto nextClsId = parseIdExpression(enumObj->itemList_->front()->val_);
        if (nextClassId_ < nextClsId)
          nextClassId_ = nextClsId;
      }
    }
    return false;
  });
  return true;
}
示例#14
0
bool ClassDiagram::loadDiagram(File &file)
    {
    NameValueFile nameValFile;
    bool success = nameValFile.readFile(file);
    if(success)
        {
        CompoundValue names;
        names.parseString(nameValFile.getValue("Names"));
        CompoundValue xPositions;
        xPositions.parseString(nameValFile.getValue("XPositions"));
        CompoundValue yPositions;
        yPositions.parseString(nameValFile.getValue("YPositions"));
        std::vector<ClassNode> &nodes = getNodes();
        for(size_t i=0; i<names.size(); i++)
            {
            OovString name = names[i];
            if(i == 0)
                {
                // The node at index zero is the graph key, and is not stored in
                // the graph with a name or type.
                // The node at index one is the first class, which is typically the
                // same as the drawing name.
                eDiagramStorageTypes drawingType;
                OovString drawingName;
                DiagramStorage::getDrawingHeader(nameValFile, drawingType, drawingName);
                // This adds the key automatically as item index zero.
                // Call this function to set the last selected class name for the journal.
                clearGraphAndAddClass(drawingName, ClassGraph::AN_All,
                        ClassDiagram::DEPTH_SINGLE_CLASS, false);
                int x=0;
                int y=0;
                xPositions[i].getInt(0, INT_MAX, x);
                yPositions[i].getInt(0, INT_MAX, y);
                nodes[0].setPosition(GraphPoint(x, y));
                }
            else
                {
                // This will not add duplicates, so if the name is different
                // from the drawingName, it will be added.
                addClass(name, ClassGraph::AN_All,
                    ClassDiagram::DEPTH_SINGLE_CLASS, false);
                }

            auto nodeIter = std::find_if(nodes.begin(), nodes.end(),
                [&name](ClassNode &node)
                { return(node.getType() && name == node.getType()->getName()); });
            if(nodeIter != nodes.end())
                {
                int x=0;
                int y=0;
                xPositions[i].getInt(0, INT_MAX, x);
                yPositions[i].getInt(0, INT_MAX, y);
                nodeIter->setPosition(GraphPoint(x, y));
                }
            }
        }
    return success;
    }
示例#15
0
void MaxEntTrainer::loadParams(istream& istrm)
{
  string name;
  int c;
  istrm >> _alpha >> _threshold >> _maxIterations;
  istrm >> c;
  for (int i = 0; i<c && (istrm >> name); i++) {
    addClass(name);
  }
}
void
ReferenceType::dumpXml(TiXmlElement *parent) const
{
	TiXmlElement *elem = addClass(parent, "ReferenceType");
	addMember(elem, "isConst", isConst);
	addMember(elem, "isVolatile", isVolatile);
	//addMember(elem, "baseType", baseType);
	addMember(elem, "locFirst", locFirst);
	addMember(elem, "locLast", locLast);
}
void
WideCharacter::dumpXml(TiXmlElement *parent) const
{
	TiXmlElement *elem = addClass(parent, "WideCharacter");
	addMember(elem, "isConst", isConst);
	addMember(elem, "isSigned", isSigned);
	addMember(elem, "isVolatile", isVolatile);
	addMember(elem, "locFirst", locFirst);
	addMember(elem, "locLast", locLast);
}
void
DerivesFrom::dumpXml(TiXmlElement *parent) const
{
	TiXmlElement *elem = addClass(parent, "DerivesFrom");
	addMember(elem, "isVirtual", isVirtual);
	addMember(elem, "accessKind", accessKind);
	addMember(elem, "className", className);
	addMember(elem, "locFirst", locFirst);
	addMember(elem, "locLast", locLast);
}
void
BinaryExpression::dumpXml(TiXmlElement *parent) const
{
	TiXmlElement *elem = addClass(parent, "BinaryExpression");
	addMember(elem, "leftOperand", leftOperand);
	addMember(elem, "op", op);
	addMember(elem, "rightOperand", rightOperand);
	addMember(elem, "locFirst", locFirst);
	addMember(elem, "locLast", locLast);
}
示例#20
0
QgsGraduatedSymbolRendererV2Widget::QgsGraduatedSymbolRendererV2Widget( QgsVectorLayer* layer, QgsStyleV2* style, QgsFeatureRendererV2* renderer )
    : QgsRendererV2Widget( layer, style )
{

  // try to recognize the previous renderer
  // (null renderer means "no previous renderer")
  if ( !renderer || renderer->type() != "graduatedSymbol" )
  {
    // we're not going to use it - so let's delete the renderer
    delete renderer;

    mRenderer = new QgsGraduatedSymbolRendererV2( "", QgsRangeList() );
  }
  else
  {
    mRenderer = static_cast<QgsGraduatedSymbolRendererV2*>( renderer );
  }

  // setup user interface
  setupUi( this );

  populateColumns();

  cboGraduatedColorRamp->populate( mStyle );

  QStandardItemModel* mg = new QStandardItemModel( this );
  QStringList labels;
  labels << tr( "Range" ) << tr( "Label" );
  mg->setHorizontalHeaderLabels( labels );
  viewGraduated->setModel( mg );

  mGraduatedSymbol = QgsSymbolV2::defaultSymbol( mLayer->geometryType() );

  connect( cboGraduatedColumn, SIGNAL( currentIndexChanged( int ) ), this, SLOT( graduatedColumnChanged() ) );
  connect( viewGraduated, SIGNAL( doubleClicked( const QModelIndex & ) ), this, SLOT( rangesDoubleClicked( const QModelIndex & ) ) );
  connect( viewGraduated, SIGNAL( clicked( const QModelIndex & ) ), this, SLOT( rangesClicked( const QModelIndex & ) ) );
  connect( mg, SIGNAL( itemChanged( QStandardItem * ) ), this, SLOT( changeCurrentValue( QStandardItem * ) ) );
  connect( btnGraduatedClassify, SIGNAL( clicked() ), this, SLOT( classifyGraduated() ) );
  connect( btnChangeGraduatedSymbol, SIGNAL( clicked() ), this, SLOT( changeGraduatedSymbol() ) );
  connect( btnGraduatedDelete, SIGNAL( clicked() ), this, SLOT( deleteCurrentClass() ) );
  connect( btnGraduatedAdd, SIGNAL( clicked() ), this, SLOT( addClass() ) );



  // initialize from previously set renderer
  updateUiFromRenderer();

  // menus for data-defined rotation/size
  QMenu* advMenu = new QMenu;
  mDataDefinedMenus = new QgsRendererV2DataDefinedMenus( advMenu, mLayer->pendingFields(),
      mRenderer->rotationField(), mRenderer->sizeScaleField() );
  connect( mDataDefinedMenus, SIGNAL( rotationFieldChanged( QString ) ), this, SLOT( rotationFieldChanged( QString ) ) );
  connect( mDataDefinedMenus, SIGNAL( sizeScaleFieldChanged( QString ) ), this, SLOT( sizeScaleFieldChanged( QString ) ) );
  btnAdvanced->setMenu( advMenu );
}
示例#21
0
int main(int argc, char ** argv) {
    if (argc != 2) {
        std::cerr << "Test must be called with the path to the test class" << std::endl;
        return 1;
    }

    Espresso::Log = _log;

    auto classdb = Espresso::VM::ClassResolver();
    classdb.addClass(new Espresso::VM::Class::DlOpen("java/lang/Object"));

    auto cls = new Espresso::Blender::JVMClass(argv[1]);
    if (!*cls) {
        std::cerr << argv[1] << " wasn't loaded: " << cls->error() << std::endl;
        return 1;
    }
    classdb.addClass(cls);

    auto vmp = Espresso::Blender::VMMethodProvider(&classdb);

    int (*fn)(int, int) = (int (*)(int, int))vmp.getNativeMethod(cls->name(), "doSum", "(II)I");
    if (!fn) {
        std::cerr << argv[1] << " does not contain sum(II)I" << std::endl;
        return 1;
    }

    if (fn(0, 0) != 0) {
        std::cerr << "sum(0, 0) - expected 0, returned " << fn(0, 0) << std::endl;
        return 1;
    }
    if (fn(1, 6) != 7) {
        std::cerr << "sum(1, 6) - expected 7, returned " << fn(1, 6) << std::endl;
        return 1;
    }
    if (fn(-1, 6) != 5) {
        std::cerr << "sum(-1, 6) - expected 5, returned " << fn(-1, 6) << std::endl;
        return 1;
    }

    return 0;
}
void
QualifiedOverPointer::dumpXml(TiXmlElement *parent) const
{
	TiXmlElement *elem = addClass(parent, "QualifiedOverPointer");
	//addMember(elem, "expressionType", expressionType);
	addMember(elem, "name", name);
	addMember(elem, "member", member);
	addMember(elem, "qualifiers", qualifiers);
	//addMember(elem, "refersTo", refersTo);
	addMember(elem, "locFirst", locFirst);
	addMember(elem, "locLast", locLast);
}
示例#23
0
TEST_F(MgrTest, object_from_addr_basic) {
    CPE_HS_DEF_VAR(className, "class1");
    addClass("class1", 20);

    gd_om_oid_t oid = obj_alloc(className);
    EXPECT_TRUE(oid != GD_OM_INVALID_OID);

    void * objData = gd_om_obj_get(m_omm, oid, t_em());
    ASSERT_TRUE(objData);

    EXPECT_EQ(oid, gd_om_obj_id_from_addr(m_omm, objData, t_em()));
}
void
RangeType::dumpXml(TiXmlElement *parent) const
{
	TiXmlElement *elem = addClass(parent, "RangeType");
	addMember(elem, "isConst", isConst);
	addMember(elem, "isVolatile", isVolatile);
	//addMember(elem, "baseType", baseType);
	addMember(elem, "lowBound", lowBound);
	addMember(elem, "highBound", highBound);
	addMember(elem, "locFirst", locFirst);
	addMember(elem, "locLast", locLast);
}
void QgsUniqueValueDialog::changeClassificationAttribute()
{
  QgsDebugMsg( "called." );
  QString attributeName = mClassificationComboBox->currentText();

  if ( !mOldClassificationAttribute.isEmpty() &&
       attributeName != mOldClassificationAttribute &&
       QMessageBox::question( this,
                              tr( "Confirm Delete" ),
                              tr( "The classification field was changed from '%1' to '%2'.\n"
                                  "Should the existing classes be deleted before classification?" )
                              .arg( mOldClassificationAttribute ).arg( attributeName ),
                              QMessageBox::Yes | QMessageBox::No ) == QMessageBox::Yes )
  {
    mClassListWidget->clearSelection();
    deleteSelectedClasses();
  }
  mOldClassificationAttribute = attributeName;

  if ( mVectorLayer )
  {
    int nr = mClassificationComboBox->itemData( mClassificationComboBox->currentIndex() ).toInt();
    if ( nr == -1 )
    {
      return;
    }

    QList<QVariant> values;
    mVectorLayer->uniqueValues( nr, values );

    for ( int i = 0; i < values.size(); i++ )
    {
      if ( !mValues.contains( values[i].toString() ) )
        addClass( values[i].toString() );
    }

    if ( !mValues.contains( QString::null ) )
      addClass( QString::null );
  }
}
MapBrowserFactory::MapBrowserFactory(QObject* parent, const QVariantList& args)
  : KexiDBFactoryBase(parent, "mapbrowser")
{
    Q_UNUSED(args);
    KFormDesigner::WidgetInfo *mapBrowser = new KFormDesigner::WidgetInfo(this);
    mapBrowser->setIconName(koIconName("map_browser"));
    mapBrowser->setClassName("MapBrowserWidget");
    mapBrowser->setName(i18n("Map Browser"));
    mapBrowser->setNamePrefix(i18nc("This string will be used to name widgets of this class. It must _not_ contain white "
                                     "spaces and non latin1 characters.", "mapBrowser"));
    mapBrowser->setDescription(i18n("Displays an interactive map."));
    addClass(mapBrowser);
}
示例#27
0
/**
 * Indicates whether the class exists by loading
 * the class into memory if necessary
 */
Class* ClassLoader::resolveClass( const char *classname ) {
	// locate the class
	Class* theClass = findClass( classname );

	if( theClass != NULL ) {
		// if the class was found, and it to the cache
		if( !classes.count( classname )  ) {
			addClass( theClass );
		}
	}

	// return the class
	return theClass;
}
示例#28
0
void MainWindow::setupClassViewer()
{
    tbtnAdd_class->setAction(actionAdd_class, true);
    tbtnAdd_class->setText(tr("Add"));
    tbtnAdd_class->setIconSize(QSize(16, 16));
    tbtnDelete_class->setAction(actionDelete_class, true);
    tbtnDelete_class->setText(tr("Delete"));
    tbtnDelete_class->setIconSize(QSize(16, 16));
    tbtnAdd_student->setAction(actionAdd_student, true);
    tbtnAdd_student->setText(tr("Add"));
    tbtnAdd_student->setIconSize(QSize(16, 16));
    tbtnDelete_student->setAction(actionDelete_student, true);
    tbtnDelete_student->setText(tr("Delete"));
    tbtnDelete_student->setIconSize(QSize(16, 16));
    tbtnAdd_session->setAction(actionAdd_session, true);
    tbtnAdd_session->setText(tr("Add"));
    tbtnAdd_session->setIconSize(QSize(16, 16));
    tbtnDelete_session->setAction(actionDelete_session, true);
    tbtnDelete_session->setText(tr("Delete"));
    tbtnDelete_session->setIconSize(QSize(16, 16));
    QObject::connect(actionAdd_class, SIGNAL(triggered()), this, SLOT(addClass()));
    QObject::connect(actionDelete_class, SIGNAL(triggered()), this, SLOT(deleteClass()));
    QObject::connect(actionPrint_class_summary, SIGNAL(triggered()), this, SLOT(printClassSummary()));
    QObject::connect(actionAdd_student, SIGNAL(triggered()), this, SLOT(addStudent()));
    QObject::connect(actionDelete_student, SIGNAL(triggered()), this, SLOT(deleteStudent()));
    QObject::connect(actionAdd_session, SIGNAL(triggered()), this, SLOT(addSession()));
    QObject::connect(actionDelete_session, SIGNAL(triggered()), this, SLOT(deleteSession()));
    QObject::connect(CLSCFirstYearSpinBox, SIGNAL(valueChanged(int)), CLSCLastYearSpinBox, SLOT(setMinimum(int)));
    QObject::connect(CLLCListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(setCurrentClass(QListWidgetItem *)));
    QObject::connect(CLLSListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(setCurrentClassMember(QListWidgetItem *)));
    QObject::connect(CLLSSListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(viewSession(QListWidgetItem *)));
    QObject::connect(CLLSSListWidget, SIGNAL(currentIndexAvailabilityChanged(bool)), actionDelete_session, SLOT(setEnabled(bool)));
    QObject::connect(CLLSSListWidget, SIGNAL(currentTextChanged(QString)), this, SLOT(toggleAddSessionToMemberEnabled()));
    QObject::connect(CLSSResultsTableWidget, SIGNAL(currentIndexAvailabilityChanged(bool)), tbtnRemoveSession, SLOT(setEnabled(bool)));
    QObject::connect(CLSSResultsTableWidget, SIGNAL(itemDoubleClicked(QTableWidgetItem *)), this, SLOT(viewSessionAndStudent(QTableWidgetItem *)));
    QObject::connect(CLLCSearchLineEdit, SIGNAL(textChanged(QLineEdit *, const QString &)), CLLCListWidget, SLOT(filterItems(QLineEdit *, const QString &)));
    QObject::connect(CLLSSearchLineEdit, SIGNAL(textChanged(QLineEdit *, const QString &)), CLLSListWidget, SLOT(filterItems(QLineEdit *, const QString &)));
    QObject::connect(CLLSSSearchLineEdit, SIGNAL(textChanged(QLineEdit *, const QString &)), CLLSSListWidget, SLOT(filterItems(QLineEdit *, const QString &)));
    QObject::connect(tbtnApplyClassChanges, SIGNAL(released()), this, SLOT(updateClassProperties()));
    QObject::connect(tbtnSaveMemberName, SIGNAL(released()), this, SLOT(updateClassMemberName()));
    QObject::connect(tbtnAddSession, SIGNAL(released()), this, SLOT(addSessionToMember()));
    QObject::connect(tbtnRemoveSession, SIGNAL(released()), this, SLOT(removeSessionFromMember()));
    CLLCListWidget->setSortingEnabled(true);
    CLLSSListWidget->setSortingEnabled(true);
    CLSSResultsTableWidget->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
    CLSSResultsTableWidget->verticalHeader()->hide();
    CLSSResultsTableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers);
    setCLSCEnabled(false);
}
示例#29
0
TEST_F(MgrTest, object_alloc_basic) {
    CPE_HS_DEF_VAR(className, "class1");
    addClass("class1", 20);

    gd_om_oid_t oid = obj_alloc(className);
    EXPECT_TRUE(oid != GD_OM_INVALID_OID);

    void * objData = gd_om_obj_get(m_omm, oid, t_em());
    ASSERT_TRUE(objData);

    gd_om_class_t cls = gd_om_obj_class(m_omm, oid, t_em());
    ASSERT_TRUE(cls);

    EXPECT_STREQ("class1", gd_om_class_name(cls));
}
示例#30
0
void import_element_class( CSeqEle& ele, std::list<std::string>& classes )
{
     std::string Type = VarType2As( ele.eleType );

    if ( Type == "Number" || Type == "String" || Type == "ByteArray" )
        return;

    if ( Type == "int" || Type == "uint" )
        return;

    if ( Type == "Vector" || Type == "Object" )
        import_element_class( *ele.eleObject.begin(), classes );
    else //object
        addClass( Type, classes );
}