Пример #1
0
void MainWindow::accountItemActivated(const QModelIndex & index)
{
    if (index.model() != m_accountTreeModel
            && index.model() != m_accountListModel)
    {
        qDebug() << "Wrong model; row=" << (index.isValid()? index.row() : -1);
        return;
    }
    Glib::RefPtr<Account> account = Glib::wrap(static_cast< ::Account*>(index.internalPointer()));
    if (!account)
    {
        qDebug() << "Account is null; why?";
        return;
    }

    // We create a new model for this account which will query it for
    // its splits, and also a view widget for this list.
    QTableView *tableView =
        new SplitListView(account, m_undoStack, ui->tabWidget);
    ui->actionCut->setEnabled(tableView->model()->rowCount() > 0);

    // Insert this as a new tab
    tableView->setProperty(PROPERTY_TAB_PREVIOUSPOS, ui->tabWidget->currentIndex());
    ui->tabWidget->addTab(tableView, g2q(account->get_name()));
    ui->tabWidget->setCurrentWidget(tableView);

    connect(tableView->selectionModel(), SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)),
            this, SLOT(selectionChanged(const QItemSelection &, const QItemSelection & )));
}
q3BodyDef BulletModel::GetBodyDef(){
	q3BodyDef body = Lib3dsModel::GetBodyDef();

	body.angularVelocity = g2q(25.0f * mDirection);

	return body;
}