Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-106536

QGroupBox and parent-child relationship

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 5.12.0
    • GUI: Look'n'Feel
    • None
    • OS: Kubuntu 22.04

    • Linux/X11

    Description

      I am creating a QGroupBox on my QMainWindow window.

       

      QGroupBox *GROUPBOXChemicalEquation;
      GROUPBOXChemicalEquation=new QGroupBox(this);
      GROUPBOXChemicalEquation->setGeometry(X, Y, width, height);
      GROUPBOXChemicalEquation->setTitle("Chemical Equation");

       

      So, that looks fine and good.
      Then I want to place some controls on it. Let’s say, I want to put this button:

      BUTTONCopyEnergy3=new QPushButton(“Copy”, GROUPBOXChemicalEquation); <====notice the GROUPBOXChemicalEquation
      BUTTONCopyEnergy3->setGeometry(0, 0, BUTTONCopyEnergy3PosSize[2], BUTTONCopyEnergy3PosSize[3]);

      THE PROBLEM:
      The problem is the position of the button. It positions the button over the header text: Chemical Equation

      This seems to work fine if the parent is a QTabWidget but what is it with QGroupBox? It can’t be a parent?

      OS: Kubuntu 22.04

      Attachments

        1. zzzBug.png
          24 kB
          Vrej Melkonian
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            stretchthebits Vrej Melkonian
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes