[Solved]tab size
hi
Im facing a little trouble as to how arrange the GUI elements. I have a form in which a calender is created with each date as a push button.
I need somethin like three option button at the top to go to three different menus, somethin like a tool bar with icons. Can we use the system buttons like those provided by samsung? Or using a tab widget is better.
I pulled in a default tab widget. But i cant change the size of each tab in the designer.
alfah
12 replies
I think this snippet [developer.qt.nokia.com] is usefull for you.
Thanks eddy,
i have managed to use the tabs. i have put a tab widget named tabWidget with 3 tabs to an already existing form using the designer
The problem is, the calender is displayed in all the three tabs. i jus want it to be there while clicking any one of the tabs
Or do i have to create a tabwidget manually than using the designer?????????????
this is how i have created the calender buttons
- for(int i=0;i<6;i++)
- {
- for(int j=0;j<7;j++)
- {
- connect(cellBut[i][j],SIGNAL(clicked()),this,SLOT(onClickAction()));
- cellBut[i][j]->setFlat(true);
- }
- }
regards,
alfah
eddy,
I have already made a calender, in the sense, somthing like a custom calender.
and the tabwidget is jus the default designer one.
I cant figure out how to put the buttons/calender as whole on to the tab :(
I have used
- ui->setupUi(this);
- initMemberVariable();// here buttons are created- 30/31 days
- initMonthYear();// defining each month
- initWeekDay();// arranging the week display
- createLayout();// arranging the whole layout
alfah
- ifndef CALENDERFORM_H
- #define CALENDERFORM_H
- #include <QtGui/QMainWindow>
- #include <QWidget>
- #include <QDate>
- #include <QtGui>
- namespace Ui
- {
- class CalenderForm;
- }
- {
- Q_OBJECT
- public:
- virtual ~CalenderForm();
- private:
- Ui::CalenderForm *ui;
- int monthValue;
- int iArrCycleStage[6][7];
- int iArrDates[6][7],ht,wd;
- QDate selectedDate;
- QString strPreviousSelection;
- private slots:
- }
alfah
As I said I would subclass from QWidget.
In Qt Designer you can put a QWidget in the tab you like as a placeholder and then promote it to your CalenderForm. When compiling the QWidget will be considered as a CalenderForm and shown that way.
Here is a similar topic [developer.qt.nokia.com] on how to promote a QFrame to a custom widget. Use a QWidget instead and your CalenderForm.
have a look at this example [doc.qt.nokia.com] . it uses a QTabWidget and a class derived from QWidget to populate it.
You must log in to post a reply. Not a member yet? Register here!


