[Solved]how to remove the default button box bar in QDialog
-
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 :)
-
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 -> .... :)
-
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
-
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. .
-
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 :) :)
-
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 :)