资源简介
这是一个小的QT界面设计程序,作用设计QT的tab qwidget的参考,仅作为入门学习QT用。
代码片段和文件信息
/********************************************************************************
** Video.h
**
** Created: Jun 5 2009
** by: XQR_CF
**
**Hangzhou Haige Communication Technology CO..LTD
** WARNING! All rights reserved
********************************************************************************/
#include
#include
#include “Video.h“
IVIDENC_Params g_Stu_VP;
void Ui_VideoPara::Read_Vaule()
{
int FD = 0;
int len = 0;
if((FD = open(VP_PARAO_NONBLOCK|O_RDWR|O_SYNC)) < 0)
{
printf(“open VP_PARA error\n“);
perror(“open VP_PARA\n“);
exit(0);
}
else
{
if((len = read(FD&g_Stu_VPsizeof(IVIDENC_Params))) < 0)
{
printf(“read VP_PARA error\n“);
perror(“read VP_PARA\n“);
exit(0);
}
else if(0 == len)
{
printf(“VP_PARA no parameters\n“);
}
else
{
printf(“ uint_a = %d\nuint_b = %d\nuint_c = %d\nuint_d = %d\nchar_e = %c\nchar_f = %c \nuint_g = %d\n“\
g_Stu_VP.uint_ag_Stu_VP.uint_bg_Stu_VP.uint_cg_Stu_VP.uint_d\
g_Stu_VP.char_eg_Stu_VP.char_fg_Stu_VP.uint_g);
}
close(FD);
}
}
void Ui_VideoPara::Save_Vaule()
{
int FD = 0;
if((FD = open(VP_PARAO_NONBLOCK|O_RDWR|O_SYNC)) < 0)
{
printf(“open VP_PARA error\n“);
perror(“open VP_PARA\n“);
exit(0);
}
else
{
if(lseek(FD0SEEK_SET) < 0)
{
printf(“seek VP_PARA error\n“);
perror(“seek VP_PARA\n“);
exit(0);
}
g_Stu_VP.uint_a = 10;
g_Stu_VP.uint_c = 101;
g_Stu_VP.uint_g = 100;
g_Stu_VP.char_e = ‘e‘;
g_Stu_VP.char_f = ‘d‘;
if(sizeof(IVIDENC_Params) != write(FD&g_Stu_VPsizeof(IVIDENC_Params)))
{
printf(“write VP_PARA error\n“);
perror(“write VP_PARA\n“);
exit(0);
}
else
{
}
close(FD);
}
}
void Ui_VideoPara::ProcessChange(int index)
{
if(0 == index)
{
lineEdit_3->setEnabled(false);
}
else
{
lineEdit_3->setEnabled(true);
}
}
void Ui_VideoPara::SetDefault()
{
lineEdit_1->setText(QString::fromUtf8(“30“));
lineEdit_2->setText(QString::fromUtf8(“60“));
lineEdit_3->setText(QString::fromUtf8(“500“));
comboBox->setCurrentIndex(1);
lineEdit_3->setEnabled(true);
//printf(“value = %d\n“lineEdit_1->text().toInt(&ok10));
//printf(“value = %d\n“lineEdit_2->text().toInt(&ok10));
//printf(“value = %d\n“lineEdit_3->text().toInt(&ok10));
Save_Vaule();
}
void Ui_VideoPara::SetValue()
{
bool ok = false;
int value=0temp=0;
bool changed = false ;
if(lineEdit_1->text().isEmpty())
{
printf(“lineEdit_1 if empty \n “);
return ;
}
while(false == ok)
{
value =lineEdit_1->text().toInt(&ok10);
//printf(“lineEdit_1 value = %d\n“value);
}
temp = value;
Check_valid(151temp);
if(temp != value)
{
changed = true;
lineEdit_1->setText(QString::number(temp));
}
if(lineEdit_2->text().isEmpty())
{
printf(“lineEdit_2 if empty \n “);
return ;
}
ok = false;
while(false == ok)
{
value =lineEdit_2->text().toInt(&ok10);
//printf(“lineEdit_2 value = %d\n“value);
}
temp = value;
Check_valid(1999temp);
if(temp
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3607 2009-06-18 11:12 Video\Function.cpp
文件 559 2009-06-22 17:58 Video\Main.cpp
文件 207 2009-06-18 11:09 Video\para.h
文件 7901 2009-06-22 17:54 Video\Video.h
目录 0 2009-06-22 17:58 Video
----------- --------- ---------- ----- ----
12274 5
- 上一篇:MD5算法C代码……
- 下一篇:基于atmega16单片机的时钟
评论
共有 条评论