Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How center a QQuickView on screen without QtWidgets module? [SOLVED]
Forum Updated to NodeBB v4.3 + New Features

How center a QQuickView on screen without QtWidgets module? [SOLVED]

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 3 Posters 2.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    Interima.x2
    wrote on last edited by
    #1

    How i can center QQuickView without using QDesktopWidget hints or any QWidget based class?

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      ZapB
      wrote on last edited by
      #2

      Take a look at QScreen::size() and friends. Then use functions on QWindow to set it's geometry.

      Nokia Certified Qt Specialist
      Interested in hearing about Qt related work

      1 Reply Last reply
      0
      • I Offline
        I Offline
        Interima.x2
        wrote on last edited by
        #3

        But in Qt 4.8 docs i see that:

        The QScreen class is a base class for screen drivers in Qt for Embedded Linux.
        Note that this class is only available in Qt for Embedded Linux.

        in Qt 5.0 docs i find that:

        The QScreen class is used to query screen properties.
        This class was introduced in QtGui 5.0.

        But i can't create object of this class because constructor need pointer to QPlatformScreen.

        but in qpa/qplatformscreen.h :

        //
        // W A R N I N G
        // -------------
        //
        // This file is part of the QPA API and is not meant to be used
        // in applications. Usage of this API may make your code
        // source and binary incompatible with future versions of Qt.
        //

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lgeyer
          wrote on last edited by
          #4

          http://qt-project.org/doc/qt-5.0/qtgui/qguiapplication.html#primaryScreen
          http://qt-project.org/doc/qt-5.0/qtgui/qguiapplication.html#screens

          1 Reply Last reply
          0
          • I Offline
            I Offline
            Interima.x2
            wrote on last edited by
            #5

            Thank to ZapB and Lukas Geyer.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved