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. I just wanted to add borders to the QTabWidget!

I just wanted to add borders to the QTabWidget!

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 694 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.
  • LimerL Offline
    LimerL Offline
    Limer
    wrote on last edited by
    #1

    I wanted to add borders to the QTabWidget, but suddenly, I found QTabWidget Inherits from QWidget not QFrame.

    I google the problem, and now I have two solutions,

    ONE, redefine paintEvent.

    TWO, let QFrame to be the QTabWidget's parent by using layouts.

    For me, solution 2 is better.

    My question is whether there is any other better solution? ( By the way, QTabWidget Inherits from QWidget not QFrame is a bad strategy?)

    jsulmJ 1 Reply Last reply
    0
    • LimerL Limer

      I wanted to add borders to the QTabWidget, but suddenly, I found QTabWidget Inherits from QWidget not QFrame.

      I google the problem, and now I have two solutions,

      ONE, redefine paintEvent.

      TWO, let QFrame to be the QTabWidget's parent by using layouts.

      For me, solution 2 is better.

      My question is whether there is any other better solution? ( By the way, QTabWidget Inherits from QWidget not QFrame is a bad strategy?)

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Limer Why should QTabWidget inherit from QFrame?
      If you need a frame around it simply put it into a QFrame.

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

      LimerL 1 Reply Last reply
      4
      • jsulmJ jsulm

        @Limer Why should QTabWidget inherit from QFrame?
        If you need a frame around it simply put it into a QFrame.

        LimerL Offline
        LimerL Offline
        Limer
        wrote on last edited by
        #3

        @jsulm It is troublesome to put into QFrame.

        jsulmJ 1 Reply Last reply
        0
        • LimerL Limer

          @jsulm It is troublesome to put into QFrame.

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Limer Sorry, but it is as easy as putting a QFrame and inside that QFrame putting a QTabWidget. What is troublesome about it?

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

          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved