本文整理汇总了C++中TabWidget::widget方法的典型用法代码示例。如果您正苦于以下问题:C++ TabWidget::widget方法的具体用法?C++ TabWidget::widget怎么用?C++ TabWidget::widget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TabWidget
的用法示例。
在下文中一共展示了TabWidget::widget方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parentWidget
void
Unicorn::TabBar::mouseMoveEvent( QMouseEvent* e )
{
if( !m_tearable )
return;
if( !(e->buttons() & Qt::LeftButton) || m_mouseDownPos.isNull() )
return;
if( (e->pos() - m_mouseDownPos ).manhattanLength() <
k_startTearDistance)
return;
TabWidget* tabWidget = qobject_cast<TabWidget*>( parentWidget() );
if( !tabWidget )
return;
int index = currentIndex();
removeTab( index );
QWidget* curWidget = tabWidget->widget( index );
if( !curWidget )
return;
QPoint offset = curWidget->mapToGlobal(curWidget->pos()) - QCursor::pos();
curWidget->setParent( window(), Qt::Tool );
curWidget->move( QCursor::pos() + QPoint(offset.x(), 0));
curWidget->resize( tabWidget->size());
curWidget->show();
m_tearable = false;
while( QApplication::mouseButtons() & Qt::LeftButton )
{
if( curWidget->pos() != QCursor::pos())
curWidget->move( QCursor::pos() + QPoint(offset.x(), 0));
QApplication::processEvents( QEventLoop::WaitForMoreEvents );
}
curWidget->installEventFilter( this );
m_tearable = true;
m_mouseDownPos = QPoint();
}
示例2: applySettings
void FrostEdit::applySettings() {
loadStyleSheet(Settings::get("Appearance/StyleSheet", "").toString());
//mSyntaxStyle.load(Settings::get("Appearance/Colorscheme").toString());
//mSettingsMenu->setSyntaxStyle(&mSyntaxStyle);
mFont.setFamily(Settings::get("TextEditor/Font", "Lucida Console").toString());
mFont.setPointSize(Settings::get("TextEditor/FontSize", 10).toInt());
for(TabWidgetFrame* tabf: mTabWidgetFrames) {
TabWidget* wid =tabf->tabWidget();
for(int i = 0; i < wid->count(); i++) {
TextEdit* e = toTextEdit(wid->widget(i));
e->setFont(mFont);
mSyntaxStyle.applyToTextEdit(e);
}
}
for(auto i: mOpenDocuments.keys()) {
Document* doc = mOpenDocuments[i];
TextEditor::Internal::Highlighter* hilt = doc->getHighlighter();
if(hilt != nullptr) {
qDebug() << "Found a highlighter!";
mSyntaxStyle.applyToHighlighter(hilt);
hilt->rehighlight();
}
}
for(int i = 0; i < mApplicationOutput->count(); i++) {
Console* c = toConsole(mApplicationOutput->widget(i));
mSyntaxStyle.applyToConsole(c);
}
mSyntaxStyle.applyToConsole(mCompileOutput);
mSyntaxStyle.applyToIssueList(mIssueList);
}
示例3: save
/*!
* Сохранение списка закреплённых вкладок и их порядка.
*/
void StateCache::save()
{
if (!m_settings->isSynced())
return;
TabWidget *tabs = TabWidget::i();
for (int i = tabs->count() - 1; i >= 0; --i) {
AbstractTab *tab = tabs->widget(i);
if (tab->options() & AbstractTab::Pinned) {
const QString id = encode(tab->id());
m_tabs.removeAll(id);
m_tabs.prepend(id);
}
}
if (ChatClient::channels()->policy() & ServerFeed::ForcedJoinPolicy) {
const QString mainId = SimpleID::encode(ChatClient::channels()->mainId());
m_tabs.removeAll(mainId);
m_tabs.prepend(mainId);
}
m_settings->setValue(m_key, m_tabs);
}