momesana
1st October 2007, 22:34
Hi! I want to set a QWidget that is composed of two QToolButtons as the cornerWidget of a QTabWidget, but it doesnt work. The buttons are being squeezed and aren't usable any more. Outside of the QTabWidget the widget looks ok.
Any Ideas?
Thanx
#include <QApplication>
#include <QtGui>
// #include "main.moc"
int main(int argc, char **argv)
{
QApplication app(argc, argv);
QWidget *w = new QWidget;
QToolButton * butA = new QToolButton;
QToolButton * butB = new QToolButton;
// layout
QHBoxLayout * lo = new QHBoxLayout(w);
lo->addWidget(butA);
lo->addWidget(butB);
QTabWidget * tabWidget = new QTabWidget;
tabWidget->addTab(new QWidget(), "test tab");
tabWidget->setCornerWidget(w, Qt::TopRightCorner);
tabWidget->show();
return app.exec();
}
Any Ideas?
Thanx
#include <QApplication>
#include <QtGui>
// #include "main.moc"
int main(int argc, char **argv)
{
QApplication app(argc, argv);
QWidget *w = new QWidget;
QToolButton * butA = new QToolButton;
QToolButton * butB = new QToolButton;
// layout
QHBoxLayout * lo = new QHBoxLayout(w);
lo->addWidget(butA);
lo->addWidget(butB);
QTabWidget * tabWidget = new QTabWidget;
tabWidget->addTab(new QWidget(), "test tab");
tabWidget->setCornerWidget(w, Qt::TopRightCorner);
tabWidget->show();
return app.exec();
}