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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:04:17+00:00 2026-05-23T03:04:17+00:00

http://doc.qt.io/qt-5/qdesktopwidget.html#obtaining-a-desktop-widget The QApplication::desktop() function is used to get an instance of QDesktopWidget. I don’t

  • 0

http://doc.qt.io/qt-5/qdesktopwidget.html#obtaining-a-desktop-widget

The QApplication::desktop() function is used to get an instance of QDesktopWidget.

I don’t understand why should you use QApplication::desktop(), when you can just directly call QDesktopWidget() class.
What is the difference between

desktop = QApplication.desktop() 

and

desktop = QDesktopWidget() 

They look like the same. But Windows(OS) throws warning on exit when using QDesktopWidget(). So there should be some difference.

How they differs?

  • 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-23T03:04:17+00:00Added an answer on May 23, 2026 at 3:04 am

    They may look the same but are not. On the C++ side the static desktop() function is using a singleton pattern – there is only one desktop and it is represented by a static variable, which may (or may not) be created on request. QDesktopWidget() is a constructor, which is not accessible for the “outside world” to guarantee the uniqueness of the singleton.

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

Sidebar

Related Questions

I didn't find it on their doc http://www.sqlite.org/lang_corefunc.html So just want to get confirm
I read this: http://symfony.com/doc/current/book/service_container.html It said: $mailer = $this->get('my_mailer'); As an added bonus, the
Using the guide http://symfony.com/doc/current/cookbook/doctrine/file_uploads.html i'm trying to customize error message, but i've a problem:
According to the Grails literature http://grails.org/doc/2.0.x/ref/Domain%20Classes/getAll.html I should be able to do this def
I'm trying to follow this documentation on Symfony : http://symfony.com/doc/current/book/forms.html ok so here is
Mysql supports prepared statements in this way: http://dev.mysql.com/doc/refman/5.0/en/sql-syntax-prepared-statements.html Is there a support for it
somebody knows where can I find more examples like these ones http://doc.trolltech.com/4.3/tutorial.html I want
I'm trying to compile the basic tutorial program at http://doc.trolltech.com/4.4/mainwindows-application.html and running into a
I'm pretty new to QML. According to the QML documentation at http://doc.qt.nokia.com/4.7-snapshot/qdeclarativescope.html , the
With http://doc.qt.nokia.com/4.7-snapshot/qtwebkit-bridge.html we can expose Qt 's QObject as glabal JS objects in browser,

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.