本文整理汇总了C++中QTextStream::setFieldAlignment方法的典型用法代码示例。如果您正苦于以下问题:C++ QTextStream::setFieldAlignment方法的具体用法?C++ QTextStream::setFieldAlignment怎么用?C++ QTextStream::setFieldAlignment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTextStream
的用法示例。
在下文中一共展示了QTextStream::setFieldAlignment方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: startComment
void ConsoleOutput::startComment(QTextStream &out,AnsiColor color){
out.setFieldWidth(indent);
out.setFieldAlignment(QTextStream::AlignRight);
out << " ";
out.setFieldWidth(0);
#ifndef _WIN32
out << "\033[0;" << color << "m";
#endif
out.setFieldAlignment(QTextStream::AlignLeft);
out.setFieldWidth(20);
out.setPadChar(' ');
}
示例2: aboutLicense
void MainWindow::aboutLicense() {
QDialog *dialog = new QDialog( this );
QFile file( ":/GPL" );
if(!file.open( QIODevice::ReadOnly | QIODevice::Text ))
qCritical( "GPL LicenseFile not found" );
QTextStream out ( &file );
out.setFieldAlignment ( QTextStream::AlignCenter );
QTextEdit *qteLicense = new QTextEdit ( dialog );
qteLicense->setText ( out.readAll ());
qteLicense->setReadOnly ( 1 );
QPushButton *qpbClose = new QPushButton ( IconLoader::Load( "window-close" ), tr( "&Close" ), dialog );
connect( qpbClose, SIGNAL( clicked()), dialog, SLOT( deleteLater()));
qglDialog = new QGridLayout( dialog );
qglDialog->addWidget( qteLicense, 0, 0 );
qglDialog->addWidget( qpbClose, 1, 0, Qt::AlignRight );
dialog->setLayout( qglDialog);
dialog->setWindowTitle( "GNU General Public License" );
dialog->setFixedSize( 550, 400 );
dialog->exec();
}
示例3: printOptions
static void printOptions(QTextStream& s, const QMap<QString, QString>& options) {
QMap<QString, QString>::const_iterator it = options.constBegin();
s.setFieldAlignment(QTextStream::AlignLeft);
for (; it != options.constEnd(); ++it) {
s << " --";
s.setFieldWidth(38);
s << it.key() << it.value();
s.setFieldWidth(0);
s << endl;
}
}
示例4: WriteData
// Write data + helpers
void FormattedTouchstone::WriteData(FormattedNetworkData &network, QTextStream &snpFile) {
// Choose data format
GetWriteFormat(network);
snpFile.setRealNumberPrecision(PRECISION);
for (uint currentFreq = 0; currentFreq < network.points(); currentFreq++) {
snpFile.setFieldAlignment(QTextStream::AlignLeft);
snpFile.setFieldWidth(COLUMNWIDTH);
snpFile << network.x()[currentFreq];
FormattedComplexMatrix2D::iterator row_iter = network.y()[currentFreq].begin();
WriteRow(network, snpFile, *row_iter);
row_iter++;
for (; row_iter != network.y()[currentFreq].end(); row_iter++) {
snpFile.setFieldAlignment(QTextStream::AlignLeft);
snpFile.setFieldWidth(COLUMNWIDTH);
snpFile << " "; // tab past frequency column for subsequent rows
WriteRow(network, snpFile, *row_iter);
}
}
}
示例5: sideviewDump
void QWSHexDump::sideviewDump(int at)
{
if (dirty) {
dirty = false;
++at;
sideview[at] = '\0';
int currentWidth = (2 * at) + (at / clustering) - (at%clustering?0:1);
int missing = qMax(dataWidth - currentWidth, 0);
while (missing--)
*outstrm << ' ';
*outstrm << " [";
outstrm->setPadChar(' ');
outstrm->setFieldWidth(wrap);
outstrm->setFieldAlignment( QTextStream::AlignLeft );
*outstrm << sideview;
*outstrm << ']';
}
}
示例6: WriteRow
void FormattedTouchstone::WriteRow(FormattedNetworkData &network, QTextStream &snpFile, FormattedComplexRowVector &row) {
uint columnsWritten = 1;
uint const COLUMNSPERLINE = 4;
FormattedComplexRowVector::iterator column_iter = row.begin();
for (; column_iter != row.end(); column_iter++) {
(*WriteDatum)(snpFile, *column_iter);
// add delimiter
if (columnsWritten == network.numberOfPorts()) {
snpFile.setFieldWidth(0);
snpFile << endl;
snpFile.setFieldWidth(COLUMNWIDTH);
}
else if (columnsWritten % COLUMNSPERLINE == 0) {
snpFile.setFieldWidth(0);
snpFile << endl;
snpFile.setFieldAlignment(QTextStream::AlignLeft);
snpFile.setFieldWidth(COLUMNWIDTH);
snpFile << " ";
}
columnsWritten++;
}
}
示例7: WriteDB
void FormattedTouchstone::WriteDB(QTextStream &snpFile, FormattedComplex &datum) {
snpFile.setFieldAlignment(QTextStream::AlignLeft);
snpFile.setFieldWidth(COLUMNWIDTH);
snpFile << datum.dB();
snpFile << datum.angle_deg();
}
示例8: WriteRI
void FormattedTouchstone::WriteRI(QTextStream &snpFile, FormattedComplex &datum) {
snpFile.setFieldAlignment(QTextStream::AlignLeft);
snpFile.setFieldWidth(COLUMNWIDTH);
snpFile << datum.real();
snpFile << datum.imaginary();
}