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. MDI ideas / suggestions wanted
Forum Updated to NodeBB v4.3 + New Features

MDI ideas / suggestions wanted

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 273 Views 1 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 Anonymous_Banned275
    #1

    EDIT

    Could somebody PLEASE at least comment on this crazy idea

    I can pass Qt::WindowFlags to :addSubWindow as a addition ID and later
    verify the ID ....

    I am not sure if messing with Qt::WindowFlags() won't create some other issues.

    QMdiSubWindow *QMdiArea::addSubWindow(QWidget *widget, Qt::WindowFlags windowFlags = Qt::WindowFlags())

    I am looking for somebody who knows / uses MDI Qt example.

    The example is build around the idea to have multiple "text file editing " application.
    Does the job.

    I like to expand on the idea and have similar , multiple access, application using Bluetooth technology.

    The multiple "text file editing " concept is done adding another layer AFTER "mdiArea" and is implemented by
    "child" object based on QEditText.

    The menu "Window" provides for controlling the appearance of the multiple "children" in the main mdiArea - such as "tile " , "cascade" etc.

    In reality - the "Bluetooth" menu would have "submenu" and each item ( action) in such submenu wound "need" a "child" object to handle specific submenu.

    At present I can add "mdiSubmenu" but the code which instantiates the "Window" is failing because the QEditText and my (first) specific Bluetooth object (btscanner) do not have SAME "text retrieval" functions.

    In an essence - should I struggle to modify current , working "window"function or just build another - especially for specific Bluetooth object ( dialog) ?

    I am NOT asking for a code , just an idea.

    ( I do hesitate to post current code - it has TOO many "debugs" lines of code....)

    e36e5c18-3221-4546-856d-2fb8155dfa03-image.png

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by ChrisW67
      #2

      @AnneRanch said in MDI ideas / suggestions wanted:

      I can pass Qt::WindowFlags to :addSubWindow as a addition ID and later verify the ID ....

      At present I can add "mdiSubmenu" but the code which instantiates the "Window" is failing because the QEditText and my (first) specific Bluetooth object (btscanner) do not have SAME "text retrieval" functions.

      It is your code that is making the assumption that all QMdiSubWindows contain a widget with the same API. Clearly that is not the case in your program, so this assumption is flawed.

      Subverting the window flags of MDI subwindows to implement some sort of run-time type identifier is not a useful idea.

      Qt already provides a way to determine the class of the widget inside a QMdiSubWindow. Something like this for example,

      QMdiSubWindow *currentSub = mdiArea->currentSubWindow();
      QWidget *currentWidget = currentSub->widget();
      if (QTextEdit *edit = qobject_cast<QTextEdit*>(currentWidget)) {
        // code to work with editors
      }
      else  if (BlueToothWidget *bt = qobject_cast<BlueToothWidget*>(currentWidget)) {
        // code to work with the bluetooth widget
      }
      else {
        qWarning("Unknown subwindow type seen.  Doing nothing.");
      }
      
      A 1 Reply Last reply
      1
      • C ChrisW67

        @AnneRanch said in MDI ideas / suggestions wanted:

        I can pass Qt::WindowFlags to :addSubWindow as a addition ID and later verify the ID ....

        At present I can add "mdiSubmenu" but the code which instantiates the "Window" is failing because the QEditText and my (first) specific Bluetooth object (btscanner) do not have SAME "text retrieval" functions.

        It is your code that is making the assumption that all QMdiSubWindows contain a widget with the same API. Clearly that is not the case in your program, so this assumption is flawed.

        Subverting the window flags of MDI subwindows to implement some sort of run-time type identifier is not a useful idea.

        Qt already provides a way to determine the class of the widget inside a QMdiSubWindow. Something like this for example,

        QMdiSubWindow *currentSub = mdiArea->currentSubWindow();
        QWidget *currentWidget = currentSub->widget();
        if (QTextEdit *edit = qobject_cast<QTextEdit*>(currentWidget)) {
          // code to work with editors
        }
        else  if (BlueToothWidget *bt = qobject_cast<BlueToothWidget*>(currentWidget)) {
          // code to work with the bluetooth widget
        }
        else {
          qWarning("Unknown subwindow type seen.  Doing nothing.");
        }
        
        A Offline
        A Offline
        Anonymous_Banned275
        wrote on last edited by
        #3

        @ChrisW67 Thanks Chris
        I was just about to delete this post...
        I have a confession - have been IGNORING the MDI example code you are referencing...
        it is all in there ...
        I went thru it line by line , added some comments and
        I got it working with some superficial modifications...
        THANKS

        ( I owe you a beer,,, and if you are ever near Houston hope we will meet .. ,)

        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