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. Blank client area
Qt 6.11 is out! See what's new in the release blog

Blank client area

Scheduled Pinned Locked Moved Solved General and Desktop
20 Posts 3 Posters 3.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.
  • jsulmJ jsulm

    @Perdrix said in Blank client area:

    The StackingDlg has ended up as free-floating window

    How do you show StackingDlg? And does it have a parent?

    PerdrixP Offline
    PerdrixP Offline
    Perdrix
    wrote on last edited by
    #11

    @jsulm stackingDlg = new DSS::StackingDlg(stackedWidget);

    So yes it has a parent of the stackedWidget whose parent in turn is the splitter.

    As you can see from the code I posted.

    It will be shown when the QWinWidget is shown by the call to showCentered() (won't it?).

    D.

    1 Reply Last reply
    0
    • PerdrixP Offline
      PerdrixP Offline
      Perdrix
      wrote on last edited by
      #12

      Any further thoughts guys?

      1 Reply Last reply
      0
      • PerdrixP Offline
        PerdrixP Offline
        Perdrix
        wrote on last edited by
        #13

        I'm still getting nowhere with this issue - it has to be a problem with the code I've posted, but for the life of me I cannot see what.

        D.

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

          Can you show the code where you create the hierarchy ?
          I am currently unsure that you are using QWinWidget at the right place.

          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
          • PerdrixP Offline
            PerdrixP Offline
            Perdrix
            wrote on last edited by
            #15

            Here you go:

            BOOL CDeepStackerDlg::OnInitDialog()
            {
            	ZFUNCTRACE_RUNTIME();
            	ZTRACE_RUNTIME("Initializing Main Dialog");
            	CDialog::OnInitDialog();
            	ZTRACE_RUNTIME("Initializing Main Dialog - ok");
            
            	widget = new QWinWidget(this);
            	QVBoxLayout* verticalLayout { new QVBoxLayout(widget) };
            	verticalLayout->setObjectName("verticalLayout");
            	ZTRACE_RUNTIME("Creating Horizontal Splitter");
            	splitter = new QSplitter(Qt::Horizontal, widget);
            	splitter->setObjectName("splitter");
            
            	ZTRACE_RUNTIME("Creating Explorer Bar (Left Panel)");
            	explorerBar = new ExplorerBar(splitter);
            	
            	explorerBar->setObjectName("explorerBar");
            	splitter->addWidget(explorerBar);
            
            	ZTRACE_RUNTIME("Creating stackedWidget");
            	stackedWidget = new QStackedWidget(splitter);
            	stackedWidget->setObjectName("stackedWidget");
            	splitter->addWidget(stackedWidget);
            
            	ZTRACE_RUNTIME("Creating Stacking Panel");
            	stackingDlg = new DSS::StackingDlg(stackedWidget);
            	stackingDlg->setObjectName("stackingDlg");
            
            	ZTRACE_RUNTIME("Adding Stacking Panel to stackedWidget"); 
            	stackedWidget->addWidget(stackingDlg);
            	stackedWidget->setCurrentWidget(stackingDlg);
            
            	splitter->setStretchFactor(1, 1);		// Want Stacking part to take any spare space.
            
            	verticalLayout->addWidget(splitter);
            
            	stackedWidget->show();
            	splitter->show();
            	widget->move(0, 0);
            	widget->show();
            
            

            What's really weird is that if I grab the splitter bar next to the "ExplorerBar", and move it to the right, the StackingDlg Window is changed as if it were not a separate window.

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

              The thing that I find strange in your code is widget = new QWinWidget(this);. QWinWidget takes an HWND as first parameter which I suspect this is not and that is likely the source of your issue.

              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
              • PerdrixP Offline
                PerdrixP Offline
                Perdrix
                wrote on last edited by Perdrix
                #17

                The QWinWidget ctor I'm using eats a CWnd*

                QWinWidget::QWinWidget(CWnd *parentWnd, QObject *parent, Qt::WindowFlags f)

                and as a CDialog sub-class, the this pointer will definitely point to a CWnd.

                So I don't believe that's the issue (and I don't think the compiler would have let me pass a CWnd* to a ctor that ate an hwnd)
                D.

                1 Reply Last reply
                0
                • PerdrixP Offline
                  PerdrixP Offline
                  Perdrix
                  wrote on last edited by Perdrix
                  #18

                  I know you probably wouldn't normally do so, but given how oddly this is behaving, if you want to debug this problem you can download the entire project which builds with VS2019 (Community edition), Qt VSTools and Qt 15.5.2 from:

                  https://github.com/deepskystacker/DSS/tree/master/DeepSkyStacker

                  The project to build would be the DeepSkyStacker project (Debug, x64).

                  The "solution" file is DeepSkyStacker.VS2019.sln

                  The code in question is in DeepStackerDlg.cpp at line 266 and following:

                  D.

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

                    I currently do not have a Windows machine at hand so I can't check that directly.

                    Did you consider starting from the QWinWidget example and build something similar to that dialog to see where it starts behaving strangely ?

                    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
                    • PerdrixP Offline
                      PerdrixP Offline
                      Perdrix
                      wrote on last edited by
                      #20

                      Problem found! It works a lot better if I make the StackingDlg a Widget NOT a QDialog

                      BLUSH

                      1 Reply Last reply
                      2

                      • Login

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