本文整理汇总了C++中TextEdit类的典型用法代码示例。如果您正苦于以下问题:C++ TextEdit类的具体用法?C++ TextEdit怎么用?C++ TextEdit使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TextEdit类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:UnkLegacy,项目名称:OpenXcom,代码行数:39,代码来源:State.cpp
示例2: QCOMPARE
void Test2Test::testCase10()
{
TextEdit txt;
bool p;
p=txt.textItalic();
QCOMPARE(true,p);
}
开发者ID:sapr-bntu,项目名称:textedit_testing_Pavlova,代码行数:7,代码来源:tst_test2test.cpp
示例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;
}
}
}
开发者ID:Alphax,项目名称:nifskope,代码行数:28,代码来源:valueedit.cpp
示例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();
}
开发者ID:MaGetzUb,项目名称:FrostEdit,代码行数:30,代码来源:frostedit.cpp
示例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));
}
}
}
开发者ID:MaGetzUb,项目名称:FrostEdit,代码行数:30,代码来源:frostedit.cpp
示例6: main
int main(int argc, char * argv[])
{
QApplication app(argc, argv);
TextEdit *textEdit = new TextEdit;
textEdit->show();
return app.exec();
}
开发者ID:RobertoMalatesta,项目名称:emscripten-qt,代码行数:9,代码来源:main.cpp
示例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();
}
开发者ID:nightfly19,项目名称:renyang-learn,代码行数:10,代码来源:main.cpp
示例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());
}
开发者ID:jay602,项目名称:QtProjects,代码行数:10,代码来源:mainwindow.cpp
示例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();
}
开发者ID:paradiseOffice,项目名称:sandbox_and_programs,代码行数:10,代码来源:main.cpp
示例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;
}
开发者ID:tokar1,项目名称:mech-math,代码行数:11,代码来源:TextEdit.cpp
示例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 );
}
开发者ID:aroraujjwal,项目名称:qt3,代码行数:11,代码来源:main.cpp
示例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));
}
}
开发者ID:sld666666,项目名称:HtmlWriter,代码行数:11,代码来源:EditorTabWidgetActions.cpp
示例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);
}
开发者ID:Blake-Hudson,项目名称:godot,代码行数:11,代码来源:script_text_editor.cpp
示例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();
//...
}
开发者ID:Andreas665,项目名称:qt,代码行数:11,代码来源:src_gui_qproxystyle.cpp
示例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();
}
开发者ID:forevergenin,项目名称:phtranslator,代码行数:12,代码来源:main.cpp
示例16: configure_editor
void configure_editor(TextEdit &edit, Font &normalFont, Font &hotFont, int preferredWidth)
{
edit.FocusEnter.connect(Bind(&Widget::setFont, &edit, hotFont));
edit.FocusLeave.connect(Bind(&Widget::setFont, &edit, normalFont));
edit.MouseEnter.connect(Bind(&Widget::setBgColor, &edit, Color(255, 255, 190)));
edit.MouseLeave.connect(Bind(&Widget::setBgColor, &edit, Color::White));
edit.MouseEnter.connect(Bind(&Widget::invalidate, &edit, true));
edit.MouseLeave.connect(Bind(&Widget::invalidate, &edit, true));
edit.setFont(normalFont);
edit.setPreferredSize(Size(preferredWidth, edit.getPreferredSize().h));
}
开发者ID:Jmos,项目名称:vaca,代码行数:13,代码来源:LikeScript.cpp
示例17: testmain
int testmain() {
char c;
TextEdit t;
char* buf;
while ((c = getchar()) != '.') {
if (c == EOF) return(0);
t.handle(c);
printf("\n== %s ==\n", buf = t.GetPrintText());
delete buf;
}
return(0);
}
开发者ID:timburrow,项目名称:ovj3,代码行数:14,代码来源:stringedit.c
示例18: applyBattlescapeTheme
/**
* switch all the colours to something a little more battlescape appropriate.
*/
void State::applyBattlescapeTheme()
{
for (std::vector<Surface*>::iterator i = _surfaces.begin(); i != _surfaces.end(); ++i)
{
Window* window = dynamic_cast<Window*>(*i);
if (window)
{
window->setColor(Palette::blockOffset(0)-1);
window->setHighContrast(true);
window->setBackground(_game->getResourcePack()->getSurface("TAC00.SCR"));
}
Text* text = dynamic_cast<Text*>(*i);
if (text)
{
text->setColor(Palette::blockOffset(0)-1);
text->setHighContrast(true);
}
TextButton* button = dynamic_cast<TextButton*>(*i);
if (button)
{
button->setColor(Palette::blockOffset(0)-1);
button->setHighContrast(true);
}
TextEdit* edit = dynamic_cast<TextEdit*>(*i);
if (edit)
{
edit->setColor(Palette::blockOffset(0)-1);
edit->setHighContrast(true);
}
TextList* list = dynamic_cast<TextList*>(*i);
if (list)
{
list->setColor(Palette::blockOffset(0)-1);
list->setArrowColor(Palette::blockOffset(0));
list->setHighContrast(true);
}
ArrowButton *arrow = dynamic_cast<ArrowButton*>(*i);
if (arrow)
{
arrow->setColor(Palette::blockOffset(0));
}
Slider *slider = dynamic_cast<Slider*>(*i);
if (slider)
{
slider->setColor(Palette::blockOffset(0)-1);
slider->setHighContrast(true);
}
}
}
开发者ID:AngelusEV,项目名称:OpenXcom,代码行数:52,代码来源:State.cpp
示例19: main
int main( int argc, char ** argv )
{
QApplication a( argc, argv );
a.setOrganizationName("Oasis Test Reader");
a.setOrganizationDomain("QTuser");
a.setApplicationName("Mini Office");
#if QT_VERSION >= 0x040500
qDebug() << "### QT_VERSION main -> " << QT_VERSION;
qDebug() << "### QT_VERSION_STR main -> " << QT_VERSION_STR;
#endif
TextEdit mw;
mw.resize( 700, 450 );
mw.show();
QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
return a.exec();
}
开发者ID:SorinS,项目名称:fop-miniscribus,代码行数:16,代码来源:main.cpp
示例20: onAdministrator
void onAdministrator(Event& ev)
{
bool enabled = !m_administrator.isSelected();
m_usernameLabel.setEnabled(enabled);
m_usernameEdit.setEnabled(enabled);
if (!enabled)
m_usernameEdit.setText(L"root");
}
开发者ID:Jmos,项目名称:vaca,代码行数:8,代码来源:FreeOfLayout.cpp
注:本文中的TextEdit类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论