void FilterTableHeader::updateGeometries()
{
    // If there are any input widgets add a viewport margin to the header to generate some empty space for them which is not affected by scrolling
    if(filterWidgets.size())
        setViewportMargins(0, 0, 0, filterWidgets.at(0)->sizeHint().height());
    else
        setViewportMargins(0, 0, 0, 0);

    // Now just call the parent implementation and reposition the input widgets
    QHeaderView::updateGeometries();
    adjustPositions();
}
void FilterTableHeader::generateFilters(int number)
{
    // Delete all the current filter widgets
    for(int i=0;i < filterWidgets.size(); ++i)
        delete filterWidgets.at(i);
    filterWidgets.clear();

    // And generate a bunch of new ones
    for(int i=0;i < number; ++i)
    {
        QLineEdit* l = new QLineEdit(this);
        l->setPlaceholderText(tr("Filter"));
        l->setProperty("column", i);            // Store the column number for later use
        l->setVisible(i>0);                     // This hides the first input widget which belongs to the hidden rowid column
        connect(l, SIGNAL(textChanged(QString)), this, SLOT(inputChanged(QString)));
        filterWidgets.push_back(l);
    }

    // Position them correctly
    adjustPositions();
}
void FilterTableHeader::generateFilters(int number, bool showFirst)
{
    // Delete all the current filter widgets
    for(int i=0;i < filterWidgets.size(); ++i)
        delete filterWidgets.at(i);
    filterWidgets.clear();

    // And generate a bunch of new ones
    for(int i=0;i < number; ++i)
    {
        FilterLineEdit* l = new FilterLineEdit(this, &filterWidgets, i);
        if(!showFirst && i == 0)        // This hides the first input widget which belongs to the hidden rowid column
            l->setVisible(false);
        else
            l->setVisible(true);
        connect(l, SIGNAL(delayedTextChanged(QString)), this, SLOT(inputChanged(QString)));
        filterWidgets.push_back(l);
    }

    // Position them correctly
    adjustPositions();
}
示例#4
0
SpecialMatrix::MatrixViewer::MatrixViewer( Data::Graph* matrixGraph, QString fileName )
{
	this->matrixGraph = matrixGraph;
	this->connections = new SpecialMatrix::NodeConnections();

	fileParser = new SpecialMatrix::FileParser( fileName, matrixGraph, connections );

	createAxis();
	connections->setNodePositionsArrayField( 0, 0, true );

	adjustPositions();

	//printout nodePositionsArray
	/*for(size_t i=0; i<connections->getNodePositionsArray().size(); i++) {
		for(size_t j=0; j<connections->getNodePositionsArray().size(); j++) {
			if(connections->getNodePositionsArrayField(i, j))
				printf("1");
			else
				printf("0");
		}
		printf("\n");
	}*/

	//printout connectedNodes
	/*QMapIterator<qlonglong, QList<qlonglong>* > i(*connections->getConnectedNodes());

	while ( i.hasNext() ) {
		i.next();
		QList<qlonglong>* list = i.value();
		qDebug() << i.key() << "size: " << list->size() << " list has these connected nodes: ";

		for(int j=0; j<list->size(); j++) {
			qDebug() << list->at(j);
		}
	}*/

}