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
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved General and Desktop
11 Posts 2 Posters 2.5k 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.
  • youzkingY Offline
    youzkingY Offline
    youzking
    wrote on last edited by youzking
    #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
      1
      • youzkingY Offline
        youzkingY Offline
        youzking
        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
        • youzkingY youzking

          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/)

          youzkingY 1 Reply Last reply
          1
          • 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?

            youzkingY Offline
            youzkingY Offline
            youzking
            wrote on last edited by youzking
            #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/)

              youzkingY 1 Reply Last reply
              1
              • M mcosta

                Create a new class and use it for anotherWidget

                youzkingY Offline
                youzkingY Offline
                youzking
                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 !!!

                youzkingY 1 Reply Last reply
                0
                • youzkingY youzking

                  @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 !!!

                  youzkingY Offline
                  youzkingY Offline
                  youzking
                  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 ),

                  youzkingY 1 Reply Last reply
                  0
                  • youzkingY youzking

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

                    youzkingY Offline
                    youzkingY Offline
                    youzking
                    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/)

                      youzkingY 1 Reply Last reply
                      1
                      • 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

                        youzkingY Offline
                        youzkingY Offline
                        youzking
                        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