资源简介
嵌入式qt4的电子阅读器-适合mini2440的开发板跑的
代码片段和文件信息
/****************************************************************************
** $Id: qt/centralwidget.cpp 3.3.1 edited May 27 2003 $
**
** Copyright ( C ) 1992-2000 Trolltech AS. All rights reserved.
**
** This file is part of an example program for Qt. This example
** program may be used distributed and modified without limitation.
**
*****************************************************************************/
#include “centralwidget.h“
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
ABCentralWidget::ABCentralWidget( QWidget *parent const char *name )
: QWidget( parent name )
{
mainGrid = new QGridLayout( this 2 1 5 5 );
setupTabWidget();
setupListView();
mainGrid->setRowStretch( 0 0 );
mainGrid->setRowStretch( 1 1 );
}
void ABCentralWidget::save( const QString &filename )
{
if ( !listView->firstChild() )
return;
QFile f( filename );
if ( !f.open( IO_WriteOnly ) )
return;
QTextStream t( &f );
QListViewItemIterator it( listView );
for ( ; it.current(); ++it )
for ( unsigned int i = 0; i < 4; i++ )
t << it.current()->text( i ) << “\n“;
f.close();
}
void ABCentralWidget::load( const QString &filename )
{
listView->clear();
QFile f( filename );
if ( !f.open( IO_ReadOnly ) )
return;
QTextStream t( &f );
while ( !t.atEnd() ) {
QListViewItem *item = new QListViewItem( listView );
for ( unsigned int i = 0; i < 4; i++ )
item->setText( i t.readLine() );
}
f.close();
}
void ABCentralWidget::setupTabWidget()
{
tabWidget = new QTabWidget( this );
QWidget *input = new QWidget( tabWidget );
QGridLayout *grid1 = new QGridLayout( input 2 5 5 5 );
QLabel *liFirstName = new QLabel( “First &Name“ input );
liFirstName->resize( liFirstName->sizeHint() );
grid1->addWidget( liFirstName 0 0 );
QLabel *liLastName = new QLabel( “&Last Name“ input );
liLastName->resize( liLastName->sizeHint() );
grid1->addWidget( liLastName 0 1 );
QLabel *liAddress = new QLabel( “Add&ress“ input );
liAddress->resize( liAddress->sizeHint() );
grid1->addWidget( liAddress 0 2 );
QLabel *liEMail = new QLabel( “&E-Mail“ input );
liEMail->resize( liEMail->sizeHint() );
grid1->addWidget( liEMail 0 3 );
add = new QPushButton( “A&dd“ input );
add->resize( add->sizeHint() );
grid1->addWidget( add 0 4 );
connect( add SIGNAL( clicked() ) this SLOT( addEntry() ) );
iFirstName = new QLineEdit( input );
iFirstName->resize( iFirstName->sizeHint() );
grid1->addWidget( iFirstName 1 0 );
liFirstName->setBud
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 696 2005-01-03 00:09 eboot\addressbook\addressbook.doc
文件 6488 2005-01-03 00:10 eboot\addressbook\addressbook.dsp
文件 371 2013-11-10 19:00 eboot\addressbook\addressbook.pro
文件 8015 2013-11-11 12:11 eboot\addressbook\addressbook.pro.user
文件 10264 2005-01-03 00:09 eboot\addressbook\centralwidget.cpp
文件 1549 2005-01-03 00:09 eboot\addressbook\centralwidget.h
文件 438 2005-01-03 00:09 eboot\addressbook\fileopen.xpm
文件 476 2005-01-03 00:09 eboot\addressbook\fileprint.xpm
文件 415 2005-01-03 00:09 eboot\addressbook\filesave.xpm
文件 840 2005-01-03 00:09 eboot\addressbook\main.cpp
文件 2772 2005-01-03 00:09 eboot\addressbook\mainwindow.cpp
文件 1088 2005-01-03 00:09 eboot\addressbook\mainwindow.h
文件 8803 2013-11-10 19:15 eboot\addressbook\Makefile
文件 4334 2005-01-03 00:16 eboot\addressbook\mm\moc\release_mt_shared\moc_centralwidget.cpp
文件 3579 2005-01-03 00:16 eboot\addressbook\mm\moc\release_mt_shared\moc_mainwindow.cpp
文件 70325 2005-01-03 00:16 eboot\addressbook\mm\obj\release_mt_shared\centralwidget.obj
文件 4500 2005-01-03 00:16 eboot\addressbook\mm\obj\release_mt_shared\main.obj
文件 28871 2005-01-03 00:16 eboot\addressbook\mm\obj\release_mt_shared\mainwindow.obj
文件 13984 2005-01-03 00:16 eboot\addressbook\mm\obj\release_mt_shared\moc_centralwidget.obj
文件 11731 2005-01-03 00:16 eboot\addressbook\mm\obj\release_mt_shared\moc_mainwindow.obj
文件 9547 2013-11-11 12:11 eboot\addressbook-build-desktop\Makefile
文件 280765 2011-06-01 10:35 eboot\ebook\1.jpg
文件 23431 2013-11-23 23:37 eboot\ebook\2.jpg
文件 52 2013-11-10 21:19 eboot\ebook\bj.qrc
文件 41166 2013-11-11 12:36 eboot\ebook\ebook
文件 5672 2013-11-11 09:53 eboot\ebook\ebook.cc
文件 805 2011-10-27 14:58 eboot\ebook\ebook.h
文件 16708 2013-11-11 12:35 eboot\ebook\ebook.o
文件 338 2013-11-10 21:18 eboot\ebook\ebook.pro
文件 10760 2013-11-11 19:54 eboot\ebook\ebook.pro.user
............此处省略34个文件信息
- 上一篇:UE4拾取物品
- 下一篇:DroidSansFallback中文字库
评论
共有 条评论