本文整理汇总了C++中QTabWidget::setElideMode方法的典型用法代码示例。如果您正苦于以下问题:C++ QTabWidget::setElideMode方法的具体用法?C++ QTabWidget::setElideMode怎么用?C++ QTabWidget::setElideMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTabWidget
的用法示例。
在下文中一共展示了QTabWidget::setElideMode方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setElideMode
int TabWidget::setElideMode( lua_State * L )//( Qt::TextElideMode )void
{
QTabWidget* obj = ObjectHelper<QTabWidget>::check( L, 1 );
Enums enums(L);
Qt::TextElideMode f =(Qt::TextElideMode)enums.TextElideMode( 2 );
obj->setElideMode( f );
return 0;
}
示例2: createWidget
void ZObjsManagerWidget::createWidget()
{
QTabWidget *tabs = new QTabWidget(this);
tabs->setElideMode(Qt::ElideNone);
tabs->setUsesScrollButtons(true);
m_swcObjsTreeView = new QTreeView(this);
m_swcObjsTreeView->setTextElideMode(Qt::ElideLeft);
m_swcObjsTreeView->setExpandsOnDoubleClick(false);
m_swcObjsTreeView->setModel(m_doc->swcObjsModel());
m_swcObjsTreeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
m_swcObjsTreeView->setContextMenuPolicy(Qt::CustomContextMenu);
connect(m_swcObjsTreeView, SIGNAL(doubleClicked(QModelIndex)),
this, SLOT(swcItemDoubleClicked(QModelIndex)));
connect(m_swcObjsTreeView->selectionModel(),
SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
this, SLOT(swcSelectionChangedFromTreeView(QItemSelection,QItemSelection)));
tabs->addTab(m_swcObjsTreeView, "Neurons");
if (NeutubeConfig::getInstance().getObjManagerConfig().isCategorizedSwcNodeOn()) {
m_swcNodeObjsTreeView = new QTreeView(this);
m_swcNodeObjsTreeView->setExpandsOnDoubleClick(false);
m_swcNodeObjsTreeView->setModel(m_doc->swcNodeObjsModel());
m_swcNodeObjsTreeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
m_swcNodeObjsTreeView->setContextMenuPolicy(Qt::CustomContextMenu);
connect(m_swcNodeObjsTreeView, SIGNAL(doubleClicked(QModelIndex)),
this, SLOT(processDoubleClickOnCategorizedSwcNode(QModelIndex)));
connect(m_swcNodeObjsTreeView->selectionModel(),
SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
this, SLOT(updateSelectionFromCategorizedSwcNode(QItemSelection,QItemSelection)));
tabs->addTab(m_swcNodeObjsTreeView, "Neuron Nodes");
}
if (NeutubeConfig::getInstance().getMainWindowConfig().isMarkPunctaOn()) {
m_punctaObjsTreeView = new QTreeView(this);
m_punctaObjsTreeView->setSortingEnabled(true);
m_punctaObjsTreeView->setExpandsOnDoubleClick(false);
m_punctaProxyModel = new QSortFilterProxyModel(this);
m_punctaProxyModel->setSourceModel(m_doc->punctaObjsModel());
//m_punctaObjsTreeView->setModel(m_doc->punctaObjsModel());
m_punctaObjsTreeView->setModel(m_punctaProxyModel);
m_punctaObjsTreeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
m_punctaObjsTreeView->setContextMenuPolicy(Qt::CustomContextMenu);
connect(m_punctaObjsTreeView, SIGNAL(doubleClicked(QModelIndex)),
this, SLOT(punctaItemDoubleClicked(QModelIndex)));
connect(m_punctaObjsTreeView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
this, SLOT(punctaSelectionChangedFromTreeView(QItemSelection,QItemSelection)));
m_punctaObjsTreeView->sortByColumn(0, Qt::AscendingOrder);
tabs->addTab(m_punctaObjsTreeView, "Puncta");
}
if (GET_APPLICATION_NAME == "FlyEM") {
m_seedObjsTreeView = new QTreeView(this);
m_seedObjsTreeView->setSortingEnabled(false);
m_seedObjsTreeView->setExpandsOnDoubleClick(false);
m_seedObjsTreeView->setModel(m_doc->seedObjsModel());
m_seedObjsTreeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
m_seedObjsTreeView->setContextMenuPolicy(Qt::CustomContextMenu);
tabs->addTab(m_seedObjsTreeView, "Seeds");
}
QHBoxLayout *layout = new QHBoxLayout;
layout->addWidget(tabs);
setLayout(layout);
if (m_doc->hasSelectedPuncta()) {
//std::set<ZPunctum*> *selectedPuncta = m_doc->selectedPuncta();
QList<ZPunctum*> selected =
m_doc->getSelectedObjectList<ZPunctum>(ZStackObject::TYPE_PUNCTUM);
QList<ZPunctum*> deselected;
//std::copy(selectedPuncta->begin(), selectedPuncta->end(), std::back_inserter(selected));
punctaSelectionChanged(selected, deselected);
}
if (!m_doc->hasSelectedSwc()) {
//std::set<ZSwcTree*> *selectedSwcs = m_doc->selectedSwcs();
QList<ZSwcTree*> selected =
m_doc->getSelectedObjectList<ZSwcTree>(ZStackObject::TYPE_SWC);
QList<ZSwcTree*> deselected;
//std::copy(selectedSwcs->begin(), selectedSwcs->end(), std::back_inserter(selected));
swcSelectionChanged(selected, deselected);
}
if (m_doc->hasSelectedSwcNode()) {
std::set<Swc_Tree_Node*> nodeSet = m_doc->getSelectedSwcNodeSet();
QList<Swc_Tree_Node*> selected;
QList<Swc_Tree_Node*> deselected;
std::copy(nodeSet.begin(), nodeSet.end(),
std::back_inserter(selected));
swcTreeNodeSelectionChanged(selected, deselected);
}
connect(m_doc,
SIGNAL(punctaSelectionChanged(QList<ZPunctum*>,QList<ZPunctum*>)),
this, SLOT(punctaSelectionChanged(QList<ZPunctum*>,QList<ZPunctum*>)));
connect(m_doc,
SIGNAL(swcSelectionChanged(QList<ZSwcTree*>,QList<ZSwcTree*>)),
this, SLOT(swcSelectionChanged(QList<ZSwcTree*>,QList<ZSwcTree*>)));
connect(m_doc,
SIGNAL(swcTreeNodeSelectionChanged(QList<Swc_Tree_Node*>,QList<Swc_Tree_Node*>)),
this, SLOT(swcTreeNodeSelectionChanged(QList<Swc_Tree_Node*>,QList<Swc_Tree_Node*>)));
}
示例3: setElideMode
void QTabWidgetProto::setElideMode(int mode)
{
QTabWidget *item = qscriptvalue_cast<QTabWidget*>(thisObject());
if (item)
item->setElideMode((Qt::TextElideMode)mode);
}
示例4: aboutCredits
void MainWindow::aboutCredits() {
QDialog *dialog = new QDialog( this );
QTextEdit *qteCreditsWritten = new QTextEdit( dialog );
qteCreditsWritten->setReadOnly( 1 );
qteCreditsWritten->setLineWrapMode( QTextEdit::NoWrap );
qteCreditsWritten->setText( "Tim Kleinschmidt <[email protected]>" );
QTextEdit *qteCreditsArtwork = new QTextEdit( dialog );
qteCreditsArtwork->setReadOnly( 1 );
qteCreditsArtwork->setLineWrapMode( QTextEdit::NoWrap );
qteCreditsArtwork->setText( "Elementary Theme\n" );
QTabWidget *qtwCredits = new QTabWidget( dialog );
qtwCredits->addTab( qteCreditsWritten, tr( "Written by" ));
qtwCredits->addTab( qteCreditsArtwork, tr( "Artwork by" ));
qtwCredits->setElideMode( Qt::ElideRight );
QPushButton *qpbClose = new QPushButton( IconLoader::Load( "window-close"), tr( "&Close" ), dialog );
connect( qpbClose, SIGNAL( clicked()), dialog, SLOT( close()));
qglDialog = new QGridLayout( dialog );
qglDialog->addWidget( qtwCredits, 0, 0,Qt::AlignCenter );
qglDialog->addWidget( qpbClose, 1, 0, Qt::AlignRight );
dialog->setWindowTitle( tr( "Credits" ));
dialog->setLayout( qglDialog );
dialog->setFixedSize( 250, 200 );
dialog->exec();
}