本文整理汇总了C++中QTextBrowser::toPlainText方法的典型用法代码示例。如果您正苦于以下问题:C++ QTextBrowser::toPlainText方法的具体用法?C++ QTextBrowser::toPlainText怎么用?C++ QTextBrowser::toPlainText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTextBrowser
的用法示例。
在下文中一共展示了QTextBrowser::toPlainText方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testNewGameButtonClick
void MainWindowSampleTest::testNewGameButtonClick()
{
MainWindowSample mainWindowSample(new Controller(new Model));
QPushButton* newGameButton = mainWindowSample.getNewGameButton();
QTextBrowser* textBrowser = mainWindowSample.getTextBrowser();
QTest::mouseClick(newGameButton, Qt::LeftButton);
QCOMPARE(textBrowser->toPlainText(), QString("New Game button clicked"));
}
示例2: keyPressEvent
//.........这里部分代码省略.........
{
openDirectory();
}
else if (ke->key() == Qt::Key_F10)
{
maximizePackagesTreeView(false);
}
else if (ke->key() == Qt::Key_F12)
{
maximizePropertiesTabWidget(false);
}
else if(ke->key() == Qt::Key_C && ke->modifiers() == Qt::ControlModifier)
{
copyFullPathToClipboard();
}
else if(ke->key() == Qt::Key_L && ke->modifiers() == Qt::ControlModifier)
{
m_leFilterPackage->setFocus();
m_leFilterPackage->selectAll();
}
else if(ke->key() == Qt::Key_F && ke->modifiers() == Qt::ControlModifier)
{
if (m_commandExecuting != ectn_NONE) return;
if (isPropertiesTabWidgetVisible() &&
(ui->twProperties->currentIndex() == ctn_TABINDEX_INFORMATION ||
ui->twProperties->currentIndex() == ctn_TABINDEX_OUTPUT ||
ui->twProperties->currentIndex() == ctn_TABINDEX_NEWS ||
ui->twProperties->currentIndex() == ctn_TABINDEX_HELPUSAGE))
{
QTextBrowser *tb = ui->twProperties->currentWidget()->findChild<QTextBrowser*>("textBrowser");
SearchBar *searchBar = ui->twProperties->currentWidget()->findChild<SearchBar*>("searchbar");
if (tb && tb->toPlainText().size() > 0 && searchBar)
{
if (searchBar) searchBar->show();
}
}
else if (isPropertiesTabWidgetVisible() && ui->twProperties->currentIndex() == ctn_TABINDEX_FILES)
{
QTreeView *tb = ui->twProperties->currentWidget()->findChild<QTreeView*>("tvPkgFileList");
SearchBar *searchBar = ui->twProperties->currentWidget()->findChild<SearchBar*>("searchbar");
if (tb && tb->model()->rowCount() > 0 && searchBar)
{
if (searchBar) searchBar->show();
}
}
}
else if(ke->key() == Qt::Key_D && ke->modifiers() == (Qt::ShiftModifier|Qt::ControlModifier))
{
//The user wants to know which packages have no description!
showPackagesWithNoDescription();
}
else if(ke->key() == Qt::Key_G && ke->modifiers() == (Qt::ShiftModifier|Qt::ControlModifier))
{
//The user wants to go to "Display All groups"
if (!isAllGroupsSelected())
{
ui->twGroups->setCurrentItem(m_AllGroupsItem);
}
}
else if(ke->key() == Qt::Key_Y && ke->modifiers() == (Qt::ShiftModifier|Qt::ControlModifier)
&& m_hasAURTool)
{
if (m_commandExecuting != ectn_NONE) return;
示例3: keyPressEvent
//.........这里部分代码省略.........
{
openDirectory();
}
else if (ke->key() == Qt::Key_F10)
{
maximizePackagesTreeView(false);
}
else if (ke->key() == Qt::Key_F12)
{
maximizePropertiesTabWidget(false);
}
else if(ke->key() == Qt::Key_C && ke->modifiers() == Qt::ControlModifier)
{
copyFullPathToClipboard();
}
else if(ke->key() == Qt::Key_L && ke->modifiers() == Qt::ControlModifier)
{
m_leFilterPackage->setFocus();
m_leFilterPackage->selectAll();
}
else if(ke->key() == Qt::Key_F && ke->modifiers() == Qt::ControlModifier)
{
if (m_commandExecuting != ectn_NONE) return;
if (isPropertiesTabWidgetVisible() &&
(ui->twProperties->currentIndex() == ctn_TABINDEX_INFORMATION ||
ui->twProperties->currentIndex() == ctn_TABINDEX_OUTPUT ||
ui->twProperties->currentIndex() == ctn_TABINDEX_NEWS ||
ui->twProperties->currentIndex() == ctn_TABINDEX_HELPUSAGE))
{
QTextBrowser *tb = ui->twProperties->currentWidget()->findChild<QTextBrowser*>("textBrowser");
SearchBar *searchBar = ui->twProperties->currentWidget()->findChild<SearchBar*>("searchbar");
if (tb && tb->toPlainText().size() > 0 && searchBar)
{
if (searchBar) searchBar->show();
}
}
else if (isPropertiesTabWidgetVisible() && ui->twProperties->currentIndex() == ctn_TABINDEX_FILES)
{
QTreeView *tb = ui->twProperties->currentWidget()->findChild<QTreeView*>("tvPkgFileList");
SearchBar *searchBar = ui->twProperties->currentWidget()->findChild<SearchBar*>("searchbar");
if (tb && tb->model()->rowCount() > 0 && searchBar)
{
if (searchBar) searchBar->show();
}
}
}
else if(ke->key() == Qt::Key_D && ke->modifiers() == (Qt::ShiftModifier|Qt::ControlModifier))
{
//The user wants to know which packages have no description!
showPackagesWithNoDescription();
}
else if(ke->key() == Qt::Key_G && ke->modifiers() == (Qt::ShiftModifier|Qt::ControlModifier))
{
//The user wants to go to "Display All groups"
if (!isAllCategoriesSelected())
{
ui->twGroups->setCurrentItem(m_AllGroupsItem);
}
}
else if(ke->key() == Qt::Key_C && ke->modifiers() == (Qt::ShiftModifier|Qt::ControlModifier))
{
if (m_commandExecuting == ectn_NONE)
{