?? form1.ui.h
字號:
/****************************************************************************
** ui.h extension file, included from the uic-generated form implementation.
**
** If you want to add, delete, or rename functions or slots, use
** Qt Designer to update this file, preserving your code.
**
** You should not define a constructor or destructor in this file.
** Instead, write your code in functions called init() and destroy().
** These will automatically be called by the form's constructor and
** destructor.
*****************************************************************************/
#include <qfiledialog.h>
#include "qpainter.h"
void Form1::fileOpen()
{
Q_INT16 tp;
QString sr;
QString ssr;
QString fileName = QFileDialog::getOpenFileName(
QString::null, tr("SEGY (*.sgy);;TXT (*.txt);;(*.*)"),
this, tr("Data File") );
FName=fileName;
QFile file( fileName );
file.open( IO_ReadWrite ) ;
QDataStream stream( &file );
stream.setByteOrder( QDataStream::BigEndian );
QIODevice::Offset offsets;
offsets=3600;
while(offsets!=3600+(1500*4+240)*3)
{
offsets+=2;
file.at(offsets);
stream>>tp;
ssr+=sr.setNum(tp)+' ';
}
textEdit1->setText(ssr);
/* QString fileName=QFileDialog::getOpenFileName(NULL,"(*.SGY *.sey *.jpg *.BMP)", this, NULL, NULL );
if( fileName == QString::null ) return;
QImage img;
img.load(fileName,0);
QPixmap pix(img);
QPainter painter(this);
painter.drawPixmap(100,100,pix);*/
}
void Form1::editshow()
{
Q_INT16 ts ;
QString sr;
QFile file( FName );
file.open( IO_ReadWrite ) ;
QDataStream stream( &file );
QIODevice::Offset offsets;
offsets=lineEdit1->text().toInt();
file.at(offsets);
stream>>ts;
lineEdit2->setText(sr.setNum(ts));
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -