Пример #1
0
void Schema::resetViewsVertically2()
{
    populateSchemaViews();
    QList<View*> view_list = getViewList();
    foreach(View *view, view_list) {
        if(mainwin->getSearchBox()->isVisible())
            view->getSearchTerm(mainwin->getSearchBox()->text());
        view->verticalPosition2();
    }
    scene()->setSceneRect(QRectF());
}
Пример #2
0
Schema::Schema(MainWin *mainwin, Database *database, QString schema_name, int schema_index, uint number_of_schemas)
{
    this->mainwin = mainwin;
    this->schema_index = schema_index;
    int a_radius = A_RADIUS;
    int b_radius = B_RADIUS;
    qreal dtheta = -2*M_PI*schema_index/number_of_schemas - M_PI_2;
    setParent(database);
    setParentItem(database);
    if(mainwin->isColumnView()) {
        if(parent_database->getSchemaCount()%2 == 0)
            setPos((a_radius/2)*(schema_index) + a_radius/2/2 -(parent_database->getSchemaCount()*a_radius/2/2), b_radius/2);
        else
            setPos((a_radius/2)*(schema_index)-(parent_database->getSchemaCount()*a_radius/2/2), b_radius/2);
    }
    else
        setPos(a_radius*sin(dtheta), b_radius*cos(dtheta));

    setName(schema_name);
    setStatus(false);
    setSchemaCollapsed(true);

    setFlag(ItemIsSelectable);
    //setFlag(ItemSendsGeometryChanges);

    setToolTip(this->getName());
    setCacheMode(DeviceCoordinateCache);
    setZValue(-1);
    /*if(mainwin->isColumnView()) {
        populateSchemaTablesColumnwise();
        populateSchemaFunctionsColumnwise();
    }
    else {
        populateSchemaTables();
        populateSchemaFunctions();
    }*/
    populateSchemaTables();
    populateSchemaViews();
    populateSchemaFunctions();
}