本文整理汇总了C++中QTextEdit::hide方法的典型用法代码示例。如果您正苦于以下问题:C++ QTextEdit::hide方法的具体用法?C++ QTextEdit::hide怎么用?C++ QTextEdit::hide使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTextEdit
的用法示例。
在下文中一共展示了QTextEdit::hide方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: file
void
CSAVE_WORKSHEET::
saveWorksheet(QTabWidget * tabWidget)
{
QTextEdit * textEdit = new QTextEdit();
QString fileName = QFileDialog::getSaveFileName(this,tr("Save PM Worksheet"), "",tr("PM Worksheet (*.pmw);;All Files (*)"));
textEdit->clear();
textEdit->hide();
if (fileName.isEmpty())
return;
else
{
QFile file(fileName);
QTextStream out(&file);
if (!file.open(QIODevice::WriteOnly))
{
QMessageBox::information(this, tr("Unable to open file"),file.errorString());
return;
}
for ( int i = 0; i < tabWidget->count(); i++ )
{
tabWidget->setCurrentIndex(i); // set to Master PM
QTableWidget *table = dynamic_cast<QTableWidget *>(tabWidget->currentWidget()); // get control
QString itemData;
textEdit->append("[ SECTION ] "+tabWidget->tabText(i));
for ( int j = 0; j < table->rowCount(); j++ )
{
for ( int k = 0; k < 12; k++ )
{
itemData.append(table->item(j,k)->text()+" | ");
}
textEdit->append(itemData.trimmed());
itemData.clear();
}
out << textEdit->toPlainText() << endl;
textEdit->clear();
}
}
tabWidget->setCurrentIndex(2);
QMessageBox::information(this, "Information", "\n Saved worksheet successfully.", QMessageBox::Ok);
}
示例2: QTextEdit
void
CSAVE_WORKSHEET::
updateMasterPm( QTabWidget * tabWidget)
{
QTextEdit * textEdit = new QTextEdit();
textEdit->clear();
textEdit->hide();
tabWidget->hide();
// reset tab3 row count
tabWidget->setCurrentIndex(3);
QTableWidget * table3 = dynamic_cast<QTableWidget *>(tabWidget->currentWidget());
table3->setRowCount(0);
for ( int i = 0; i < tabWidget->count()-1; i++ )
{
tabWidget->setCurrentIndex(i);
QTableWidget *table = dynamic_cast<QTableWidget *>(tabWidget->currentWidget()); // get control
for ( int j = 0; j < table->rowCount(); j++ )
{
QString itemData;
for ( int k = 0; k < 12; k++ )
itemData.append(table->item(j,k)->text().trimmed().toLatin1()+" | ");
table3->insertRow(table3->rowCount());
for ( int col = 0; col < 12; col++ )
{
QTableWidgetItem * item = new QTableWidgetItem(itemData.split("|").at(col).trimmed());
if ( col == 0 )
item->setTextAlignment(Qt::AlignVCenter | Qt::AlignLeft);
else
item->setTextAlignment(Qt::AlignCenter);
item->setFlags(item->flags() & ~Qt::ItemIsEditable);
table3->setItem(table3->rowCount()-1,col,item);
}
}
}
tabWidget->show();
}
示例3: initUi
void PsiTipLabel::initUi()
{
margin = 1 + style()->pixelMetric(QStyle::PM_ToolTipLabelFrameWidth, 0, this);
setFrameStyle(QFrame::NoFrame);
// doc = new QTextDocument(this);
// QTextDocumentLayout is private in Qt4
// and it's impossible to set wrapping mode directly.
// So we create this QTextEdit instance and use its QTextDocument,
// just because QTextEdit can set the wrapping mode.
// Yes, this is crazy...
QTextEdit *edit = new QTextEdit(this);
edit->hide();
edit->setWordWrapMode(QTextOption::WordWrap);
doc = edit->document();
doc->setUndoRedoEnabled(false);
doc->setDefaultFont(font());
ensurePolished();
setText(theText_);
}