本文整理汇总了C++中QListView::setMinimumWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ QListView::setMinimumWidth方法的具体用法?C++ QListView::setMinimumWidth怎么用?C++ QListView::setMinimumWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QListView
的用法示例。
在下文中一共展示了QListView::setMinimumWidth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fillLangCombo
/*
void SMCStyleWidget::fillLangCombo(QMap<QString,QString> langMap)
{
QStringList sortList;
QMap<QString,QString>::Iterator it;
m_langMap = langMap;
language_->clear();
for (it = langMap.begin(); it != langMap.end(); ++it)
sortList.push_back(it.value());
language_->addItems(sortQStringList(sortList));
QListView *tmpView = dynamic_cast<QListView*>(language_->view()); Q_ASSERT(tmpView);
int tmpWidth = tmpView->sizeHintForColumn(0);
if (tmpWidth > 0)
tmpView->setMinimumWidth(tmpWidth + 24);
}
*/
void SMCStyleWidget::fillLangComboFromList(QStringList langList)
{
language_->clear();
language_->addItems(langList);
QListView *tmpView = dynamic_cast<QListView*>(language_->view()); Q_ASSERT(tmpView);
int tmpWidth = tmpView->sizeHintForColumn(0);
if (tmpWidth > 0)
tmpView->setMinimumWidth(tmpWidth + 24);
}
示例2: QDialog
SearchReplace::SearchReplace( QWidget* parent, ScribusDoc *doc, PageItem* ite, bool mode )
: QDialog( parent ),
matchesFound(0)
{
m_item = ite;
m_doc = doc;
m_notFound = false;
m_itemMode = mode;
m_firstMatchPosition = -1;
setModal(true);
setWindowTitle( tr( "Search/Replace" ) );
setWindowIcon(IconManager::instance()->loadIcon("AppIcon.png"));
SearchReplaceLayout = new QVBoxLayout( this );
SearchReplaceLayout->setMargin(10);
SearchReplaceLayout->setSpacing(5);
SelLayout = new QHBoxLayout;
SelLayout->setMargin(0);
SelLayout->setSpacing(5);
Search = new QGroupBox( this );
Search->setTitle( tr( "Search for:" ) );
SearchLayout = new QGridLayout( Search );
SearchLayout->setMargin(5);
SearchLayout->setSpacing(2);
SearchLayout->setAlignment( Qt::AlignTop );
SText = new QCheckBox( Search );
SText->setText( tr( "Text" ) );
SearchLayout->addWidget( SText, 0, 0 );
SStyle = new QCheckBox( Search );
SStyle->setText( tr( "Style" ) );
SearchLayout->addWidget( SStyle, 1, 0 );
SAlign = new QCheckBox( Search );
SAlign->setText( tr( "Alignment" ) );
SearchLayout->addWidget( SAlign, 2, 0 );
SFont = new QCheckBox( Search );
SFont->setText( tr( "Font" ) );
SearchLayout->addWidget( SFont, 3, 0 );
SSize = new QCheckBox( Search );
SSize->setText( tr( "Font Size" ) );
SearchLayout->addWidget( SSize, 4, 0 );
SEffect = new QCheckBox( Search );
SEffect->setText( tr( "Font Effects" ) );
SearchLayout->addWidget( SEffect, 5, 0 );
SFill = new QCheckBox( Search);
SFill->setText( tr( "Fill Color" ) );
SearchLayout->addWidget( SFill, 6, 0 );
SFillS = new QCheckBox( Search );
SFillS->setText( tr( "Fill Shade" ) );
SearchLayout->addWidget( SFillS, 7, 0 );
SStroke = new QCheckBox( Search );
SStroke->setText( tr( "Stroke Color" ) );
SearchLayout->addWidget( SStroke, 8, 0 );
SStrokeS = new QCheckBox( Search );
SStrokeS->setText( tr( "Stroke Shade" ) );
SearchLayout->addWidget( SStrokeS, 9, 0 );
STextVal = new QLineEdit( Search );
STextVal->setEnabled(false);
SearchLayout->addWidget( STextVal, 0, 1 );
SStyleVal = new QComboBox( Search );
SStyleVal->setEditable(false);
for (int x = 0; x < doc->paragraphStyles().count(); ++x)
SStyleVal->addItem(doc->paragraphStyles()[x].name());
QListView *tmpView = dynamic_cast<QListView*>(SStyleVal->view()); Q_ASSERT(tmpView);
int tmpWidth = tmpView->sizeHintForColumn(0);
if (tmpWidth > 0)
tmpView->setMinimumWidth(tmpWidth + 24);
SStyleVal->setCurrentIndex(findParagraphStyle(doc, doc->currentStyle));
SStyleVal->setEnabled(false);
SearchLayout->addWidget( SStyleVal, 1, 1 );
SAlignVal = new QComboBox( Search );
SAlignVal->setEditable(false);
QString tmp_sty[] = { tr("Left"), tr("Center"), tr("Right"), tr("Block"), tr("Forced")};
size_t ar_sty = sizeof(tmp_sty) / sizeof(*tmp_sty);
for (uint a = 0; a < ar_sty; ++a)
SAlignVal->addItem( tmp_sty[a] );
tmpView = dynamic_cast<QListView*>(SAlignVal->view()); Q_ASSERT(tmpView);
tmpWidth = tmpView->sizeHintForColumn(0);
if (tmpWidth > 0)
tmpView->setMinimumWidth(tmpWidth + 24);
SAlignVal->setEnabled(false);
SearchLayout->addWidget( SAlignVal, 2, 1 );
SFontVal = new FontCombo(Search);
SFontVal->setMaximumSize(190, 30);
setCurrentComboItem(SFontVal, doc->currentStyle.charStyle().font().scName());
SFontVal->setEnabled(false);
SearchLayout->addWidget( SFontVal, 3, 1 );
SSizeVal = new ScrSpinBox( 0.5, 2048, Search, 0 );
SSizeVal->setValue( doc->currentStyle.charStyle().fontSize() / 10.0 );
SSizeVal->setEnabled(false);
SearchLayout->addWidget( SSizeVal, 4, 1 );
SEffVal = new StyleSelect( Search );
SEffVal->setStyle(0);
SEffVal->setEnabled(false);
SearchLayout->addWidget( SEffVal, 5, 1, Qt::AlignLeft );
SFillVal = new ColorCombo( Search );
SFillVal->setEditable(false);
SFillVal->setPixmapType(ColorCombo::fancyPixmaps);
SFillVal->setColors(doc->PageColors, true);
SFillVal->setMinimumWidth(SFillVal->view()->maximumViewportSize().width() + 24);
//.........这里部分代码省略.........