Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. What is the differerece in MDI code?
Forum Updated to NodeBB v4.3 + New Features

What is the differerece in MDI code?

Scheduled Pinned Locked Moved Unsolved C++ Gurus
4 Posts 2 Posters 748 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by
    #1

    Here is "main window" defined in MDI example

    MainWindow::MainWindow()
    : mdiArea(new QMdiArea)

    after mainWindow is defined in "main"
    ( Can somebody give non English speaking native VERBAL explanation of the above syntax? PLEASE )

    Here is same in QMDIAreaClass

    QMainWindow *mainWindow = new QMainWindow;
    mainWindow->setCentralWidget(mdiArea); 
    

    It looks as a standard MDI example is not build using QMainWindow which would make better usage of Qt. .

    sierdzioS 1 Reply Last reply
    0
    • A Anonymous_Banned275

      Here is "main window" defined in MDI example

      MainWindow::MainWindow()
      : mdiArea(new QMdiArea)

      after mainWindow is defined in "main"
      ( Can somebody give non English speaking native VERBAL explanation of the above syntax? PLEASE )

      Here is same in QMDIAreaClass

      QMainWindow *mainWindow = new QMainWindow;
      mainWindow->setCentralWidget(mdiArea); 
      

      It looks as a standard MDI example is not build using QMainWindow which would make better usage of Qt. .

      sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      @AnneRanch said in What is the differerece in MDI code?:

      Here is "main window" defined in MDI example

      MainWindow::MainWindow()
      : mdiArea(new QMdiArea)

      after mainWindow is defined in "main"
      ( Can somebody give non English speaking native VERBAL explanation of the above syntax? PLEASE )

      Can you link to the example?

      Explanation: Main window constructor creates a new QMdiArea and assigns it to mdiArea member variable.

      Btw. looks like call to parent class constructor is missing.

      Here is same in QMDIAreaClass

      QMainWindow *mainWindow = new QMainWindow;
      mainWindow->setCentralWidget(mdiArea); 
      

      It looks as a standard MDI example is not build using QMainWindow which would make better usage of Qt. .

      I guess the purpose of MDI example is to show off QMdiArea and not QMainWindow, perhaps that's the reason. I have not looked at the code though.

      (Z(:^

      A 1 Reply Last reply
      1
      • sierdzioS sierdzio

        @AnneRanch said in What is the differerece in MDI code?:

        Here is "main window" defined in MDI example

        MainWindow::MainWindow()
        : mdiArea(new QMdiArea)

        after mainWindow is defined in "main"
        ( Can somebody give non English speaking native VERBAL explanation of the above syntax? PLEASE )

        Can you link to the example?

        Explanation: Main window constructor creates a new QMdiArea and assigns it to mdiArea member variable.

        Btw. looks like call to parent class constructor is missing.

        Here is same in QMDIAreaClass

        QMainWindow *mainWindow = new QMainWindow;
        mainWindow->setCentralWidget(mdiArea); 
        

        It looks as a standard MDI example is not build using QMainWindow which would make better usage of Qt. .

        I guess the purpose of MDI example is to show off QMdiArea and not QMainWindow, perhaps that's the reason. I have not looked at the code though.

        A Offline
        A Offline
        Anonymous_Banned275
        wrote on last edited by Anonymous_Banned275
        #3

        @sierdzio

        https://code.qt.io/cgit/qt/qtbase.git/tree/examples/widgets/mainwindows/mdi?h=5.15\

        Reason I asked - it looks as QMainWindow does what the MDI example - use "MDI area" directly - thus could be "bypassing " the application "standard" . Which seems more logical.

        But you are correct - the examples are mostly for specific purpose and the "standard " application -> main window prevails in them. Nothing wrong with that.

        I like the examples, but lack of comments and explanations why it is coded that particular way sure makes for more traffic here .

        I am basically stuck trying to change the MDI "actions" example "default" sub-window to plain widget.

        sierdzioS 1 Reply Last reply
        0
        • A Anonymous_Banned275

          @sierdzio

          https://code.qt.io/cgit/qt/qtbase.git/tree/examples/widgets/mainwindows/mdi?h=5.15\

          Reason I asked - it looks as QMainWindow does what the MDI example - use "MDI area" directly - thus could be "bypassing " the application "standard" . Which seems more logical.

          But you are correct - the examples are mostly for specific purpose and the "standard " application -> main window prevails in them. Nothing wrong with that.

          I like the examples, but lack of comments and explanations why it is coded that particular way sure makes for more traffic here .

          I am basically stuck trying to change the MDI "actions" example "default" sub-window to plain widget.

          sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          @AnneRanch said in What is the differerece in MDI code?:

          I like the examples, but lack of comments and explanations why it is coded that particular way sure makes for more traffic here .

          Oh yes, I fully agree.

          (Z(:^

          1 Reply Last reply
          0

          • Login

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