本文整理汇总了C++中QFlag函数的典型用法代码示例。如果您正苦于以下问题:C++ QFlag函数的具体用法?C++ QFlag怎么用?C++ QFlag使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了QFlag函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: QWidget
/*!
\overload
\obsolete
*/
QDialog::QDialog(QWidget *parent, const char *name, bool modal, Qt::WindowFlags f)
: QWidget(*new QDialogPrivate, parent,
f
| QFlag(modal ? Qt::WShowModal : Qt::WindowType(0))
| QFlag((f & Qt::WindowType_Mask) == 0 ? Qt::Dialog : Qt::WindowType(0))
)
{
setObjectName(QString::fromAscii(name));
}
开发者ID:12307,项目名称:VLC-for-VS2010,代码行数:13,代码来源:qdialog.cpp
示例2: switch
int QMessageBox::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QDialog::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
switch (_id) {
case 0: buttonClicked((*reinterpret_cast< QAbstractButton*(*)>(_a[1]))); break;
case 1: d_func()->_q_buttonClicked((*reinterpret_cast< QAbstractButton*(*)>(_a[1]))); break;
default: ;
}
_id -= 2;
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QString*>(_v) = text(); break;
case 1: *reinterpret_cast< Icon*>(_v) = icon(); break;
case 2: *reinterpret_cast< QPixmap*>(_v) = iconPixmap(); break;
case 3: *reinterpret_cast< Qt::TextFormat*>(_v) = textFormat(); break;
case 4: *reinterpret_cast<int*>(_v) = QFlag(standardButtons()); break;
case 5: *reinterpret_cast< QString*>(_v) = detailedText(); break;
case 6: *reinterpret_cast< QString*>(_v) = informativeText(); break;
}
_id -= 7;
} else if (_c == QMetaObject::WriteProperty) {
void *_v = _a[0];
switch (_id) {
case 0: setText(*reinterpret_cast< QString*>(_v)); break;
case 1: setIcon(*reinterpret_cast< Icon*>(_v)); break;
case 2: setIconPixmap(*reinterpret_cast< QPixmap*>(_v)); break;
case 3: setTextFormat(*reinterpret_cast< Qt::TextFormat*>(_v)); break;
case 4: setStandardButtons(QFlag(*reinterpret_cast<int*>(_v))); break;
case 5: setDetailedText(*reinterpret_cast< QString*>(_v)); break;
case 6: setInformativeText(*reinterpret_cast< QString*>(_v)); break;
}
_id -= 7;
} else if (_c == QMetaObject::ResetProperty) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 7;
}
#endif // QT_NO_PROPERTIES
return _id;
}
开发者ID:venkatarajasekhar,项目名称:ECE497,代码行数:54,代码来源:moc_qmessagebox.cpp
示例3: switch
int QDialogButtonBox::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QWidget::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
switch (_id) {
case 0: clicked((*reinterpret_cast< QAbstractButton*(*)>(_a[1]))); break;
case 1: accepted(); break;
case 2: helpRequested(); break;
case 3: rejected(); break;
case 4: d_func()->_q_handleButtonClicked(); break;
case 5: d_func()->_q_handleButtonDestroyed(); break;
default: ;
}
_id -= 6;
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< Qt::Orientation*>(_v) = orientation(); break;
case 1: *reinterpret_cast<int*>(_v) = QFlag(standardButtons()); break;
case 2: *reinterpret_cast< bool*>(_v) = centerButtons(); break;
}
_id -= 3;
} else if (_c == QMetaObject::WriteProperty) {
void *_v = _a[0];
switch (_id) {
case 0: setOrientation(*reinterpret_cast< Qt::Orientation*>(_v)); break;
case 1: setStandardButtons(QFlag(*reinterpret_cast<int*>(_v))); break;
case 2: setCenterButtons(*reinterpret_cast< bool*>(_v)); break;
}
_id -= 3;
} else if (_c == QMetaObject::ResetProperty) {
_id -= 3;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 3;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 3;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 3;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 3;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 3;
}
#endif // QT_NO_PROPERTIES
return _id;
}
开发者ID:venkatarajasekhar,项目名称:ECE497,代码行数:50,代码来源:moc_qdialogbuttonbox.cpp
示例4: qt_static_metacall
int QGraphicsWebView::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QGraphicsWidget::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 17)
qt_static_metacall(this, _c, _id, _a);
_id -= 17;
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QString*>(_v) = title(); break;
case 1: *reinterpret_cast< QIcon*>(_v) = icon(); break;
case 2: *reinterpret_cast< qreal*>(_v) = zoomFactor(); break;
case 3: *reinterpret_cast< QUrl*>(_v) = url(); break;
case 4: *reinterpret_cast< bool*>(_v) = isModified(); break;
case 5: *reinterpret_cast< bool*>(_v) = resizesToContents(); break;
case 6: *reinterpret_cast< bool*>(_v) = isTiledBackingStoreFrozen(); break;
case 7: *reinterpret_cast<int*>(_v) = QFlag(renderHints()); break;
}
_id -= 8;
} else if (_c == QMetaObject::WriteProperty) {
void *_v = _a[0];
switch (_id) {
case 2: setZoomFactor(*reinterpret_cast< qreal*>(_v)); break;
case 3: setUrl(*reinterpret_cast< QUrl*>(_v)); break;
case 5: setResizesToContents(*reinterpret_cast< bool*>(_v)); break;
case 6: setTiledBackingStoreFrozen(*reinterpret_cast< bool*>(_v)); break;
case 7: setRenderHints(QFlag(*reinterpret_cast<int*>(_v))); break;
}
_id -= 8;
} else if (_c == QMetaObject::ResetProperty) {
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 8;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 8;
}
#endif // QT_NO_PROPERTIES
return _id;
}
开发者ID:DreamOnTheGo,项目名称:src,代码行数:50,代码来源:moc_qgraphicswebview.cpp
示例5: applyAttributes
void applyAttributes(const QtnPropertyDelegateAttributes& attributes)
{
int option = 0;
if (qtnGetAttribute(attributes, "acceptMode", option))
m_dlg.setAcceptMode(QFileDialog::AcceptMode(option));
QString str;
if (qtnGetAttribute(attributes, "defaultSuffix", str))
m_dlg.setDefaultSuffix(str);
if (qtnGetAttribute(attributes, "fileMode", option))
m_dlg.setFileMode(QFileDialog::FileMode(option));
if (qtnGetAttribute(attributes, "options", option))
m_dlg.setOptions(QFileDialog::Options(QFlag(option)));
if (qtnGetAttribute(attributes, "viewMode", option))
m_dlg.setViewMode(QFileDialog::ViewMode(option));
if (qtnGetAttribute(attributes, "nameFilter", str))
m_dlg.setNameFilter(str);
QStringList list;
if (qtnGetAttribute(attributes, "nameFilters", list))
m_dlg.setNameFilters(list);
}
开发者ID:kmkolasinski,项目名称:QtnProperty,代码行数:26,代码来源:PropertyDelegateQString.cpp
示例6: key_canvas
//-----------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------
MyVTK::MyVTK(QWidget *page, QWidget *key_page)
{
zoomlevel = 0.7;
double backgroundColor[] = {0.0,0.0,0.0};
Pi = 4*atan(1.0);
page_VTK = page;
Global::leftb = false;
key_canvas(key_page);
qvtkWidget = new QVTKWidget(page,QFlag(0));
LOG_MSG("Created a new QVTKWidget");
QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(qvtkWidget);
// Associate the layout with page_VTK
page_VTK->setLayout(layout);
// Create a renderer, and add it to qvtkWidget's render window.
// The renderer renders into the render window.
ren = vtkRenderer::New();
renWin = qvtkWidget->GetRenderWindow();
renWin->AddRenderer(ren);
ren->SetBackground(backgroundColor);
// ren->SetBackground(0.1, 0.2, 0.4); // backgroundColor
ren->ResetCamera();
iren = qvtkWidget->GetInteractor();
vtkSmartPointer<MouseInteractorStyle4> style = vtkSmartPointer<MouseInteractorStyle4>::New();
iren->SetInteractorStyle( style );
iren->Initialize();
// Create mappers
createMappers();
// Create image filter for save Snapshot()
// w2img = vtkWindowToImageFilter::New();
// pngwriter = vtkSmartPointer<vtkPNGWriter>::New();
// jpgwriter = vtkSmartPointer<vtkJPEGWriter>::New();
first_VTK = true;
DCmotion = false;
DCfade = false;
playing = false;
paused = false;
opacity[1] = 1.0;
opacity[2] = 1.0;
display_celltype[1] = true;
display_celltype[2] = true;
TCpos_list.clear();
ren->GetActiveCamera()->Zoom(zoomlevel); // try zooming OUT
// Depth peeling
// renWin->SetAlphaBitPlanes(1);
// renWin->SetMultiSamples(0);
// ren->SetUseDepthPeeling(1);
// ren->SetMaximumNumberOfPeels(100);
// ren->SetOcclusionRatio(0.1);
}
开发者ID:gibbogle,项目名称:monolayer-abm,代码行数:62,代码来源:myvtk.cpp
示例7: contentsRect
QRectF
ComboBox::layoutRect() const
{
QRect cr = contentsRect();
Qt::Alignment align = QStyle::visualAlignment( Qt::LeftToRight, QFlag(_align) );
int indent = fontMetrics().width( QLatin1Char('x') ) / 2;
if (indent > 0) {
if (align & Qt::AlignLeft) {
cr.setLeft(cr.left() + indent);
}
if (align & Qt::AlignRight) {
cr.setRight(cr.right() - indent);
}
if (align & Qt::AlignTop) {
cr.setTop(cr.top() + indent);
}
if (align & Qt::AlignBottom) {
cr.setBottom(cr.bottom() - indent);
}
}
cr.adjust(0, 0, -DROP_DOWN_ICON_SIZE * 2, 0);
return cr;
}
开发者ID:Kthulhu,项目名称:Natron,代码行数:28,代码来源:ComboBox.cpp
示例8: qt_static_metacall
int Q3TimeEdit::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = Q3DateTimeEditBase::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 3)
qt_static_metacall(this, _c, _id, _a);
_id -= 3;
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QTime*>(_v) = time(); break;
case 1: *reinterpret_cast< bool*>(_v) = autoAdvance(); break;
case 2: *reinterpret_cast< QTime*>(_v) = maxValue(); break;
case 3: *reinterpret_cast< QTime*>(_v) = minValue(); break;
case 4: *reinterpret_cast<int*>(_v) = QFlag(display()); break;
}
_id -= 5;
} else if (_c == QMetaObject::WriteProperty) {
void *_v = _a[0];
switch (_id) {
case 0: setTime(*reinterpret_cast< QTime*>(_v)); break;
case 1: setAutoAdvance(*reinterpret_cast< bool*>(_v)); break;
case 2: setMaxValue(*reinterpret_cast< QTime*>(_v)); break;
case 3: setMinValue(*reinterpret_cast< QTime*>(_v)); break;
case 4: setDisplay(QFlag(*reinterpret_cast<int*>(_v))); break;
}
_id -= 5;
} else if (_c == QMetaObject::ResetProperty) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 5;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 5;
}
#endif // QT_NO_PROPERTIES
return _id;
}
开发者ID:unni07,项目名称:RecommenderSystem,代码行数:47,代码来源:moc_q3datetimeedit.cpp
示例9: maximumWidth
QSize
ComboBox::sizeForWidth(int w) const
{
if (minimumWidth() > 0) {
w = std::max( w, maximumWidth() );
}
QSize contentsMargin;
{
QMargins margins = contentsMargins();
contentsMargin.setWidth( margins.left() + margins.right() );
contentsMargin.setHeight( margins.bottom() + margins.top() );
}
QRect br;
//Using this constructor of QFontMetrics will respect the DPI of the screen, see http://doc.qt.io/qt-4.8/qfontmetrics.html#QFontMetrics-2
QFontMetrics fm(font(), 0);
Qt::Alignment align = QStyle::visualAlignment( Qt::LeftToRight, QFlag(_align) );
int hextra = DROP_DOWN_ICON_SIZE * 2, vextra = 0;
///Indent of 1 character
int indent = fm.width( QLatin1Char('x') );
if (indent > 0) {
if ( (align & Qt::AlignLeft) || (align & Qt::AlignRight) ) {
hextra += indent;
}
if ( (align & Qt::AlignTop) || (align & Qt::AlignBottom) ) {
vextra += indent;
}
}
// Turn off center alignment in order to avoid rounding errors for centering,
// since centering involves a division by 2. At the end, all we want is the size.
int flags = align & ~(Qt::AlignVCenter | Qt::AlignHCenter);
bool tryWidth = (w < 0) && (align & Qt::TextWordWrap);
if (tryWidth) {
w = std::min( fm.averageCharWidth() * 80, maximumSize().width() );
} else if (w < 0) {
w = 2000;
}
w -= ( hextra + contentsMargin.width() );
br = fm.boundingRect(0, 0, w, 2000, flags, _currentText);
if ( tryWidth && ( br.height() < 4 * fm.lineSpacing() ) && (br.width() > w / 2) ) {
br = fm.boundingRect(0, 0, w / 2, 2000, flags, _currentText);
}
if ( tryWidth && ( br.height() < 2 * fm.lineSpacing() ) && (br.width() > w / 4) ) {
br = fm.boundingRect(0, 0, w / 4, 2000, flags, _currentText);
}
const QSize contentsSize(br.width() + hextra, br.height() + vextra);
return (contentsSize + contentsMargin).expandedTo( minimumSize() );
} // ComboBox::sizeForWidth
开发者ID:Kthulhu,项目名称:Natron,代码行数:57,代码来源:ComboBox.cpp
示例10: Q_ASSERT
void IconDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
const QModelIndex &index) const
{
Q_ASSERT(index.isValid());
const QAbstractItemModel *model = index.model();
Q_ASSERT(model);
QStyleOptionViewItem opt = option;
// set font
QVariant value = model->data(index, Qt::FontRole);
if (value.isValid())
opt.font = qvariant_cast<QFont>(value);
// set text alignment
value = model->data(index, Qt::TextAlignmentRole);
if (value.isValid())
opt.displayAlignment = QFlag(value.toInt());
// set text color
value = model->data(index, Qt::TextColorRole);
if (value.isValid() && qvariant_cast<QColor>(value).isValid())
opt.palette.setColor(QPalette::Text, qvariant_cast<QColor>(value));
// do layout
value = model->data(index, Qt::DecorationRole);
QPixmap pixmap = decoration(opt, value);
QRect pixmapRect = pixmap.rect();
QFontMetrics fontMetrics(opt.font);
QString text = model->data(index, Qt::DisplayRole).toString();
QRect textRect(0, 0, 0,0);
//QRect textRect(0, 0, fontMetrics.width(text), fontMetrics.lineSpacing());
value = model->data(index, Qt::CheckStateRole);
QRect checkRect = check(opt, opt.rect, value);
Qt::CheckState checkState = static_cast<Qt::CheckState>(value.toInt());
doLayout(opt, &checkRect, &pixmapRect, &textRect, false);
// draw the background color
if (option.showDecorationSelected && (option.state & QStyle::State_Selected)) {
QPalette::ColorGroup cg = option.state & QStyle::State_Enabled
? QPalette::Normal : QPalette::Disabled;
painter->fillRect(option.rect, option.palette.brush(cg, QPalette::Highlight));
} else {
value = model->data(index, Qt::BackgroundColorRole);
if (value.isValid() && qvariant_cast<QColor>(value).isValid())
painter->fillRect(option.rect, qvariant_cast<QColor>(value));
}
// draw the item
drawCheck(painter, opt, checkRect, checkState);
drawDecoration(painter, opt, pixmapRect, pixmap);
// drawDisplay(painter, opt, textRect, text);
drawFocus(painter, opt, textRect);
}
开发者ID:svn2github,项目名称:texstudio,代码行数:57,代码来源:icondelegate.cpp
示例11: QFlag
void Dialog::setFont()
{
const QFontDialog::FontDialogOptions options = QFlag(fontDialogOptionsWidget->value());
bool ok;
QFont font = QFontDialog::getFont(&ok, QFont(fontLabel->text()), this, "Select Font", options);
if (ok) {
fontLabel->setText(font.key());
fontLabel->setFont(font);
}
}
开发者ID:CodeDJ,项目名称:qt5-hidpi,代码行数:10,代码来源:dialog.cpp
示例12: qt_static_metacall
int QDialogButtonBox::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QWidget::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 6)
qt_static_metacall(this, _c, _id, _a);
_id -= 6;
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< Qt::Orientation*>(_v) = orientation(); break;
case 1: *reinterpret_cast<int*>(_v) = QFlag(standardButtons()); break;
case 2: *reinterpret_cast< bool*>(_v) = centerButtons(); break;
}
_id -= 3;
} else if (_c == QMetaObject::WriteProperty) {
void *_v = _a[0];
switch (_id) {
case 0: setOrientation(*reinterpret_cast< Qt::Orientation*>(_v)); break;
case 1: setStandardButtons(QFlag(*reinterpret_cast<int*>(_v))); break;
case 2: setCenterButtons(*reinterpret_cast< bool*>(_v)); break;
}
_id -= 3;
} else if (_c == QMetaObject::ResetProperty) {
_id -= 3;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 3;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 3;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 3;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 3;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 3;
}
#endif // QT_NO_PROPERTIES
return _id;
}
开发者ID:unni07,项目名称:RecommenderSystem,代码行数:43,代码来源:moc_qdialogbuttonbox.cpp
示例13: qt_static_metacall
int QFontComboBox::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QComboBox::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 4)
qt_static_metacall(this, _c, _id, _a);
_id -= 4;
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QFontDatabase::WritingSystem*>(_v) = writingSystem(); break;
case 1: *reinterpret_cast<int*>(_v) = QFlag(fontFilters()); break;
case 2: *reinterpret_cast< QFont*>(_v) = currentFont(); break;
}
_id -= 3;
} else if (_c == QMetaObject::WriteProperty) {
void *_v = _a[0];
switch (_id) {
case 0: setWritingSystem(*reinterpret_cast< QFontDatabase::WritingSystem*>(_v)); break;
case 1: setFontFilters(QFlag(*reinterpret_cast<int*>(_v))); break;
case 2: setCurrentFont(*reinterpret_cast< QFont*>(_v)); break;
}
_id -= 3;
} else if (_c == QMetaObject::ResetProperty) {
_id -= 3;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 3;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 3;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 3;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 3;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 3;
}
#endif // QT_NO_PROPERTIES
return _id;
}
开发者ID:2011fuzhou,项目名称:vlc-2.1.0.subproject-2010,代码行数:43,代码来源:moc_qfontcombobox.cpp
示例14: seekflags
Preferences::WheelFunctions PrefInput::wheelFunctionCycle(){
Preferences::WheelFunctions seekflags (QFlag ((int) Preferences::Seeking)) ;
Preferences::WheelFunctions volumeflags (QFlag ((int) Preferences::Volume)) ;
Preferences::WheelFunctions zoomflags (QFlag ((int) Preferences::Zoom)) ;
Preferences::WheelFunctions speedflags (QFlag ((int) Preferences::ChangeSpeed)) ;
Preferences::WheelFunctions out (QFlag (0));
if(wheel_function_seek->isChecked()){
out = out | seekflags;
}
if(wheel_function_volume->isChecked()){
out = out | volumeflags;
}
if(wheel_function_zoom->isChecked()){
out = out | zoomflags;
}
if(wheel_function_speed->isChecked()){
out = out | speedflags;
}
return out;
}
开发者ID:corossig,项目名称:smplayer-mpv,代码行数:20,代码来源:prefinput.cpp
示例15: p
void PrimerLineEdit::paintEvent(QPaintEvent *event) {
QLineEdit::paintEvent(event);
if (!text().isEmpty()) {
return;
}
QPainter p(this);
QColor col = palette().text().color();
col.setAlpha(128);
p.setPen(col);
QRect r = placeHolderRect();
QString left = fontMetrics().elidedText("5'", Qt::ElideRight, r.width());
Qt::Alignment leftAlignment = QStyle::visualAlignment(Qt::LeftToRight, QFlag(Qt::AlignLeft));
p.drawText(r, leftAlignment, left);
QString right = fontMetrics().elidedText("3'", Qt::ElideRight, r.width());
Qt::Alignment rightAlignment = QStyle::visualAlignment(Qt::LeftToRight, QFlag(Qt::AlignRight));
p.drawText(r, rightAlignment, right);
}
开发者ID:ggrekhov,项目名称:ugene,代码行数:20,代码来源:PrimerLineEdit.cpp
示例16: qt_static_metacall
int QGraphicsBlurEffect::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QGraphicsEffect::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 4)
qt_static_metacall(this, _c, _id, _a);
_id -= 4;
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< qreal*>(_v) = blurRadius(); break;
case 1: *reinterpret_cast<int*>(_v) = QFlag(blurHints()); break;
}
_id -= 2;
} else if (_c == QMetaObject::WriteProperty) {
void *_v = _a[0];
switch (_id) {
case 0: setBlurRadius(*reinterpret_cast< qreal*>(_v)); break;
case 1: setBlurHints(QFlag(*reinterpret_cast<int*>(_v))); break;
}
_id -= 2;
} else if (_c == QMetaObject::ResetProperty) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 2;
}
#endif // QT_NO_PROPERTIES
return _id;
}
开发者ID:2011fuzhou,项目名称:vlc-2.1.0.subproject-2010,代码行数:41,代码来源:moc_qgraphicseffect.cpp
示例17: accept
void ZipDialog::accept()
{
QDialog::accept();
m_pArchiveInfo->m_to=ui->lineEditDestination->text();
m_pArchiveInfo->m_filter=ui->lineEditFilter->text();
int iFlags=0;
if(ui->checkBoxRecursiveSubdirs->checkState())
iFlags|=ZipRecursive;
if(ui->checkBoxMoveToArchive->checkState())
iFlags|=ZipMove2Archive;
if(ui->checkBoxSeparateArchives->checkState())
iFlags|=ZipSeparateArchives;
m_pArchiveInfo->m_zipFlags=QFlag(iFlags);
}
开发者ID:grainiac,项目名称:qmmander,代码行数:14,代码来源:zipdialog.cpp
示例18: switch
int QLibrary::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QObject::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
#ifndef QT_NO_PROPERTIES
if (_c == QMetaObject::ReadProperty) {
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< QString*>(_v) = fileName(); break;
case 1: *reinterpret_cast<int*>(_v) = QFlag(loadHints()); break;
}
_id -= 2;
} else if (_c == QMetaObject::WriteProperty) {
void *_v = _a[0];
switch (_id) {
case 0: setFileName(*reinterpret_cast< QString*>(_v)); break;
case 1: setLoadHints(QFlag(*reinterpret_cast<int*>(_v))); break;
}
_id -= 2;
} else if (_c == QMetaObject::ResetProperty) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 2;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 2;
}
#endif // QT_NO_PROPERTIES
return _id;
}
开发者ID:venkatarajasekhar,项目名称:ECE497,代码行数:37,代码来源:moc_qlibrary.cpp
示例19: qt_static_metacall
int QXmppTransferJob::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QXmppLoggable::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 9)
qt_static_metacall(this, _c, _id, _a);
_id -= 9;
}
#ifndef QT_NO_PROPERTIES
else if (_c == QMetaObject::ReadProperty) {
void *_v = _a[0];
switch (_id) {
case 0: *reinterpret_cast< Direction*>(_v) = direction(); break;
case 1: *reinterpret_cast< QUrl*>(_v) = localFileUrl(); break;
case 2: *reinterpret_cast< QString*>(_v) = jid(); break;
case 3: *reinterpret_cast<int*>(_v) = QFlag(method()); break;
case 4: *reinterpret_cast< State*>(_v) = state(); break;
case 5: *reinterpret_cast< QString*>(_v) = fileName(); break;
case 6: *reinterpret_cast< qint64*>(_v) = fileSize(); break;
}
_id -= 7;
} else if (_c == QMetaObject::WriteProperty) {
void *_v = _a[0];
switch (_id) {
case 1: setLocalFileUrl(*reinterpret_cast< QUrl*>(_v)); break;
}
_id -= 7;
} else if (_c == QMetaObject::ResetProperty) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyDesignable) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyScriptable) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyStored) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyEditable) {
_id -= 7;
} else if (_c == QMetaObject::QueryPropertyUser) {
_id -= 7;
}
#endif // QT_NO_PROPERTIES
return _id;
}
开发者ID:NemOry,项目名称:FacebookMessengerClientUI,代码行数:45,代码来源:moc_QXmppTransferManager.cpp
示例20: QString
Track::Track( const QStringList& list )
:p(new TrackPrivate)
{
if (list.count()>9){
p->url = QUrl::fromLocalFile( list.at(0));
p->artist = list.at(1);
p->title = list.at(2);
p->album = list.at(3);
p->year = list.at(4);
p->genre = list.at(5);
p->tracknumber = list.at(6);
p->length= QString(list.at(7)).toInt();
p->counter = QString(list.at(8)).toInt();
p->rate = QString(list.at(9)).toInt();
}
if (list.count()>10)
p->flags = QFlag(list.at(10).toInt());
}
开发者ID:intfrr,项目名称:knowthelist,代码行数:18,代码来源:track.cpp
注:本文中的QFlag函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论