コード例 #1
0
ProcessorInputPortWidget::ProcessorInputPortWidget(const FilterGroupPort &info, bool renameAllowed, QWidget *parent)
    : FilterPortWidget(info.parentId, info.port, parent)
{
    setNewName(info.name);
    mPortInfo = info;
    setStyleSheet("background-color: #f0a0a0;");
    mRenameAllowed = renameAllowed;
    connect(this, SIGNAL(rename(PortId, QString)), &OlvisSingleton::instance(), SLOT(renameInput(PortId, QString)));
}
コード例 #2
0
FilterPortWidget::FilterPortWidget(int filterId, const PortInfo& info, QWidget *parent) :
    QFrame(parent),
    ui(new Ui::FilterPortWidget()),
    mFilterId(filterId),
    mInfo(info)
{
    QString a = info.desc;

    ui->setupUi(this);
    ui->text->setToolTip(info.desc);
    setNewName(info.name);
    if(!info.icon.isNull())
        ui->icon->setPixmap(QPixmap::fromImage(info.icon).scaled(16,16, Qt::KeepAspectRatio));
    ui->icon->setToolTip(info.typeName);
    setFrameShadow(QFrame::Sunken);
    setFrameShape(QFrame::Box);
    setFixedSize(120,18);
}
コード例 #3
0
ファイル: setNewName_call.c プロジェクト: dwinner/CppAppdev
int main()
{
    FILE *fpData = NULL;
    Record_t record;
    int i;

    if( (fpData = fopen( dataFile, "r+b")) == NULL)
    {
        fprintf( stderr, "Error on opening the file \"%s\".\n", dataFile);
        return 1;
    }
    for( i = 0; i < TAB_LEN; ++i)
    {
        indexTab[i].pos = ftell(fpData);          // current file position.
        if( fread( &record, sizeof(Record_t), 1, fpData) < 1)
            break;
        indexTab[i].key = record.key;
//        printf("%4ld : %ld\n", indexTab[i].key, indexTab[i].pos);
    }
    if( !feof( fpData))
    {
        fprintf( stderr, "Error on reading the file \"%s\".\n", dataFile);
        return 2;
    }
    indexLen = i;

    if( setNewName( fpData, 1825L, "John Quincy") == NULL)
       fprintf( stderr, "Error on updating the file \"%s\".\n", dataFile);

    // List the records:
    rewind( fpData);
    while( fread( &record, sizeof(Record_t), 1, fpData) == 1) 
    {
       printf("%8ld : %s\n", record.key, record.name);
    }

    fclose( fpData);
    return 0;
}