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

Radiobutton near qtabbar

Scheduled Pinned Locked Moved General and Desktop
8 Posts 3 Posters 3.3k Views 1 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.
  • K Offline
    K Offline
    kitten
    wrote on last edited by
    #1

    hi to every one
    i wrote a program thas has a qtabwidget and radiobutton.
    and the radio button is on top of qtabwidget, i know tabs on qtabwidget create with qtabbar.
    now i want to add my radio buttons on the same row of qtabbar icons,
    how can i do that?
    can you help me?
    !http://up7.iranblog.com/images/1nau7kfo8sc3x4h8rqgz.png(imag)!

    www.kitten.mihanblog.com

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kunashir
      wrote on last edited by
      #2

      I suggest next - try using tabbar for parent of radiobutton. If I right widget displayed on top right conner. And You may do inheritor of tabbar with radiobuttons.

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kitten
        wrote on last edited by
        #3

        can you explain more, i cant understand.my english is a little bad
        can you give me a code?

        www.kitten.mihanblog.com

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kunashir
          wrote on last edited by
          #4

          My English bad too )), maybe I bad explaining.

          Look:

          "http://zalil.ru/32406713(rb)":http://zalil.ru/32406713(rb)

          If this is something that should be, then code is:

          @ ui->setupUi(this);
          QRadioButton *rb = new QRadioButton (ui->tabWidget);
          rb->setText("SomeText");
          @

          But it is not easy - with second radiobutton You will have trouble. You may placed your radionbutton, for example, in QPanel and it placed on tabbar.

          Maybe better way someone will can offer.

          1 Reply Last reply
          0
          • K Offline
            K Offline
            kitten
            wrote on last edited by
            #5

            thanks alot,now i create this
            but the border comes backward of my radiobuttons widget,how can i make it comes in front of radiobuttons?
            !http://up7.iranblog.com/images/8syy4s9507aj2z1vv0.png(border )!

            www.kitten.mihanblog.com

            1 Reply Last reply
            0
            • G Offline
              G Offline
              goetz
              wrote on last edited by
              #6

              You cannot do that with built-in methods of Qt.

              You have two options, neither one is easy, and both have their drawbacks:

              Use a QTabBar
              Instead of using a QTabWidget, use a [[Doc:QTabBar]]. Put it into a layout together with the readio buttons on top of a [[Doc:QStackedWidget]] or a [[Doc:QStackedLayout]]. You will have to listen to the tab bars signals and select the stack page manually.

              Position the radio buttons manually
              Layout the two radio buttions in a widget. Then position the widget on the top left corner of the tab widget. You will have to listen to resize and move events (probably of the toplevel window your tab is in) in order to reposition the buttions according to the movement of the outer widget.

              http://www.catb.org/~esr/faqs/smart-questions.html

              1 Reply Last reply
              0
              • K Offline
                K Offline
                kitten
                wrote on last edited by
                #7

                how can i do the second way?
                can you give me some code?

                www.kitten.mihanblog.com

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  kitten
                  wrote on last edited by
                  #8

                  i found another way:d
                  setmargin to zero and set maximum height a bit lower

                  www.kitten.mihanblog.com

                  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