Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    Unsolved Menus Truncated initially on Windows (Qt 6.2)

    General and Desktop
    3
    5
    159
    Loading More Posts
    • 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.
    • S
      stefanwoe last edited by

      In my Qt 6.2.0 application menus are truncated on initial display after starting the program on Windows 10.

      3570c403-b710-4dce-89e8-63bc88525906-grafik.png

      This only happens once per Menu (once per Edit, once per Mode etc...) - but not for all Menus. It seems not to depend on the size of the Menu. Its always the last entry that will be truncated and in all cases the second last entry is a separator.

      If i choose the menu a second time it will be fully displayed:
      5f17908d-9444-4a40-98f7-8a8dfc2878d2-grafik.png

      Is this a known problem or has anyone else seen this?
      How can i avoid this?

      JonB 1 Reply Last reply Reply Quote 0
      • S
        stefanwoe last edited by

        See also
        https://stackoverflow.com/questions/69931788/qt-6-2-menus-truncated-initially-on-windows
        and
        https://bugreports.qt.io/browse/QTBUG-98347

        1 Reply Last reply Reply Quote 3
        • JonB
          JonB @stefanwoe last edited by

          @stefanwoe
          Also see question & answer at https://forum.qt.io/topic/132185/long-menu-entry-displays-partially

          1 Reply Last reply Reply Quote 3
          • S
            stefanwoe last edited by stefanwoe

            Indeed - this line fixes the problem:
            QApplication::setStyle(QStyleFactory::create("Windows"));

            Thanks a lot.

            1 Reply Last reply Reply Quote 2
            • O
              omichel last edited by

              I found a better fix which corrects the problem without reverting to the Windows 95 style.

              QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::Floor);
              
              1 Reply Last reply Reply Quote 3
              • First post
                Last post