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. Issue with setHorizontalScrollBarPolicy in MDI area.
QtWS25 Last Chance

Issue with setHorizontalScrollBarPolicy in MDI area.

Scheduled Pinned Locked Moved Unsolved General and Desktop
mdiareaqt5.6c++ qtscrollareascrollbar
13 Posts 2 Posters 4.1k 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.
  • Y Offline
    Y Offline
    Yash001
    wrote on 1 Feb 2018, 22:22 last edited by
    #1

    Wheneve the main Widget is Maximized state at that time Scrollbar is not appear. But if main window is in NoSate (Restore Down) at that time scrollbar is appear. I don't want to change the size of Subwindow.Here I put sample code, which is similar to my project code.

    #include "MDIarea.h"
    #include <qpushbutton.h>
    #include <qlayout.h>
    #include <qmdiarea.h>
    MDIarea::MDIarea(QWidget *parent)
    : QMainWindow(parent)
    {
    QWidget *w = nullptr;
    w = new QWidget;
    w->setWindowTitle("hello");
    w->show();

    QPushButton *tilepbt;
    auto mdiArea = new QMdiArea;
    
    mdiArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
    mdiArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
    
    auto vgrid = new QVBoxLayout(w);
    auto forbutton = new QHBoxLayout();
    auto layout = new QHBoxLayout();
    
    layout->addWidget(mdiArea);
    
    QWidget *wl = nullptr;
    wl = new QWidget;
    wl->setMinimumHeight(350);
    mdiArea->addSubWindow(wl);
    mdiArea->addSubWindow(wl);
    mdiArea->addSubWindow(wl);
    mdiArea->addSubWindow(wl);
    mdiArea->addSubWindow(wl);
    mdiArea->addSubWindow(wl);
    mdiArea->addSubWindow(wl);
    mdiArea->addSubWindow(wl);
    
    forbutton->addWidget(tilepbt = new QPushButton("tile"));
    vgrid->addLayout(forbutton);
    vgrid->addLayout(layout);
    
    QList<QMetaObject::Connection> m_connections;
    	m_connections  << QObject::connect(tilepbt, &QPushButton::clicked, mdiArea, &QMdiArea::tileSubWindows);
    

    }

    Complier Output:

    MDI area.exe' (Win32): Loaded 'F:\Qt with Visula studio\Mdi area\MDI area\Win32\Debug\MDI area.exe'. Symbols loaded.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shell32.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbase.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Qt\Qt5.6.3\5.6.3\msvc2015\bin\Qt5Cored.dll'. Symbols loaded.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp140d.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\vcruntime140d.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Qt\Qt5.6.3\5.6.3\msvc2015\bin\Qt5Widgetsd.dll'. Symbols loaded.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\user32.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\SHCore.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbased.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32full.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\win32u.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp_win.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\combase.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Qt\Qt5.6.3\5.6.3\msvc2015\bin\Qt5Guid.dll'. Symbols loaded.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\bcryptprimitives.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\windows.storage.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shlwapi.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel.appcore.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\advapi32.dll'
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\powrprof.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\profapi.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ws2_32.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\mpr.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\imm32.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\tmumh\20019\AddOn\7.0.0.1137\TmUmEvt.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\psapi.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\tmumh\20019\TmMon\2.5.0.2070\tmmon.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Qt\Qt5.6.3\5.6.3\msvc2015\plugins\platforms\qwindowsd.dll'. Symbols loaded.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleaut32.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmm.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmmbase.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\uxtheme.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Program Files (x86)\Common Files\microsoft shared\ink\tiptsf.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dwmapi.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msctf.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\clbcatq.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\DataExchange.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\d3d11.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dcomp.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dxgi.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\twinapi.appcore.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rmclient.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\bcrypt.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\TextInputFramework.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\CoreUIComponents.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\CoreMessaging.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntmarta.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\WinTypes.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Qt\Qt5.6.3\5.6.3\msvc2015\plugins\imageformats\qgifd.dll'. Symbols loaded.
    'MDI area.exe' (Win32): Loaded 'C:\Qt\Qt5.6.3\5.6.3\msvc2015\plugins\imageformats\qicnsd.dll'. Symbols loaded.
    'MDI area.exe' (Win32): Loaded 'C:\Qt\Qt5.6.3\5.6.3\msvc2015\plugins\imageformats\qicod.dll'. Symbols loaded.
    'MDI area.exe' (Win32): Loaded 'C:\Qt\Qt5.6.3\5.6.3\msvc2015\plugins\imageformats\qjpegd.dll'. Symbols loaded.
    'MDI area.exe' (Win32): Loaded 'C:\Qt\Qt5.6.3\5.6.3\msvc2015\plugins\imageformats\qsvgd.dll'. Symbols loaded.
    'MDI area.exe' (Win32): Loaded 'C:\Qt\Qt5.6.3\5.6.3\msvc2015\bin\Qt5Svgd.dll'. Symbols loaded.
    'MDI area.exe' (Win32): Loaded 'C:\Qt\Qt5.6.3\5.6.3\msvc2015\plugins\imageformats\qtgad.dll'. Symbols loaded.
    'MDI area.exe' (Win32): Loaded 'C:\Qt\Qt5.6.3\5.6.3\msvc2015\plugins\imageformats\qtiffd.dll'. Symbols loaded.
    'MDI area.exe' (Win32): Loaded 'C:\Qt\Qt5.6.3\5.6.3\msvc2015\plugins\imageformats\qwbmpd.dll'. Symbols loaded.
    'MDI area.exe' (Win32): Loaded 'C:\Qt\Qt5.6.3\5.6.3\msvc2015\plugins\imageformats\qwebpd.dll'. Symbols loaded.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\UIAutomationCore.dll'. Cannot find or open the PDB file.
    onecore\com\combase\inc\comcataloghelpers.hpp(67)\combase.dll!74A18550: (caller: 74A182E0) ReturnHr(1) tid(1a70) 80004002 No such interface supported
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sxs.dll'. Cannot find or open the PDB file.
    mincore\com\oleaut32\dispatch\ups.cpp(2125)\OLEAUT32.dll!770E234F: (caller: 770E1EF1) ReturnHr(1) tid(3898) 8002801D Library not registered.
    mincore\com\oleaut32\dispatch\ups.cpp(2125)\OLEAUT32.dll!770E234F: (caller: 770E1EF1) ReturnHr(2) tid(3898) 8002801D Library not registered.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleacc.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Program Files (x86)\WordWeb\WHook.dll'. Cannot find or open the PDB file.
    'MDI area.exe' (Win32): Loaded 'C:\Windows\SysWOW64\version.dll'. Cannot find or open the PDB file.
    QWindowsWindow::setGeometry: Unable to set geometry 1366x1208+0+23 on QWidgetWindow/'QWidgetClassWindow'. Resulting geometry: 1366x705+0+23 (frame: 8, 31, 8, 8, custom margin: 0, 0, 0, 0, minimum size: 182x120, maximum size: 16777215x16777215).
    QWindowsWindow::setGeometry: Unable to set geometry 1366x1208+0+23 on QWidgetWindow/'QWidgetClassWindow'. Resulting geometry: 1366x705+0+23 (frame: 8, 31, 8, 8, custom margin: 0, 0, 0, 0, minimum size: 182x120, maximum size: 16777215x16777215).
    QWindowsWindow::setGeometry: Unable to set geometry 640x1208+363+124 on QWidgetWindow/'QWidgetClassWindow'. Resulting geometry: 640x1061+363+124 (frame: 8, 31, 8, 8, custom margin: 0, 0, 0, 0, minimum size: 182x120, maximum size: 16777215x16777215).
    QWindowsWindow::setGeometry: Unable to set geometry 640x1208+363+124 on QWidgetWindow/'QWidgetClassWindow'. Resulting geometry: 640x1061+363+124 (frame: 8, 31, 8, 8, custom margin: 0, 0, 0, 0, minimum size: 182x120, maximum size: 16777215x16777215).

    for more clarification to see the error.

    1. run the code and maximized the window and clicked on tile button
      -here you will not see the Scrollbar.
      2)now Minimized the window
      • now you can see the scrollbar.
    2. Maximized the window
      • now you can see the scrollbar. but if you click on tile button then again it will disappear.
    1 Reply Last reply
    0
    • Y Offline
      Y Offline
      Yash001
      wrote on 1 Feb 2018, 22:53 last edited by
      #2

      step for getting error

      1. run the code and maximized the window and clicked on tile button
        -here you will not see the Scrollbar.
        2)now Minimized the window
        now you can see the scrollbar.
        3)Maximized the window
        now you can see the scrollbar. but if you click on tile button then again it will disappear.
      1 Reply Last reply
      0
      • M Offline
        M Offline
        mrjj
        Lifetime Qt Champion
        wrote on 2 Feb 2018, 14:09 last edited by
        #3

        Hi
        Tried to run the code in
        Qt5.10 on win 10 and didn't see a scrollbar at all.

        You could try newest Qt and see if any difference.

        Y 1 Reply Last reply 2 Feb 2018, 17:58
        0
        • M mrjj
          2 Feb 2018, 14:09

          Hi
          Tried to run the code in
          Qt5.10 on win 10 and didn't see a scrollbar at all.

          You could try newest Qt and see if any difference.

          Y Offline
          Y Offline
          Yash001
          wrote on 2 Feb 2018, 17:58 last edited by
          #4

          @mrjj Thank you sir for your response. I am happy to use new version of Qt. as per our requirment i need to use Qt 5.6.

          M 1 Reply Last reply 2 Feb 2018, 18:01
          0
          • Y Yash001
            2 Feb 2018, 17:58

            @mrjj Thank you sir for your response. I am happy to use new version of Qt. as per our requirment i need to use Qt 5.6.

            M Offline
            M Offline
            mrjj
            Lifetime Qt Champion
            wrote on 2 Feb 2018, 18:01 last edited by
            #5

            @Yash001
            Hi
            That is fine, it was just to check if there was a bug with redrawing and it had been fixed later
            or its something completely different.
            Do you run the app in XP/win 7 or is this on win 10 ?

            Y 1 Reply Last reply 2 Feb 2018, 18:34
            0
            • M mrjj
              2 Feb 2018, 18:01

              @Yash001
              Hi
              That is fine, it was just to check if there was a bug with redrawing and it had been fixed later
              or its something completely different.
              Do you run the app in XP/win 7 or is this on win 10 ?

              Y Offline
              Y Offline
              Yash001
              wrote on 2 Feb 2018, 18:34 last edited by
              #6

              @mrjj application needs to run on Win 10, Xp , vista. I am using win 10.

              1 Reply Last reply
              0
              • Y Offline
                Y Offline
                Yash001
                wrote on 8 Feb 2018, 00:36 last edited by
                #7

                Thank you mrjj for support. Here I found the another way to setup the widget into MDI area. http://blog.qt.io/blog/2013/04/29/how-to-tile-widgets-in-a-multiple-document-interface-application/

                1 Reply Last reply
                1
                • M Offline
                  M Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on 8 Feb 2018, 09:07 last edited by
                  #8

                  So that fixes the scrollbar issue ?

                  Y 1 Reply Last reply 14 Feb 2018, 22:32
                  0
                  • M mrjj
                    8 Feb 2018, 09:07

                    So that fixes the scrollbar issue ?

                    Y Offline
                    Y Offline
                    Yash001
                    wrote on 14 Feb 2018, 22:32 last edited by Yash001
                    #9

                    @mrjj Yes it is fix. sorry for late reply. I remove the default function "tileSubWindows()" and create another function using http://blog.qt.io/blog/2013/04/29/how-to-tile-widgets-in-a-multiple-document-interface-application/.

                    1 Reply Last reply
                    1
                    • M Offline
                      M Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on 15 Feb 2018, 07:08 last edited by
                      #10

                      ok super.
                      Its good to see someone still using MDI in 2018 :)

                      Y 1 Reply Last reply 16 Feb 2018, 20:13
                      0
                      • M mrjj
                        15 Feb 2018, 07:08

                        ok super.
                        Its good to see someone still using MDI in 2018 :)

                        Y Offline
                        Y Offline
                        Yash001
                        wrote on 16 Feb 2018, 20:13 last edited by
                        #11

                        @mrjj What are the other Options insted of MDI?

                        M 1 Reply Last reply 16 Feb 2018, 20:17
                        0
                        • Y Yash001
                          16 Feb 2018, 20:13

                          @mrjj What are the other Options insted of MDI?

                          M Offline
                          M Offline
                          mrjj
                          Lifetime Qt Champion
                          wrote on 16 Feb 2018, 20:17 last edited by
                          #12

                          @Yash001
                          DockWidgets. Else not so much.

                          Y 1 Reply Last reply 16 Feb 2018, 20:35
                          0
                          • M mrjj
                            16 Feb 2018, 20:17

                            @Yash001
                            DockWidgets. Else not so much.

                            Y Offline
                            Y Offline
                            Yash001
                            wrote on 16 Feb 2018, 20:35 last edited by
                            #13

                            @mrjj Thakn you.

                            1 Reply Last reply
                            0

                            9/13

                            14 Feb 2018, 22:32

                            • Login

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