Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Menus Truncated initially on Windows (Qt 6.2)

Menus Truncated initially on Windows (Qt 6.2)

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 435 Views
  • 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 Offline
    S Offline
    stefanwoe
    wrote on last edited by
    #1

    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?

    JonBJ 1 Reply Last reply
    0
    • S Offline
      S Offline
      stefanwoe
      wrote on last edited by
      #2

      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
      3
      • S stefanwoe

        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?

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by
        #3

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

        1 Reply Last reply
        3
        • S Offline
          S Offline
          stefanwoe
          wrote on last edited by stefanwoe
          #4

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

          Thanks a lot.

          1 Reply Last reply
          2
          • O Offline
            O Offline
            omichel
            wrote on last edited by
            #5

            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
            3

            • Login

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