本文整理汇总了C++中TextEdit类的典型用法代码示例。如果您正苦于以下问题:C++ TextEdit类的具体用法?C++ TextEdit怎么用?C++ TextEdit使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TextEdit类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: add
/**
* Adds a new child surface for the state to take care of,
* giving it the game's display palette. Once associated,
* the state handles all of the surface's behaviour
* and management automatically.
* @param surface Child surface.
* @note Since visible elements can overlap one another,
* they have to be added in ascending Z-Order to be blitted
* correctly onto the screen.
*/
void State::add(Surface *surface)
{
// Set palette
surface->setPalette(_game->getScreen()->getPalette());
// Set default fonts
Text *t = dynamic_cast<Text*>(surface);
TextButton *tb = dynamic_cast<TextButton*>(surface);
TextEdit *te = dynamic_cast<TextEdit*>(surface);
TextList *tl = dynamic_cast<TextList*>(surface);
if (t)
{
t->setFonts(_game->getResourcePack()->getFont("BIGLETS.DAT"), _game->getResourcePack()->getFont("SMALLSET.DAT"));
}
else if (tb)
{
tb->setFonts(_game->getResourcePack()->getFont("BIGLETS.DAT"), _game->getResourcePack()->getFont("SMALLSET.DAT"));
}
else if (te)
{
te->setFonts(_game->getResourcePack()->getFont("BIGLETS.DAT"), _game->getResourcePack()->getFont("SMALLSET.DAT"));
}
else if (tl)
{
tl->setFonts(_game->getResourcePack()->getFont("BIGLETS.DAT"), _game->getResourcePack()->getFont("SMALLSET.DAT"));
}
_surfaces.push_back(surface);
}
示例2: QCOMPARE
void Test2Test::testCase10()
{
TextEdit txt;
bool p;
p=txt.textItalic();
QCOMPARE(true,p);
}
示例3: size
void ValueEdit::resizeEditor()
{
if ( edit )
{
QSize sz = size();
switch ( typ )
{
case NifValue::tSizedString:
case NifValue::tText:
{
TextEdit * te = (TextEdit *)edit;
te->move( QPoint( 0, 0 ) );
resize( size() );
te->CalcSize();
}
break;
default:
{
edit->move( QPoint( 0, 0 ) );
edit->resize( sz );
resize( sz );
}
break;
}
}
}
示例4: toTabWidgetFrame
void FrostEdit::pointToIssue(QListWidgetItem* item) {
IssueItem* issue = static_cast<IssueItem*>(item);
TabWidgetFrame* curTabFrameWidget = toTabWidgetFrame(mCurrentTabWidget->parentWidget());
TextEdit* edit = nullptr;
QString path;
QString open;
QFileInfo file(mCompiledFile);
if(file.exists() && file.isFile()) {
path = file.absolutePath();
QFileInfo finfo(path+"/"+issue->getFile());
if(finfo.isFile())
open = finfo.absolutePath();
else
open = issue->getFile();
} else {
open = mCompiledFile;
}
addEditor(curTabFrameWidget, open);
edit = toTextEdit(mCurrentTabWidget->currentWidget());
edit->setCursorPosition(issue->getRow()-1, issue->getColumn()-1);
edit->ensureCursorVisible();
edit->setFocus();
}
示例5: toTextEdit
void FrostEdit::widgetChanged(QWidget* old, QWidget* now) {
if(old == now)
return;
//Let's test was the last clicked widget A) TextEdit B) TabWidget C) TabBar
TextEdit* wid = toTextEdit(now);
TabWidget* tabwid = qobject_cast<TabWidget*>(now);
QTabBar* bar = qobject_cast<QTabBar*>(now) ;
//Was TabBar
if(bar != nullptr && tabwid == nullptr && wid == nullptr) {
tabwid = qobject_cast<TabWidget*>(bar->parentWidget());
updateTabWidget(tabwid);
} else if(wid != nullptr && tabwid == nullptr && bar == nullptr) {
tabwid = qobject_cast<TabWidget*>(wid->getParentWidget());
updateTabWidget(tabwid);
} else if(tabwid != nullptr && bar == nullptr) {
updateTabWidget(tabwid);
}
if(mCurrentTabWidget != nullptr) {
if(mCurrentTabWidget->count() != 0 && mCurrentTabWidget != nullptr && mCurrentTabWidget->currentWidget() != nullptr) {
QTextDocument* doc = toTextEdit(mCurrentTabWidget->currentWidget())->document();
emit documentChanged(toDocument(doc));
}
}
}
示例6: main
int main(int argc, char * argv[])
{
QApplication app(argc, argv);
TextEdit *textEdit = new TextEdit;
textEdit->show();
return app.exec();
}
示例7: main
int main( int argc, char ** argv )
{
QApplication a( argc, argv );
TextEdit * mw = new TextEdit();
mw->setCaption( "Richtext Editor" );
mw->resize( 640, 800 );
mw->show();
a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
return a.exec();
}
示例8: CreateTextEdit
void MainWindow::NewFileSlot()
{
TextEdit* child = CreateTextEdit();
child->NewFile();
//child->show();
tabWidget->addTab(child, child->GetCurrentFileName());
int index = tabWidget->count();
//tabWidget->addTab(child, child->GetCurrentFileName());
tabWidget->setTabToolTip(index, child->GetCurrentFile());
}
示例9: main
int main( int argc, char ** argv )
{
Q_INIT_RESOURCE(textedit);
QApplication a( argc, argv );
TextEdit mw;
mw.resize( 700, 800 );
mw.show();
return a.exec();
}
示例10: main
int main(int argc, char *argv[])
{
GWindow::initX();
TextEdit *editor = new TextEdit();
if (argc > 1) { editor->loadFile(argv[1]); }
editor->createWindow();
XSetIOErrorHandler(&IOErrorHandler);
GWindow::messageLoop();
GWindow::closeX();
delete editor;
}
示例11: create
void create() {
if ( created )
return;
created = TRUE;
TextEdit *te = new TextEdit( stack );
te->load( "textdrawing/example.html" );
stack->addWidget( te, categoryOffset() + 0 );
QString home = QDir( "../../doc/html/index.html" ).absPath();
HelpWindow *w = new HelpWindow( home, ".", stack, "helpviewer" );
stack->addWidget( w, categoryOffset() + 1 );
}
示例12: doExeute
void OpenFolderAction::doExeute(ActionTabWidget* tablWidget)
{
TextEdit* textEdit = static_cast<TextEdit*>(
tablWidget->currentWidget());
if (textEdit) {
QString textPath = textEdit->getPath();
int stuffIndex = textPath.lastIndexOf("/");
textPath = textPath.left(stuffIndex);
QDesktopServices::openUrl(QUrl(textPath));
}
}
示例13: reload
void ScriptTextEditor::reload(bool p_soft) {
TextEdit *te = code_editor->get_text_edit();
Ref<Script> scr = get_edited_script();
if (scr.is_null())
return;
scr->set_source_code(te->get_text());
bool soft = p_soft || scr->get_instance_base_type()=="EditorPlugin"; //always soft-reload editor plugins
scr->get_language()->reload_tool_script(scr,soft);
}
示例14: main
int main(int argc, char **argv)
{
Q_INIT_RESOURCE(textedit);
QApplication a(argc, argv);
a.setStyle(new MyProxyStyle);
TextEdit mw;
mw.resize(700, 800);
mw.show();
//...
}
示例15: main
int main( int argc, char ** argv )
{
Q_INIT_RESOURCE(textedit);
QApplication a( argc, argv );
//QApplication::setStyle(QStyleFactory::create("cleanlooks"));
//QApplication::setPalette(QApplication::style()->standardPalette());
TextEdit mw;
mw.resize( 700, 800 );
mw.show();
return a.exec();
}