Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8723853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:42:52+00:00 2026-06-13T07:42:52+00:00

I is possible that QBuffer::open(OpenMode mode) ever returns false? Here is implementation: bool QBuffer::open(OpenMode

  • 0

I is possible that QBuffer::open(OpenMode mode) ever returns false? Here is implementation:

bool QBuffer::open(OpenMode flags)
{
    Q_D(QBuffer);

    if ((flags & Append) == Append)
        flags |= WriteOnly;
    setOpenMode(flags);
    if (!(isReadable() || isWritable())) {
        qWarning("QFile::open: File access not specified");
        return false;
    }

    if ((flags & QIODevice::Truncate) == QIODevice::Truncate) {
        d->buf->resize(o);
    }
    if ((flags & QIODevice::Append) == QIODevice::Append) // append to end of buffer
        seek(d->buf->size());
    else
        seek(o);

    return true;
}

bool QIODevice::isReadable() const
{
    return (openMode() & ReadOnly) != 0;
}

bool QIODevice::isWritable() const
{
    return (openMode() & WriteOnly) != 0;
}

I would say no. I am making this research so my flexLint code analysis won’t create new kind of warning.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T07:42:52+00:00Added an answer on June 13, 2026 at 7:42 am

    It can return false if you don’t give it the right flags. Calling QBuffer::open(QIODevice::Text), for example, would fail since that does not specify read or write mode. Apart from that, it will always return true.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible that when you have a webpage, when you open the PDF,
It's possible that I'm not really understanding how git works here, but I have
It's possible that I'm not really understanding how git works here, but I have
it it possible that in some cases NEW returns some value, for example NULL,
Is it ever possible that in the following setup template <typename T> inline void
It is possible that my question title is misleading, but here goes -- I
Is it possible that a MySQL function/stored procedure returns a query result? Because I
Is it possible that when calling multiple times this function: void Func(String spr, PictureBox
Is it possible that there are more than one certificate chain built during the
It is quite possible that I'm just looking for help finding the name of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.