[Solved]creating tabs
-
:(
yeaa u r right.
I tried using the following code, but then the same form is shown when both statics tab as well as the history tab is clicked even though i have connected two different forms
:(
@
tabWidget->widget(1)->connect(tabWidget,SIGNAL(currentChanged(int)),this,SLOT(showHistoryFrm()));
tabWidget->widget(2)->connect(tabWidget,SIGNAL(currentChanged(int)),this,SLOT(showOptionFrm()));
@alfah
-
Rather than creating a new thread I thought its better this way,
@
tabWidget->setTabIcon(0,QIcon(":images\clock.png"));
@
The above code should set an icon in the first tab right?? But apparently its not!. I've put the image in the resource file.
???any idea
alfah
-
it worked in the new project, both in the device as well as the simulator.
@
ui->tabWidget->setTabIcon(0,QIcon(":/images/clock.png"));
@I think i know why it doesn work on my application.
@
tabWidget = new QTabWidget;
tabWidget->setStyleSheet("QTabWidget::tab-bar{left:0px; width:350px; }\n"
"QTabBar::tab{height:40px; width:95px; color:red; font:9pt; }\n");
tabWidget->setTabIcon(0,QIcon(":/images/clock.png"));pCalender = new QWidget;
pHistory = new QWidget;
pStatistics= new QWidget;connect(tabWidget,SIGNAL(currentChanged(int)),this,SLOT(onSelectTab(int)));
tabWidget->addTab(pCalender,tr("Calender"));
tabWidget->addTab(pHistory,tr("History"));
tabWidget->addTab(pStatistics,tr("Statistics"));
tabWidget->setTabIcon(0,QIcon(":/images/clock.png"));
@EDIT : solved :D
-
bq. it worked in the new project, both in the device as well as the simulator.
so you know a good approach to solve issues yourself. Sometimes a project can grow bigger and bigger. If you make a small test project like you did you can easily narrow down to the problem. Now you know for sure that the code is right.
bq. EDIT: na i don think so, cuz widgets are placed inside the tabs not on those heading.
To be sure just comment out the lines you suspect. This one is for you ;)