本文整理汇总了C++中QListWidgetItem::type方法的典型用法代码示例。如果您正苦于以下问题:C++ QListWidgetItem::type方法的具体用法?C++ QListWidgetItem::type怎么用?C++ QListWidgetItem::type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QListWidgetItem
的用法示例。
在下文中一共展示了QListWidgetItem::type方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slotBtOK
//-------------------------------------------------------------------------------
void DialogMeteotableOptions::slotBtOK()
{
// copy visible items order from widgets
for (int i=0; i<listHiddenData->count(); i++) {
QListWidgetItem *widgitem = listHiddenData->item(i);
MeteotableOptionItem *item = getOptionItemByCode (widgitem->type());
item->visible = false;
item->pos = i;
}
for (int i=0; i<listVisibleData->count(); i++) {
QListWidgetItem *widgitem = listVisibleData->item(i);
MeteotableOptionItem *item = getOptionItemByCode (widgitem->type());
item->visible = true;
item->pos = i;
}
// write settings
for (int i = 0; i < listAllOptionItems.size(); ++i) {
MeteotableOptionItem *item = listAllOptionItems.at(i);
uint grbcode = item->dtc.toInt32 ();
Util::setSetting (getSettingName_vis(grbcode), item->visible);
Util::setSetting (getSettingName_pos(grbcode), item->pos);
}
Util::setSetting("MTABLE_cloudsColorMode", inputCloudsColorMode->itemData(inputCloudsColorMode->currentIndex()).toString());
Util::setSetting("MTABLE_showWindArrows", cbShowWindArrows->isChecked());
Util::setSetting("MTABLE_showWindBeauforts", cbShowBeauforts->isChecked());
accept();
}
示例2: slotChangeVisibleItems
//=============================================================================
void DialogMeteotableOptions::slotChangeVisibleItems()
{
// copy visible items order from widget
for (int i=0; i<listVisibleData->count(); i++)
{
QListWidgetItem *widgitem = listVisibleData->item(i);
MeteotableOptionItem *item = getOptionItemByCode (widgitem->type());
item->pos = i;
}
// change visibility of selected items
QListWidget *listWidgetSource;
if (sender() == btAddVisibleItem) {
listWidgetSource = listHiddenData;
}
else {
listWidgetSource = listVisibleData;
}
for (int i=0; i<listWidgetSource->count(); i++)
{
QListWidgetItem *widgitem = listWidgetSource->item(i);
if (widgitem->isSelected())
{
// put all selected items at the end of the other list
MeteotableOptionItem *item = getOptionItemByCode (widgitem->type());
if (item) {
item->visible = ! item->visible; // reverse visibility
item->pos = nbOptionItems(item->visible)-1; // to the end of his category
}
}
}
// update positions after movings (numerate from 0)
qSort (listAllOptionItems.begin(), listAllOptionItems.end(),
MeteotableOptionItem::lessThan_byPos);
int posVis = 0;
int posNotVis = 0;
for (int i = 0; i < listAllOptionItems.size(); ++i) {
MeteotableOptionItem *item = listAllOptionItems.at(i);
if (item->visible) {
item->pos = posVis++;
}
else {
item->pos = posNotVis++;
}
}
updateListWidgetsItems ();
}
示例3: getTransformMatrix
QMatrix TransformDialog::getTransformMatrix()
{
QMatrix ret = QMatrix();
for (int a = 0; a < transformSelector->count(); a++)
{
QListWidgetItem *it = transformSelector->item(a);
TransformItem *ite = (TransformItem*)it;
switch (it->type())
{
case 1001:
ret.scale(ite->firstValue / 100.0, ite->secondValue / 100.0);
break;
case 1002:
ret.translate(ite->firstValue / m_unitRatio, ite->secondValue / m_unitRatio);
break;
case 1003:
ret.rotate(ite->firstValue);
break;
case 1004:
ret.shear(-sin(ite->firstValue / 180.0 * M_PI), -sin(ite->secondValue / 180.0 * M_PI));
break;
default:
break;
}
}
return ret;
}
示例4: eliminarClausulas
void Qclprover::eliminarClausulas()
{
for (int i = 0; i < ui->listaClausulas->count(); ++i) {
QListWidgetItem* item = ui->listaClausulas->item(i);
parser.eliminarClausula(item->type());
}
ui->listaClausulas->clear();
}
示例5: refreshView
void Completion::refreshView()
{
QListWidgetItem* item;
for ( int i = 0; i < lwItems->count(); i++ )
{
item = lwItems->item( i );
if ( item->type() == itVariables )
lwItems->setItemHidden( item, !actionShowVariables->isChecked() );
else if ( item->type() == itMembers )
lwItems->setItemHidden( item, !actionShowMembers->isChecked() );
else if ( item->type() == itSlots )
lwItems->setItemHidden( item, !actionShowSlots->isChecked() );
else if ( item->type() == itSignals )
lwItems->setItemHidden( item, !actionShowSignals->isChecked() );
else if ( item->type() == itOthers )
lwItems->setItemHidden( item, !actionShowOthers->isChecked() );
}
}
示例6: eliminarClausula
void Qclprover::eliminarClausula()
{
QListWidgetItem* item = ui->listaClausulas->currentItem();
if (item) {
int id_e = item->type();
parser.eliminarClausula(id_e);
int row = ui->listaClausulas->row(item);
delete ui->listaClausulas->takeItem(row);
}
}
示例7: onOpen
void OpenFileWidget::onOpen()
{
QListWidgetItem * item = m_fileList->currentItem();
if(item && item->type() == 0)
{
QString fileName = item->text();
emit selected(fileName);
close();
}
}
示例8: onColor
void PeakColorDlg::onColor()
{
QListWidgetItem* item = d_list->currentItem();
Q_ASSERT( item != 0 );
const QColor clr = QColorDialog::getColor( item->background().color(), this );
if( !clr.isValid() )
return;
item->setBackground( clr );
d_colors->setColor( item->type(), clr );
}
示例9: getConfig
InsertGraphicsConfig InsertGraphics::getConfig() const {
InsertGraphicsConfig conf;
conf.file = ui.leFile->text();
conf.includeOptions = ui.leScale->text();
for(int i=0; i<ui.listPlacement->count(); i++) {
QListWidgetItem *item = ui.listPlacement->item(i);
if (item->checkState() == Qt::Checked) {
if (item->type() == InsertGraphics::PlaceHere) conf.placement.append("h");
if (item->type() == InsertGraphics::PlaceBottom) conf.placement.append("b");
if (item->type() == InsertGraphics::PlaceTop) conf.placement.append("t");
if (item->type() == InsertGraphics::PlacePage) conf.placement.append("p");
}
}
conf.center = ui.cbCentering->isChecked();
conf.useFigure = ui.gbFloat->isChecked();
conf.captionBelow = ui.cbPosition->currentIndex()!=0;
conf.caption = ui.teCaption->toPlainText().simplified();
conf.label = ui.leLabel->text();
conf.spanTwoCols = ui.cbSpan->isChecked();
return conf;
}
示例10: preview
void filtermainWindow::preview(bool b)
{
QListWidgetItem *item = activeList->currentItem();
if (!item)
{
printf("No selection\n");
return;
}
int itag = item->type();
ADM_assert(itag > ACTIVE_FILTER_BASE);
itag -= ACTIVE_FILTER_BASE;
DIA_filterPreview(QT_TR_NOOP("Preview"), videofilters[itag].filter, curframe);
}