Example #1
0
QLayoutItem *BorderLayoutIterator::takeCurrent()
{
    BorderLayout::BorderLayoutStruct *b
	= idx < int( list->count() ) ? list->take(  idx  ) : 0;
    QLayoutItem *item =  b ? b->item : 0;
    delete b;
    return item;
}
Example #2
0
/*! Decrease the level of the contents hierarchy.
 *  This will end the current sublist.
 *  \sa incContentsDepth()
 */
void FTVHelp::decContentsDepth()
{
  //printf("decContentsDepth() indent=%d\n",m_indent);
  ASSERT(m_indent>0);
  if (m_indent>0)
  {
    m_indent--;
    QList<FTVNode> *nl = &m_indentNodes[m_indent];
    FTVNode *parent = nl->getLast();
    if (parent)
    {
      QList<FTVNode> *children = &m_indentNodes[m_indent+1];
      while (!children->isEmpty())
      {
        parent->children.append(children->take(0));
      }
    }
  }
}
Example #3
0
//====================================
// setTouchPanel
//------------------------------------
void SaXManipulateTouchscreens::setTouchPanel (const QString& group) {
	// .../
	//! set all panel data associated with the given group name to
	//! the current pointer data. The group name consists of the
	//! vendor and model name separated by a colon
	// ----
	if ( ! mCDBPanels ) {
		mCDBPanels = new SaXProcess ();
		mCDBPanels -> start (CDB_TOUCHERS);
	}
	QList< QDict<QString> > data;
	data = mCDBPanels -> getTablePointerCDB_DATA (
		group
	);
	if (data.isEmpty()) {
		excCDBRecordNotFound (group);
		qError (errorString(),EXC_CDBRECORDNOTFOUND);
		return;
	}
	// .../
	// move the data record to the correct position
	// refering to the section ID -> mPointer
	// ----
	QDict<QString>* record = data.take(0);
	for (int n=0;n < mPointer;n++) {
		data.append(new QDict<QString>());
	}
	data.append ( record );
	// .../
	// merge the toucher data into the current section
	// ----
	mImport -> merge ( data );
	// .../
	// set vendor and name tag
	// ----
	QStringList nameList = QStringList::split ( ":", group );
	setNamePair (
		nameList.first(),
		nameList.last()
	);
}
Example #4
0
//====================================
// setMouse
//------------------------------------
void SaXManipulateMice::setMouse ( const QString& group ) {
	// .../
	//! set all mouse data associated with the given group name to
	//! the current pointer data. The group name consists of the
	//! vendor and model name separated by a colon
	// ----
	if ( ! mCDBMice ) {
		mCDBMice = new SaXProcess ();
		mCDBMice -> start (CDB_POINTERS);
	}
	QList< QDict<QString> > data;
	data = mCDBMice -> getTablePointerCDB_DATA (
		group
	);
	// .../
	// move the data record to the correct position
	// refering to the section ID -> mPointer
	// ----
	QDict<QString>* record = data.take(0);
	for (int n=0;n < mPointer;n++) {
		data.append(new QDict<QString>());
	}
	data.append ( record );
	// .../
	// merge the data into the current section now
	// ----
	if (data.isEmpty()) {
		excCDBRecordNotFound (group);
		qError (errorString(),EXC_CDBRECORDNOTFOUND);
		return;
	}
	mImport -> merge ( data );
	// .../
	// set vendor and name tag
	// ----
	QStringList nameList = QStringList::split ( ":", group );
	mImport -> setItem ( "Vendor", nameList.first() );
	mImport -> setItem ( "Name"  , nameList.last()  );
}
Example #5
0
//====================================
// addPen
//------------------------------------
int SaXManipulateTablets::addPen (const QString& group) {
	// .../
	//! add a new Pen or Eraser associated with the given group name to
	//! the current pointer data. The group name consists of the
	//! vendor and model name separated by a colon. The contents of the
	//! data record will set the InputFashion type for this addon
	//! pointer device
	// ----
	if ( ! mCDBPens ) {
		mCDBPens = new SaXProcess ();
		mCDBPens -> start (CDB_PENS);
	}
	QList< QDict<QString> > data;
	data = mCDBPens -> getTablePointerCDB_DATA (
		group
	);
	if (data.isEmpty()) {
		excCDBRecordNotFound (group);
		qError (errorString(),EXC_CDBRECORDNOTFOUND);
		return -1;
	}
	// .../
	// set input fashion type for the selected pen
	// ----
	QDict<QString> penData = *data.at(0);
	QString* type = penData["TabletType"];
	if (! type) {
		excPointerFashionTypeFailed ("undefined");
		qError (errorString(),EXC_POINTERFASHIONTYPEFAILED);
		return -1;
	}
	if ((*type != "stylus") && (*type != "eraser")) {
		excPointerFashionTypeFailed (*type);
		qError (errorString(),EXC_POINTERFASHIONTYPEFAILED);
		return -1;
	}
	QString fashion (SAX_INPUT_PEN);
	if (*type == "eraser") {
		fashion = SAX_INPUT_ERASER;
	}
	// .../
	// create new input device for the pen and make
	// it the current pointer device
	// ----
	int newPen = mManipInputDevices->addInputDevice (fashion);
	if ( ! selectPointer (newPen)) {
		return -1;
	}
	// .../
	// move the data record to the correct position
	// refering to the section ID -> mPointer
	// ----
	QDict<QString>* record = data.take(0);
	for (int n=0;n < mPointer;n++) {
		data.append(new QDict<QString>());
	}
	data.append ( record );
	// .../
	// merge the pen data now into the current section
	// ----
	mImport -> merge ( data );
	// .../
	// set vendor and name tag
	// ----
	QStringList nameList = QStringList::split ( ":", group );
	mImport -> setItem ( "Vendor", nameList.first() );
	mImport -> setItem ( "Name"  , nameList.last()  );
	return newPen;
}