Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Can't move and resize QDialog

Can't move and resize QDialog

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
4 Posts 2 Posters 1.5k Views 2 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.
  • P Offline
    P Offline
    peter-70
    wrote on last edited by peter-70
    #1

    I have a BaseClass derived from QDialog and a ChildClass derived from BaseClass.

    I create an instance of ChildClass und call child.exec();

    In the BaseClass I override the showEvent. There I call:

    this->setGeometry(QRect(20, 20, 200, 200));
    QDialog::showEvent(event);
    

    I can do what ever I want, the Dialog shows always maximized.
    I'm completely stumped.
    What is wrong with the code?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What version of Qt ?
      On what platform ?
      Why are you setting the geometry in showEvent ?
      What else are you doing with that dialog ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • P Offline
        P Offline
        peter-70
        wrote on last edited by
        #3

        Qt Creator 4.6.2
        Based on Qt 5.11.1 (Clang 8.0 (Apple), 64 bit)
        From revision 1ddfb443b6
        Built on Jun 18 2018 11:52:18
        LibGL Vendor: Intel Inc.
        Renderer: Intel Iris Pro OpenGL Engine
        Version: 2.1 INTEL-12.4.7
        Shading language: 1.20
        Format: Version: 2.1 Profile: 0 Swap behavior: 2 Buffer size (RGB): 8,8,8 Depth buffer: -1 Stencil buffer: -1
        Profile: None (QOpenGLFunctions_214771104_1)
        Qt 5.11.1 (x86_64-little_endian-lp64 shared (dynamic) release build; by Clang 8.1.0 (clang-802.0.42) (Apple)) on "cocoa"
        OS: macOS 10.14 [darwin version 18.2.0]
        Architecture: x86_64; features: SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 AVX AVX2
        Features: QT_NO_EXCEPTIONS QT_NO_OPENSSL

        The App is running at iOS 12.1.4 (16D57)

        @SGaist said in Can't move and resize QDialog:

        Why are you setting the geometry in showEvent ?

        What do you mean, is this no good idea to do it there?

        What else are you doing with that dialog ?

        It is a simply information dialog for the user, such like a message box. It is not necessary to show it as a maximized (full screen) window

        SGaistS 1 Reply Last reply
        0
        • P peter-70

          Qt Creator 4.6.2
          Based on Qt 5.11.1 (Clang 8.0 (Apple), 64 bit)
          From revision 1ddfb443b6
          Built on Jun 18 2018 11:52:18
          LibGL Vendor: Intel Inc.
          Renderer: Intel Iris Pro OpenGL Engine
          Version: 2.1 INTEL-12.4.7
          Shading language: 1.20
          Format: Version: 2.1 Profile: 0 Swap behavior: 2 Buffer size (RGB): 8,8,8 Depth buffer: -1 Stencil buffer: -1
          Profile: None (QOpenGLFunctions_214771104_1)
          Qt 5.11.1 (x86_64-little_endian-lp64 shared (dynamic) release build; by Clang 8.1.0 (clang-802.0.42) (Apple)) on "cocoa"
          OS: macOS 10.14 [darwin version 18.2.0]
          Architecture: x86_64; features: SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 AVX AVX2
          Features: QT_NO_EXCEPTIONS QT_NO_OPENSSL

          The App is running at iOS 12.1.4 (16D57)

          @SGaist said in Can't move and resize QDialog:

          Why are you setting the geometry in showEvent ?

          What do you mean, is this no good idea to do it there?

          What else are you doing with that dialog ?

          It is a simply information dialog for the user, such like a message box. It is not necessary to show it as a maximized (full screen) window

          SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @peter-70 said in Can't move and resize QDialog:

          Qt Creator 4.6.2
          Based on Qt 5.11.1 (Clang 8.0 (Apple), 64 bit)

          That's the version of Qt used to build Qt Creator not the one you are using to build your application.

          While the QtWidgets module can be used on iOS, it's not designed for it. You will have better results with QtQuick.

          That said, why are you setting the geometry of the dialog ? They usually handle their size pretty well.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1

          • Login

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