コード例 #1
0
PoleView::PoleView(): QMainWindow()
{
  storage = 0;
  
  view = new QListView( this );
  view->addColumn( tr("Name" ) );
  view->addColumn( tr("Size" ) );
  view->setColumnAlignment( 1, Qt::AlignRight );
  setCentralWidget( view );
  
  QPopupMenu * file = new QPopupMenu( this );
  menuBar()->insertItem( tr("&File"), file );
  file->insertItem( tr("&New Window"), this, SLOT(newWindow()), CTRL+Key_N );
  file->insertItem( tr("&Open..."), this, SLOT(choose()), CTRL+Key_O );
  file->insertItem( tr("&Close"), this, SLOT(closeFile()) );
  file->insertSeparator();
  file->insertItem( tr("&Quit"), qApp, SLOT( closeAllWindows() ), CTRL+Key_Q );

  QPopupMenu * streamMenu = new QPopupMenu( this );
  menuBar()->insertItem( tr("&Stream"), streamMenu );
  streamMenu->insertItem( tr("&Export..."), this, SLOT(exportStream() ), CTRL+Key_E );
  streamMenu->insertItem( tr("&View..."), this, SLOT(viewStream()) );
    
  QPopupMenu * help = new QPopupMenu( this );
  menuBar()->insertItem( tr("&Help"), help );
  help->insertItem( tr("&About"), this, SLOT(about()), Key_F1 );
  help->insertItem( tr("About &Qt"), this, SLOT(aboutQt()) );
  
  resize( 400, 300 );
  setCaption( tr("POLEView" ) );
  statusBar()->message( tr("Ready"), 5000 );
}
コード例 #2
0
ファイル: qtgpio.cpp プロジェクト: TWfromSWD/qtgpio
bool IoController::writeToGPIOFile( const QString file, QString outputData )
{
  QFile exportFile( file );

  if ( exportFile.open( QIODevice::WriteOnly ) )
  {
    QTextStream exportStream( &exportFile );

    exportStream << outputData;

    exportFile.close();

    return true;
   }

  //qDebug() << "Error writing " << file;

  return false;
}
コード例 #3
0
BOOL LLPermissions::exportFile(LLFILE* fp) const
{
	llofstream ofs(fp);
	return exportStream(ofs);
}