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. Problems with a control subclassed from QTabWidget
Forum Updated to NodeBB v4.3 + New Features

Problems with a control subclassed from QTabWidget

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 393 Views 3 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.
  • P Offline
    P Offline
    pixbyte
    wrote on last edited by
    #1

    I have downloaded a QT Ribbon Tab from gut hub, that looks very good for me. But after playing around with this control, I get unexpected issues with it. I tried to debug this but currently Iam lost.

    I have attached a minimal Sample to reproduce the issue. I use QT 5.13.2 on macOS

    My problem is: The app is a mdi App with a custom ribbon control, that is subclassed from QTabWidget. To reproduce the problem, start the app:

    • Open first SubWindow by click on "Open"
    • list itemOpen second SubWindow by click on "Open"
    • Window2 is layered on top of window1
    • Click "New" ToolButton (has no action)
    • )Now click on Tab "View"

    You can see now, that the window1 was get activated. This is a wrong behaviour.

    Because I do not use any Events in this minimal sample I think that the used control will fire somewhere an Event that cause the mdiArea to activate another window. But I was not able to figure this out.

    I hope someone else had a similar problem in the past and can five me a hint.

    minimal sample to download

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

      Hi,

      This is not an official Qt module, you should contact its author.

      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
      • P Offline
        P Offline
        pixbyte
        wrote on last edited by
        #3

        Did you really took a look to the sample app? In my eyes the sample show very clear that this is a QT problem.

        1 Reply Last reply
        0
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by mrjj
          #4

          Hi
          Since you bother to make a runnable example, i did debug it.

          Its a focus problem, it seems.

          When you switch to the empty View tab, Qt tried to focus
          a widget. And for some reason , i dont understand yet that makes MdiArea switch to first window.

          Anyway, after BIG time fiddling around. I could not reproduce with a plain TabWidget
          so i went looking in the support classes of the ribbon class.

          The cure seems to be to remove a focus policy on the scrollarea in
          RibbonTabContent class. (in the UI file)

          alt text

          If i set that to NoFocus. I can no longer reproduce it.

          Please see if you get the same result.
          make sure to do a clean all first so it's surely recompiled.

          1 Reply Last reply
          1
          • P Offline
            P Offline
            pixbyte
            wrote on last edited by
            #5

            Yes, you are right, I cannot reproduce it after change it to noFocus. Can I change this really to NoFocus or will this cause problems? TabFocus also work with me. So it is a behaviour of strongFocus. Wow, this is the setting I never think about. My respect to you. Many thanks!

            mrjjM 1 Reply Last reply
            0
            • P pixbyte

              Yes, you are right, I cannot reproduce it after change it to noFocus. Can I change this really to NoFocus or will this cause problems? TabFocus also work with me. So it is a behaviour of strongFocus. Wow, this is the setting I never think about. My respect to you. Many thanks!

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @pixbyte
              Hi
              Super it also worked for you.
              It should not cause any issues setting it to nofocus as its just the actual scrollarea and it dont need focus.

              Yes its pretty odd. Took quite a while to find it. Im still not sure why it happens but
              we take focus from mdi area when we click and i assume when it tries to set focus back it will focus the window 1. But why i dont really know.

              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