AddTestCasesWizard::AddTestCasesWizard(QWidget *parent) :
    QWizard(parent),
    ui(new Ui::AddTestCasesWizard)
{
    ui->setupUi(this);
    
    ui->fullScore->setValidator(new QIntValidator(1, Settings::upperBoundForFullScore(), this));
    ui->timeLimit->setValidator(new QIntValidator(1, Settings::upperBoundForTimeLimit(), this));
    ui->memoryLimit->setValidator(new QIntValidator(1, Settings::upperBoundForMemoryLimit(), this));
    
    connect(ui->fullScore, SIGNAL(textChanged(QString)),
            this, SLOT(fullScoreChanged(QString)));
    connect(ui->timeLimit, SIGNAL(textChanged(QString)),
            this, SLOT(timeLimitChanged(QString)));
    connect(ui->memoryLimit, SIGNAL(textChanged(QString)),
            this, SLOT(memoryLimitChanged(QString)));
    
    QHeaderView *header = ui->argumentList->horizontalHeader();
    for (int i = 0; i < 3; i ++) {
        header->resizeSection(i, header->sectionSizeHint(i));
    }
    
    connect(ui->inputFilesPattern, SIGNAL(textChanged(QString)),
            this, SLOT(inputFilesPatternChanged(QString)));
    connect(ui->outputFilesPattern, SIGNAL(textChanged(QString)),
            this, SLOT(outputFilesPatternChanged(QString)));
    connect(ui->addArgumentButton, SIGNAL(clicked()),
            this, SLOT(addArgument()));
    connect(ui->deleteArgumentButton, SIGNAL(clicked()),
            this, SLOT(deleteArgument()));
}
Exemplo n.º 2
0
void AccountsTreeView::slotModelReset()
{
    hideColumns( m_leftview, QList<int>() << 3 << -1 );
    QHeaderView *v = m_leftview->header();
    kDebug(planDbg())<<v->sectionSize(2)<<v->sectionSizeHint(2)<<v->defaultSectionSize()<<v->minimumSectionSize();

    hideColumns( m_rightview, QList<int>() << 0 << 1 << 2 );
}
void UIHostNetworkManagerWidget::sltAdjustTreeWidget()
{
    /* Get the tree-widget abstract interface: */
    QAbstractItemView *pItemView = m_pTreeWidget;
    /* Get the tree-widget header-view: */
    QHeaderView *pItemHeader = m_pTreeWidget->header();

    /* Calculate the total tree-widget width: */
    const int iTotal = m_pTreeWidget->viewport()->width();
    /* Look for a minimum width hints for non-important columns: */
    const int iMinWidth1 = qMax(pItemView->sizeHintForColumn(Column_IPv4), pItemHeader->sectionSizeHint(Column_IPv4));
    const int iMinWidth2 = qMax(pItemView->sizeHintForColumn(Column_IPv6), pItemHeader->sectionSizeHint(Column_IPv6));
    const int iMinWidth3 = qMax(pItemView->sizeHintForColumn(Column_DHCP), pItemHeader->sectionSizeHint(Column_DHCP));
    /* Propose suitable width hints for non-important columns: */
    const int iWidth1 = iMinWidth1 < iTotal / Column_Max ? iMinWidth1 : iTotal / Column_Max;
    const int iWidth2 = iMinWidth2 < iTotal / Column_Max ? iMinWidth2 : iTotal / Column_Max;
    const int iWidth3 = iMinWidth3 < iTotal / Column_Max ? iMinWidth3 : iTotal / Column_Max;
    /* Apply the proposal: */
    m_pTreeWidget->setColumnWidth(Column_IPv4, iWidth1);
    m_pTreeWidget->setColumnWidth(Column_IPv6, iWidth2);
    m_pTreeWidget->setColumnWidth(Column_DHCP, iWidth3);
    m_pTreeWidget->setColumnWidth(Column_Name, iTotal - iWidth1 - iWidth2 - iWidth3);
}
Exemplo n.º 4
0
void ByteTableView::resizeColumnsWidth()
{
    QHeaderView* header = mByteTableView->header();
    for (int i = 0; i < ByteTableModel::NoOfIds; ++i) 
    {
        if ( i == ByteTableModel::CharacterId )
        {
            mByteTableView->resizeColumnToContents( i );
            continue;
        }
        //since all indexes in one row have same number of chars it is enough to calculate one row 
        //this speeds up calculating the width from 800ms to 100ms
        const QModelIndex index = mTool->byteTableModel()->index( 0, i );
        const int indexWidthHint = mByteTableView->sizeHintForIndex( index ).width();
        const int headerWidthHint = header->sectionSizeHint( i );
        header->resizeSection(i, qMax( indexWidthHint, headerWidthHint) );
    }
}
Exemplo n.º 5
0
int HeaderView::sectionSizeHint(lua_State * L) // ( int logicalIndex ) const : int
{	
    QHeaderView* obj = QtObject<QHeaderView>::check( L, 1);
	Util::push( L, obj->sectionSizeHint( Util::toInt( L, 2) ) );
	return 1;
}