Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [Solved]how to remove the default button box bar in QDialog

[Solved]how to remove the default button box bar in QDialog

Scheduled Pinned Locked Moved Mobile and Embedded
8 Posts 3 Posters 5.4k 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.
  • A Offline
    A Offline
    alfah
    wrote on last edited by
    #1

    everybody,

    I am with a small problem, I cant remove the default buttonbox in a Qdialog. I have not assigned any function to the default buttons. I removed the buttons but there is still the blank button bar
    What do i do?

    alfah

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goblincoding
      wrote on last edited by
      #2

      A standard QDialog has no buttons unless you assign some. Are you perhaps using a derived class?

      Perhaps we could help if you provided some code :)

      http://www.goblincoding.com

      1 Reply Last reply
      0
      • R Offline
        R Offline
        Rahul Das
        wrote on last edited by
        #3

        You have to remove the QDialogButtonBox. Not just the buttons from it.

        By the way,like goblincoding said, you wont have it by default. Plus if you are using QtCreator, there are Dialog with / with out buttons options in New -> File or Project -> Qt -> DesignerForm class -> .... :)


        Declaration of (Platform) independence.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          alfah
          wrote on last edited by
          #4

          goblincoding,

          Even i thought the same tht the default QDialog has no buttons by default. Derived class meaning?
          I tried creating a new QDialog as Rahul suggested but it shows default button box bar, with out the buttons. It shows it while running on C7 but not on the form
          @
          AddNewHistoryForm::AddNewHistoryForm(QWidget *parent) :QDialog(parent),ui(new Ui::AddNewHistoryForm)
          {
          ui->setupUi(this);
          ui->label_3->setAttribute(Qt::WA_NoSystemBackground);
          ui->label_4->setAttribute(Qt::WA_NoSystemBackground);
          ui->label_5->setAutoFillBackground(true);
          ui->label_5->setAttribute(Qt::WA_NoSystemBackground);
          ui->calWidget->setAttribute(Qt::WA_NoSystemBackground);

          connect(ui->calWidget,SIGNAL(clicked(QDate)),this,SLOT(showDate(QDate)));
          connect(ui->saveBut,SIGNAL(clicked()),this,SLOT(onDateChanged()));
          

          }
          @

          :( :(

          alfah

          1 Reply Last reply
          0
          • A Offline
            A Offline
            alfah
            wrote on last edited by
            #5

            I have solved the problem but im not clear of what exactly i have done, so if some one could explain wat ive done :)

            i used to call this AddNewHistoryForm from a class named HistoryForm like this.

            @
            AddNewHistoryForm paddnewhistfrm(this);
            paddnewhistfrm.show()
            @

            I changed that to this
            @
            AddNewHistoryForm *pAddNewHistFrm = new AddNewHistoryForm();
            pAddNewHistFrm->showFullScreen();
            @

            And voila the blank buttonbox disappeared. .

            1 Reply Last reply
            0
            • R Offline
              R Offline
              Rahul Das
              wrote on last edited by
              #6

              Good to know its solved alfah!

              I am just guessing it here, that when you show a dialog on symbian, symbian framework overrule the appearance. I mean those two buttons, which are assigned/aligned for left and right softkeys. When you show it full screen, nothing override the appearance, its just your app window that rules the whole screen. Well, thats my guess :) :)


              Declaration of (Platform) independence.

              1 Reply Last reply
              0
              • A Offline
                A Offline
                alfah
                wrote on last edited by
                #7

                yeaa may be. .

                anyway thanx for the help :)

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  goblincoding
                  wrote on last edited by
                  #8

                  Glad you solved it :)

                  Just wish to answer your final question:

                  [quote author="alfah" date="1315458144"]Derived class meaning?[/quote]

                  [quote author=Wikipedia]A superclass, base class, or parent class is a class from which other classes are derived. The classes that are derived from a superclass are known as child classes, derived classes, or subclasses.[/quote]

                  I thought you'd perhaps used one of the convenience classes like QFileDialog/QMessageBox or had inherited from QDialog yourself :)

                  http://www.goblincoding.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