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. How to Draw circle in tabwidget ?
QtWS25 Last Chance

How to Draw circle in tabwidget ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 652 Views
  • 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.
  • N Offline
    N Offline
    n-2204
    wrote on last edited by
    #1

    Hi,
    I have added two tabs in my Qwidget directly using Qtdesigner
    so how can I draw circle in tab?
    If any related link plz share.

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

      Hi,

      Create a custom widget and do the drawing there.

      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
      1
      • N Offline
        N Offline
        n-2204
        wrote on last edited by
        #3

        Ok Thankyou,, I don't understand.. can u plz any example or link for reference, That might be very helpful

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

          Hi

          A basic widget to draw with would be like

          #include <QPainter>
          #include <QWidget>
          
          class CircleWidget : public QWidget
          {
          public:
          
              CircleWidget ( QWidget *parent = nullptr ) : QWidget(parent) {}
          
          protected:
          
              void paintEvent(QPaintEvent *event) override
              {
                  QPainter painter(this);
                  painter.fillRect(0, 0, size().width(), size().height(), Qt::red);
              }
          };
          
          
          N 1 Reply Last reply
          2
          • mrjjM mrjj

            Hi

            A basic widget to draw with would be like

            #include <QPainter>
            #include <QWidget>
            
            class CircleWidget : public QWidget
            {
            public:
            
                CircleWidget ( QWidget *parent = nullptr ) : QWidget(parent) {}
            
            protected:
            
                void paintEvent(QPaintEvent *event) override
                {
                    QPainter painter(this);
                    painter.fillRect(0, 0, size().width(), size().height(), Qt::red);
                }
            };
            
            
            N Offline
            N Offline
            n-2204
            wrote on last edited by
            #5

            @mrjj So where i can mention like mywidget should create on which tab

            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