symanoz
symanoz

Reputation: 81

Qt: QDesktopWidget file not found

I'm trying to use the QDesktopWidget class, just to resize a window. It appears to be the main class to get the geometry of a user's screen, but Qt cannot find it.

I tried adding QT += widgets in my .pro file, followed by running qmake, but unfortunately this did not work.

Upvotes: 4

Views: 3478

Answers (1)

Yun
Yun

Reputation: 3812

From the Qt documentation (emphasis mine):

QDesktopWidget was already deprecated in Qt 5, and has been removed in Qt 6, together with QApplication::desktop().

QScreen provides equivalent functionality to query for information about available screens, screen that form a virtual desktop, and screen geometries.

Upvotes: 8

Related Questions