本文整理汇总了C++中setFlags函数的典型用法代码示例。如果您正苦于以下问题:C++ setFlags函数的具体用法?C++ setFlags怎么用?C++ setFlags使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setFlags函数的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: defined
bool QFile::open( int m )
{
if ( isOpen() ) { // file already open
#if defined(QT_CHECK_STATE)
qWarning( "QFile::open: File already open" );
#endif
return FALSE;
}
if ( fn.isEmpty() ) { // no file name defined
#if defined(QT_CHECK_NULL)
qWarning( "QFile::open: No file name specified" );
#endif
return FALSE;
}
init(); // reset params
setMode( m );
if ( !(isReadable() || isWritable()) ) {
#if defined(QT_CHECK_RANGE)
qWarning( "QFile::open: File access not specified" );
#endif
return FALSE;
}
bool ok = TRUE;
struct stat st;
if ( isRaw() ) {
int oflags = O_RDONLY;
if ( isReadable() && isWritable() )
oflags = O_RDWR;
else if ( isWritable() )
oflags = O_WRONLY;
if ( flags() & IO_Append ) { // append to end of file?
if ( flags() & IO_Truncate )
oflags |= (O_CREAT | O_TRUNC);
else
oflags |= (O_APPEND | O_CREAT);
setFlags( flags() | IO_WriteOnly ); // append implies write
} else if ( isWritable() ) { // create/trunc if writable
if ( flags() & IO_Truncate )
oflags |= (O_CREAT | O_TRUNC);
else
oflags |= O_CREAT;
}
#if defined(HAS_TEXT_FILEMODE)
if ( isTranslated() )
oflags |= OPEN_TEXT;
else
oflags |= OPEN_BINARY;
#endif
#if defined(HAS_ASYNC_FILEMODE)
if ( isAsynchronous() )
oflags |= OPEN_ASYNC;
#endif
fd = qt_open( QFile::encodeName(fn), oflags, 0666 );
if ( fd != -1 ) { // open successful
::fstat( fd, &st ); // get the stat for later usage
} else {
ok = FALSE;
}
} else { // buffered file I/O
QCString perm;
char perm2[4];
bool try_create = FALSE;
if ( flags() & IO_Append ) { // append to end of file?
setFlags( flags() | IO_WriteOnly ); // append implies write
perm = isReadable() ? "a+" : "a";
} else {
if ( isReadWrite() ) {
if ( flags() & IO_Truncate ) {
perm = "w+";
} else {
perm = "r+";
try_create = TRUE; // try to create if not exists
}
} else if ( isReadable() ) {
perm = "r";
} else if ( isWritable() ) {
perm = "w";
}
}
qstrcpy( perm2, perm );
#if defined(HAS_TEXT_FILEMODE)
if ( isTranslated() )
strcat( perm2, "t" );
else
strcat( perm2, "b" );
#endif
for (;;) { // At most twice
fh = fopen( QFile::encodeName(fn), perm2 );
if ( !fh && try_create ) {
perm2[0] = 'w'; // try "w+" instead of "r+"
try_create = FALSE;
} else {
break;
}
}
if ( fh ) {
::fstat( fileno(fh), &st ); // get the stat for later usage
//.........这里部分代码省略.........
开发者ID:aroraujjwal,项目名称:qt3,代码行数:101,代码来源:qfile_unix.cpp
示例2: item_buffer
void LLInventoryItem::unpackBinaryBucket(U8* bin_bucket, S32 bin_bucket_size)
{
// Early exit on an empty binary bucket.
if (bin_bucket_size <= 1) return;
if (NULL == bin_bucket)
{
llerrs << "unpackBinaryBucket failed. bin_bucket is NULL." << llendl;
return;
}
// Convert the bin_bucket into a string.
std::vector<char> item_buffer(bin_bucket_size+1);
memcpy(&item_buffer[0], bin_bucket, bin_bucket_size); /* Flawfinder: ignore */
item_buffer[bin_bucket_size] = '\0';
std::string str(&item_buffer[0]);
lldebugs << "item buffer: " << str << llendl;
// Tokenize the string.
typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
boost::char_separator<char> sep("|", "", boost::keep_empty_tokens);
tokenizer tokens(str, sep);
tokenizer::iterator iter = tokens.begin();
// Extract all values.
LLUUID item_id;
item_id.generate();
setUUID(item_id);
LLAssetType::EType type;
type = (LLAssetType::EType)(atoi((*(iter++)).c_str()));
setType( type );
LLInventoryType::EType inv_type;
inv_type = (LLInventoryType::EType)(atoi((*(iter++)).c_str()));
setInventoryType( inv_type );
std::string name((*(iter++)).c_str());
rename( name );
LLUUID creator_id((*(iter++)).c_str());
LLUUID owner_id((*(iter++)).c_str());
LLUUID last_owner_id((*(iter++)).c_str());
LLUUID group_id((*(iter++)).c_str());
PermissionMask mask_base = strtoul((*(iter++)).c_str(), NULL, 16);
PermissionMask mask_owner = strtoul((*(iter++)).c_str(), NULL, 16);
PermissionMask mask_group = strtoul((*(iter++)).c_str(), NULL, 16);
PermissionMask mask_every = strtoul((*(iter++)).c_str(), NULL, 16);
PermissionMask mask_next = strtoul((*(iter++)).c_str(), NULL, 16);
LLPermissions perm;
perm.init(creator_id, owner_id, last_owner_id, group_id);
perm.initMasks(mask_base, mask_owner, mask_group, mask_every, mask_next);
setPermissions(perm);
//lldebugs << "perm: " << perm << llendl;
LLUUID asset_id((*(iter++)).c_str());
setAssetUUID(asset_id);
std::string desc((*(iter++)).c_str());
setDescription(desc);
LLSaleInfo::EForSale sale_type;
sale_type = (LLSaleInfo::EForSale)(atoi((*(iter++)).c_str()));
S32 price = atoi((*(iter++)).c_str());
LLSaleInfo sale_info(sale_type, price);
setSaleInfo(sale_info);
U32 flags = strtoul((*(iter++)).c_str(), NULL, 16);
setFlags(flags);
time_t now = time(NULL);
setCreationDate(now);
}
开发者ID:ArxNet,项目名称:SingularityViewer,代码行数:74,代码来源:llinventory.cpp
示例3: Text
Jump::Jump(Score* s)
: Text(s)
{
setFlags(ELEMENT_MOVABLE | ELEMENT_SELECTABLE);
setTextStyle(s->textStyle(TEXT_STYLE_REPEAT));
}
开发者ID:aiena,项目名称:MuseScore,代码行数:6,代码来源:repeat.cpp
示例4: number
Node::Node(int f_number) :
number(f_number), bckColor(Qt::white)
{
setFlags(ItemIsMovable | ItemIsSelectable | ItemSendsGeometryChanges);
}
开发者ID:olefav,项目名称:graph,代码行数:5,代码来源:node.cpp
示例5: color
BlackEdgeTextItem::BlackEdgeTextItem()
:skip(0), color(Qt::black), outline(0)
{
setFlags(ItemIsMovable | ItemIsFocusable);
}
开发者ID:takashiro,项目名称:OnePieceBang,代码行数:5,代码来源:cardeditor.cpp
示例6: QGraphicsObject
Path::Path(QGraphicsObject *parent) : QGraphicsObject(parent){
dr = 5;
setFlags(ItemIsSelectable|ItemIsMovable);
}
开发者ID:luigialberti,项目名称:XYstepper,代码行数:5,代码来源:path.cpp
示例7: QSGGeometryNode
VideoNode::VideoNode()
: QSGGeometryNode()
{
setFlags(OwnsGeometry | OwnsMaterial, true);
setMaterialTypeSolidBlack();
}
开发者ID:dejunk,项目名称:gstreamer,代码行数:6,代码来源:videonode.cpp
示例8: QTableWidgetItem
/**
* Helper function to create new item for Diagnosis table.
* @return Created and initialized item with text
*/
QTableWidgetItem* MuonSequentialFitDialog::createTableWidgetItem(const QString& text)
{
auto newItem = new QTableWidgetItem(text);
newItem->setFlags(newItem->flags() ^ Qt::ItemIsEditable);
return newItem;
}
开发者ID:spaceyatom,项目名称:mantid,代码行数:10,代码来源:MuonSequentialFitDialog.cpp
示例9: setFlags
void UserActionElementSet::setFlags(Node* node, unsigned flags)
{
if (!node->isElementNode())
return;
return setFlags(toElement(node), flags);
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:6,代码来源:UserActionElementSet.cpp
示例10: setPixmap
KeyFrameItem::KeyFrameItem()
{
setPixmap(QPixmap(s_keyFramePixmap));
setFlags(ItemIsMovable);
setCacheMode(DeviceCoordinateCache);
}
开发者ID:skyrpex,项目名称:QxTimeLineEditor,代码行数:6,代码来源:keyframeitem.cpp
示例11: QListWidgetItem
KonqProfileDlg::KonqProfileItem::KonqProfileItem( KListWidget *parent, const QString & text )
: QListWidgetItem( text, parent ), m_profileName( text )
{
setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
}
开发者ID:blue-shell,项目名称:folderview,代码行数:5,代码来源:konqprofiledlg.cpp
示例12: setFlags
void Node::setFlags(int f)
{
setFlags(static_cast<NodeFlags>(f));
}
开发者ID:ospray,项目名称:OSPRay,代码行数:4,代码来源:Node.cpp
示例13: setFlags
Graph::Graph(int flags) {
setFlags(flags);
}
开发者ID:jpsember,项目名称:mcheck,代码行数:3,代码来源:Graph.cpp
示例14: QQuickWindow
KonvergoWindow::KonvergoWindow(QWindow* parent) : QQuickWindow(parent), m_debugLayer(false), m_lastScale(1.0)
{
// NSWindowCollectionBehaviorFullScreenPrimary is only set on OSX if Qt::WindowFullscreenButtonHint is set on the window.
setFlags(flags() | Qt::WindowFullscreenButtonHint);
m_infoTimer = new QTimer(this);
m_infoTimer->setInterval(1000);
installEventFilter(new EventFilter(this));
connect(m_infoTimer, &QTimer::timeout, this, &KonvergoWindow::updateDebugInfo);
InputComponent::Get().registerHostCommand("close", this, "close");
InputComponent::Get().registerHostCommand("toggleDebug", this, "toggleDebug");
InputComponent::Get().registerHostCommand("reload", this, "reloadWeb");
InputComponent::Get().registerHostCommand("fullscreen", this, "toggleFullscreen");
#ifdef TARGET_RPI
// On RPI, we use dispmanx layering - the video is on a layer below Konvergo,
// and during playback the Konvergo window is partially transparent. The OSD
// will be visible on top of the video as part of the Konvergo window.
setColor(QColor("transparent"));
#else
setColor(QColor("#111111"));
#endif
loadGeometry();
m_lastScale = CalculateScale(size());
connect(SettingsComponent::Get().getSection(SETTINGS_SECTION_MAIN), &SettingsSection::valuesUpdated,
this, &KonvergoWindow::updateMainSectionSettings);
connect(this, &KonvergoWindow::visibilityChanged,
this, &KonvergoWindow::onVisibilityChanged);
connect(this, &KonvergoWindow::enableVideoWindowSignal,
this, &KonvergoWindow::enableVideoWindow, Qt::QueuedConnection);
// connect(QGuiApplication::desktop(), &QDesktopWidget::screenCountChanged,
// this, &KonvergoWindow::onScreenCountChanged);
connect(&PlayerComponent::Get(), &PlayerComponent::windowVisible,
this, &KonvergoWindow::playerWindowVisible);
connect(&PlayerComponent::Get(), &PlayerComponent::playbackStarting,
this, &KonvergoWindow::playerPlaybackStarting);
// this is using old syntax because ... reasons. QQuickCloseEvent is not public class
connect(this, SIGNAL(closing(QQuickCloseEvent*)), this, SLOT(closingWindow()));
connect(qApp, &QCoreApplication::aboutToQuit, this, &KonvergoWindow::saveGeometry);
if (!SystemComponent::Get().isOpenELEC())
{
// this is such a hack. But I could not get it to enter into fullscreen
// mode if I didn't trigger this after a while.
//
QTimer::singleShot(500, [=]() {
updateFullscreenState();
});
}
else
{
setWindowState(Qt::WindowFullScreen);
}
emit enableVideoWindowSignal();
}
开发者ID:SHsamir,项目名称:Repository,代码行数:68,代码来源:KonvergoWindow.cpp
示例15: _identities_root
//.........这里部分代码省略.........
connect(ui->actionSelect_All, &QAction::triggered, this, &KeyhoteeMainWindow::onSelectAll);
// Identity
connect(ui->actionNew_identity, &QAction::triggered, this, &KeyhoteeMainWindow::onNewIdentity);
connect(ui->actionEnable_Mining, &QAction::toggled, this, &KeyhoteeMainWindow::onEnableMining);
// Mail
connect(ui->actionNew_Message, &QAction::triggered, this, &KeyhoteeMainWindow::newMailMessage);
connect(ui->actionSave_attachement, &QAction::triggered, this, &KeyhoteeMainWindow::onSaveAttachement);
// Contact
connect(ui->actionNew_Contact, &QAction::triggered, this, &KeyhoteeMainWindow::addContact);
connect(ui->actionSet_Icon, &QAction::triggered, this, &KeyhoteeMainWindow::onSetIcon);
connect(ui->actionShow_Contacts, &QAction::triggered, this, &KeyhoteeMainWindow::showContacts);
connect(ui->actionRequest_authorization, &QAction::triggered, this, &KeyhoteeMainWindow::onRequestAuthorization);
connect(ui->actionShare_contact, &QAction::triggered, this, &KeyhoteeMainWindow::onShareContact);
// Help
connect(ui->actionDiagnostic, &QAction::triggered, this, &KeyhoteeMainWindow::onDiagnostic);
connect(ui->actionAbout, &QAction::triggered, this, &KeyhoteeMainWindow::onAbout);
connect(ui->splitter, &QSplitter::splitterMoved, this, &KeyhoteeMainWindow::sideBarSplitterMoved);
connect(ui->side_bar, &TreeWidgetCustom::itemSelectionChanged, this, &KeyhoteeMainWindow::onSidebarSelectionChanged);
connect(ui->side_bar, &TreeWidgetCustom::itemDoubleClicked, this, &KeyhoteeMainWindow::onSidebarDoubleClicked);
connect(ui->side_bar, &TreeWidgetCustom::itemContactRemoved, this, &KeyhoteeMainWindow::onItemContactRemoved);
connect(ui->side_bar, &TreeWidgetCustom::itemContextAcceptRequest, this, &KeyhoteeMainWindow::onItemContextAcceptRequest);
connect(ui->side_bar, &TreeWidgetCustom::itemContextDenyRequest, this, &KeyhoteeMainWindow::onItemContextDenyRequest);
connect(ui->side_bar, &TreeWidgetCustom::itemContextBlockRequest, this, &KeyhoteeMainWindow::onItemContextBlockRequest);
//connect( _search_edit, SIGNAL(textChanged(QString)), this, SLOT(searchEditChanged(QString)) );
connect(_search_edit, &QLineEdit::textChanged, this, &KeyhoteeMainWindow::searchEditChanged);
auto space2 = ui->side_bar->topLevelItem(TopLevelItemIndexes::Space2);
auto space3 = ui->side_bar->topLevelItem(TopLevelItemIndexes::Space3);
auto space_flags = space2->flags() & (~Qt::ItemFlags(Qt::ItemIsSelectable) );
space_flags |= Qt::ItemNeverHasChildren;
space2->setFlags(space_flags);
space3->setFlags(space_flags);
//_identities_root = ui->side_bar->topLevelItem(TopLevelItemIndexes::Identities);
_mailboxes_root = ui->side_bar->topLevelItem(TopLevelItemIndexes::Mailboxes);
_contacts_root = ui->side_bar->topLevelItem(TopLevelItemIndexes::Contacts);
_wallets_root = ui->side_bar->topLevelItem(TopLevelItemIndexes::Wallets);
_requests_root = ui->side_bar->topLevelItem(TopLevelItemIndexes::Requests);
_contacts_root->setExpanded(true);
_requests_root->setExpanded(true);
_requests_root->setHidden(true);
//_identities_root->setExpanded(true);
_mailboxes_root->setExpanded(true);
_inbox_root = _mailboxes_root->child(Inbox);
_drafts_root = _mailboxes_root->child(Drafts);
_out_box_root = _mailboxes_root->child(Outbox);
_sent_root = _mailboxes_root->child(Sent);
_wallets_root->setExpanded(true);
_bitcoin_root = _wallets_root->child(Bitcoin);
_bitshares_root = _wallets_root->child(BitShares);
_litecoin_root = _wallets_root->child(Litecoin);
auto app = bts::application::instance();
auto profile = app->get_profile();
auto idents = profile->identities();
auto addressbook = profile->get_addressbook();
_addressbook_model = new AddressBookModel(this, addressbook);
_inbox_model = new MailboxModel(this, profile, profile->get_inbox_db(), *_addressbook_model, false);
_draft_model = new MailboxModel(this, profile, profile->get_draft_db(), *_addressbook_model, true);
开发者ID:clar,项目名称:keyhotee,代码行数:67,代码来源:KeyhoteeMainWindow.cpp
示例16: setFlags
Document::Document()
{
setFlags(FLAG_RESIZABLE);
}
开发者ID:SirIvanMoReau,项目名称:lincity-ng,代码行数:4,代码来源:Document.cpp
示例17: ProcessorObserver
ProcessorGraphicsItem::ProcessorGraphicsItem(Processor* processor)
: ProcessorObserver()
, LabelGraphicsItemObserver()
, processor_(processor)
, processorMeta_(nullptr)
, progressItem_(nullptr)
, statusItem_(nullptr)
, linkItem_(nullptr)
, highlight_(false)
#if IVW_PROFILING
, processCount_(0)
, countLabel_(nullptr)
, maxEvalTime_(0.0)
, evalTime_(0.0)
, totEvalTime_(0.0)
#endif
{
setZValue(PROCESSORGRAPHICSITEM_DEPTH);
setFlags(ItemIsMovable | ItemIsSelectable | ItemIsFocusable | ItemSendsGeometryChanges);
setCacheMode(QGraphicsItem::DeviceCoordinateCache);
setRect(-width / 2, -height / 2, width, height);
QGraphicsDropShadowEffect* processorShadowEffect = new QGraphicsDropShadowEffect();
processorShadowEffect->setOffset(3.0);
processorShadowEffect->setBlurRadius(3.0);
setGraphicsEffect(processorShadowEffect);
nameLabel_ = new LabelGraphicsItem(this);
nameLabel_->setCrop(9, 8);
nameLabel_->setPos(-width / 2.0 + labelHeight, -height / 2.0 + 0.6 * labelHeight);
nameLabel_->setDefaultTextColor(Qt::white);
QFont nameFont("Segoe", labelHeight, QFont::Black, false);
nameFont.setPixelSize(pointSizeToPixelSize(labelHeight));
nameLabel_->setFont(nameFont);
LabelGraphicsItemObserver::addObservation(nameLabel_);
classLabel_ = new LabelGraphicsItem(this);
classLabel_->setCrop(9, 8);
classLabel_->setPos(-width / 2.0 + labelHeight, -height / 2.0 + labelHeight * 2.0);
classLabel_->setDefaultTextColor(Qt::lightGray);
QFont classFont("Segoe", labelHeight, QFont::Normal, true);
classFont.setPixelSize(pointSizeToPixelSize(labelHeight));
classLabel_->setFont(classFont);
nameLabel_->setText(QString::fromStdString(processor_->getIdentifier()));
classLabel_->setText(QString::fromStdString(processor_->getDisplayName() + " "
+ processor_->getTags().getString()));
processor_->ProcessorObservable::addObserver(this);
processorMeta_ = processor->getMetaData<ProcessorMetaData>(ProcessorMetaData::CLASS_IDENTIFIER);
processorMeta_->addObserver(this);
linkItem_ = new ProcessorLinkGraphicsItem(this);
std::vector<Inport*> inports = processor_->getInports();
std::vector<Outport*> outports = processor_->getOutports();
inportX = rect().left() + 12.5f;
inportY = rect().top() + 4.5f;
outportX = rect().left() + 12.5f;
outportY = rect().bottom() - 4.5f;
for (auto& inport : inports) {
addInport(inport);
}
for (auto& outport : outports) {
addOutport(outport);
}
statusItem_ = new ProcessorStatusGraphicsItem(this, processor_);
if (auto progressBarOwner = dynamic_cast<ProgressBarOwner*>(processor_)) {
progressItem_ =
new ProcessorProgressGraphicsItem(this, &(progressBarOwner->getProgressBar()));
progressBarOwner->getProgressBar().ActivityIndicator::addObserver(statusItem_);
}
if (auto activityInd = dynamic_cast<ActivityIndicatorOwner*>(processor_)){
activityInd->getActivityIndicator().addObserver(statusItem_);
}
#if IVW_PROFILING
countLabel_ = new LabelGraphicsItem(this);
countLabel_->setCrop(9,8);
countLabel_->setPos(rect().left() + labelHeight, height / 2 - labelHeight*2.5);
countLabel_->setDefaultTextColor(Qt::lightGray);
countLabel_->setFont(classFont);
countLabel_->setTextWidth(width - 2*labelHeight);
#endif
setVisible(processorMeta_->isVisible());
setSelected(processorMeta_->isSelected());
setPos(QPointF(processorMeta_->getPosition().x, processorMeta_->getPosition().y));
}
开发者ID:Ojaswi,项目名称:inviwo,代码行数:96,代码来源:processorgraphicsitem.cpp
注:本文中的setFlags函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论