Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Layout problem

    General and Desktop
    2
    7
    224
    Loading More Posts
    • 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.
    • G
      GunkutA last edited by

      Hello I am using Grid Layout in one of my forms. In that form I have QCustomPlot widget. The problem is that when I run the code, it gets something different than the layout. And of course I cannot move it by using move() command...
      That is how it looks line in Design window:
      1.png
      Notice that there is no space between the selected widget and the QTableWidget.

      When I run it:

      2.png
      Now there is a a space between QTableWidget and the Graph, that comes from nowhere. Also eventhough I use layout and my custom widget is inside of that layout, still the CustomWidget (Graph) is cut from half. How can I solve that?

      jsulm 1 Reply Last reply Reply Quote 0
      • jsulm
        jsulm Lifetime Qt Champion @GunkutA last edited by

        @GunkutA said in Layout problem:

        How can I solve that?

        Please show how you put your custom widget into that layout.

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        G 1 Reply Last reply Reply Quote 0
        • G
          GunkutA @jsulm last edited by

          @jsulm Probably I am answering in the wrong way but, I directly created a QWidget in GUI and then promoted it to QCustomPlot widget. Again by using user interface window. Was that what you asked for? Because I didn't put it in the code.

          jsulm 1 Reply Last reply Reply Quote 0
          • jsulm
            jsulm Lifetime Qt Champion @GunkutA last edited by

            @GunkutA OK. What is your custom widget doing? Do you paint there?

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            G 1 Reply Last reply Reply Quote 0
            • G
              GunkutA @jsulm last edited by

              @jsulm That is for plotting. That is a premade plotting library for creating graphs. Yes it uses paint events and QCPPainter.

              jsulm 1 Reply Last reply Reply Quote 0
              • jsulm
                jsulm Lifetime Qt Champion @GunkutA last edited by

                @GunkutA You would have to provide more information about your custom widget, else only guessing is possible.

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                G 1 Reply Last reply Reply Quote 0
                • G
                  GunkutA @jsulm last edited by

                  @jsulm Well that's this one: QCustomPlot](https://www.qcustomplot.com/#:~:text=QCustomPlot is a Qt C%2B%2B widget for plotting and data visualization.&text=QCustomPlot is the solution for,use QCP in free software!)

                  I don't have adequate information about its content. There are more than 30.000 lines of code in it. But what I cannot understand is independent from the widget and its content, in the UI its borders and boundaries are visible. There is also a layout. Isn't it supposed to stay inside of its boundaries which are clear in the UI?

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post