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. [SOLVED] how can i generate such grid (for graphs) using Qt
Qt 6.11 is out! See what's new in the release blog

[SOLVED] how can i generate such grid (for graphs) using Qt

Scheduled Pinned Locked Moved General and Desktop
11 Posts 2 Posters 2.8k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by A Former User
    #1

    an example of what i want to realize :

    link text

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcosta
      wrote on last edited by
      #2

      Hi,
      you can write your Widget and reimplement paintEvent or try to use external libraries (Qwt for example)

      Once your problem is solved don't forget to:

      • Mark the thread as SOLVED using the Topic Tool menu
      • Vote up the answer(s) that helped you to solve the issue

      You can embed images using (http://imgur.com/) or (http://postimage.org/)

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        yes i want to use the first method but the widget that i want paint on is inside another one (not defined in a class) so i can't redefine its paintEvent ,

        can i paint on a widget without the paintEvent ?

        ps : i installed qwt but i realized that drawing it manually is better,

        M 1 Reply Last reply
        0
        • ? A Former User

          yes i want to use the first method but the widget that i want paint on is inside another one (not defined in a class) so i can't redefine its paintEvent ,

          can i paint on a widget without the paintEvent ?

          ps : i installed qwt but i realized that drawing it manually is better,

          M Offline
          M Offline
          mcosta
          wrote on last edited by
          #4

          @youzking said:

          yes i want to use the first method but the widget that i want paint on is inside another one (not defined in a class) so i can't redefine its paintEvent ,

          What does it means?

          Once your problem is solved don't forget to:

          • Mark the thread as SOLVED using the Topic Tool menu
          • Vote up the answer(s) that helped you to solve the issue

          You can embed images using (http://imgur.com/) or (http://postimage.org/)

          ? 1 Reply Last reply
          0
          • M mcosta

            @youzking said:

            yes i want to use the first method but the widget that i want paint on is inside another one (not defined in a class) so i can't redefine its paintEvent ,

            What does it means?

            ? Offline
            ? Offline
            A Former User
            wrote on last edited by A Former User
            #5

            @mcosta

            i have a widget created inside another one , for example:

            CWidget::CWidget(QWidget *parent) : QWidget(parent)
            {
            ...
            QWidget *anotherWidget= new Widget(this);
            ...
            }
            (this is just an example) ,
            and i want to paint on anotherWidget ,

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mcosta
              wrote on last edited by
              #6

              Create a new class and use it for anotherWidget

              Once your problem is solved don't forget to:

              • Mark the thread as SOLVED using the Topic Tool menu
              • Vote up the answer(s) that helped you to solve the issue

              You can embed images using (http://imgur.com/) or (http://postimage.org/)

              ? 1 Reply Last reply
              0
              • M mcosta

                Create a new class and use it for anotherWidget

                ? Offline
                ? Offline
                A Former User
                wrote on last edited by
                #7

                @mcosta

                this is what i want avoid ,!!
                because the widget i want to paint on is created with QT Designer ,
                i searched and found that promoting widget may help , but without results !!!

                ? 1 Reply Last reply
                0
                • ? A Former User

                  @mcosta

                  this is what i want avoid ,!!
                  because the widget i want to paint on is created with QT Designer ,
                  i searched and found that promoting widget may help , but without results !!!

                  ? Offline
                  ? Offline
                  A Former User
                  wrote on last edited by
                  #8

                  i want to create a widget , paint on it , and then show it , !
                  ( using QLabel is just a workaround ),

                  ? 1 Reply Last reply
                  0
                  • ? A Former User

                    i want to create a widget , paint on it , and then show it , !
                    ( using QLabel is just a workaround ),

                    ? Offline
                    ? Offline
                    A Former User
                    wrote on last edited by
                    #9

                    Ok , i handled it by promoting the widget

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      mcosta
                      wrote on last edited by
                      #10

                      Promoting widgets is the way to do it (it works); so probably you have some issues using this feature.

                      If you want use a QLabel you can paint on a QPixmap and after set the label pixmap.

                      BTW I suggest to use custom widget

                      Once your problem is solved don't forget to:

                      • Mark the thread as SOLVED using the Topic Tool menu
                      • Vote up the answer(s) that helped you to solve the issue

                      You can embed images using (http://imgur.com/) or (http://postimage.org/)

                      ? 1 Reply Last reply
                      0
                      • M mcosta

                        Promoting widgets is the way to do it (it works); so probably you have some issues using this feature.

                        If you want use a QLabel you can paint on a QPixmap and after set the label pixmap.

                        BTW I suggest to use custom widget

                        ? Offline
                        ? Offline
                        A Former User
                        wrote on last edited by
                        #11

                        @mcosta

                        yes i also prefer using custom widget ,
                        thanks for your help ^^

                        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