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 3954358
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T02:05:17+00:00 2026-05-20T02:05:17+00:00

I see Qt has a nifty class name QUrlInfo. It has methods/functions that I’d

  • 0

I see Qt has a nifty class name QUrlInfo. It has methods/functions that I’d like to use but I’m confused about how to use this class. The initialization seems very strange and awkward.
http://doc.qt.io/qt-4.8/qurlinfo.html#setLastModified

For example:

I’d like to use its method named QUrlInfo::setLastModified so that I can set the lastModified timestamp for a local file. (also on a shared netw file but right now I just want to focus on a local file).

Let’s say that the local file is “D:/dir1/dir2/file.txt”.

How can I use QUrlInfo when I only have the fullFileName (“D:/dir1/dir2/file.txt”) of an item and wish to use QUrlInfo’s GET and SET methods? In particular I’d like an example of how I can create a QUrlInfo object and use its QUrlInfo::setLastModified method.

Deeper explanation:

My main source of confusion comes from the fact that its constructor looks like the
following

//Version 1: Problem is you must already have a QUrlInfo object.
QUrlInfo ( const QUrlInfo & ui )

//Version2: Problem is you must already know everything about the file.
//This makes QUrlInfo objects large set of GET methods useless for the most part
//since you must already know all the GET info prior to making a QUrlInfo object.
//Chicken and egg scenario.  I don't see what is point of making a class that gets
//info... but... you must already know all that info to begin with or you can't
// initialize the the class.  
QUrlInfo ( const QString & name, int permissions, const QString & owner, 
const QString & group, qint64 size, const QDateTime & lastModified, 
const QDateTime & lastRead, bool isDir, bool isFile, bool isSymLink, 
bool isWritable, bool isReadable, bool isExecutable )

//Version3: Same problem as in version 2.
QUrlInfo ( const QUrl & url, int permissions, const QString & owner, 
const QString & group, qint64 size, const QDateTime & lastModified, 
const QDateTime & lastRead, bool isDir, bool isFile, bool isSymLink, 
bool isWritable, bool isReadable, bool isExecutable )
  • 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-05-20T02:05:18+00:00Added an answer on May 20, 2026 at 2:05 am

    From the docs..

    Note that setting values does not affect the underlying resource that the QUrlInfo provides information about; for example if you call setWritable(true) on a read-only resource the only thing changed is the QUrlInfo object, not the resource.

    This class is only meant for managing information that you already know about a resource.

    There are some attributes that can be set using QFile but these are limited and come with warnings in the docs as the behavior is OS dependent. You will likely need to use native APIs to manipulate file attributes reliably.

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

Sidebar

Related Questions

I see that Flex3 has a class called ApplicationControlBar dedicated to holding components that
I see that apple has implemented a max size for the actual application but
So I see that Assert has dozens of methods that seem to do essentially
The R language has a nifty feature for defining functions that can take a
Almost every Express app I see has an app.use statement for middleware but I
I see that Spring has a @Required annotation to mark member variables in beans
I want to see if anyone has a better design for a class (class
I'm trying to use Boost regex to see if something has an integer in
I have a org.w3c.dom.Node object. I would like to see if it has any
Stackoverflow has a nifty badge system. One thing I noticed is that badges are

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.