trytoremeber963
11th January 2011, 01:51
case 0:
if i do not use any setCurrentItem function in the QTreeWidget,all the item are normal
QApplication a(argc, argv);
QString str1;
str1.append("uistyle.css");
QFile file(str1);
if(file.open(QFile::ReadOnly))
{
QString styleSheet = QObject::tr(file.readAll());
a.setStyleSheet(styleSheet);
file.close();
}
MainWindow w;
w.show();
return a.exec();
ui->setupUi(this);
//ui->treeWidget->setCurrentItem(ui->treeWidget->topLevelItem(0));
//ui->treeWidget->setCurrentItem(ui->treeWidget->topLevelItem(1));
//ui->treeWidget->setCurrentItem(ui->treeWidget->topLevelItem(2));
case 1:
in the main function i have used the setStyleSheet and use it before the mainwindow's construct function
if i use
ui->setupUi(this);
ui->treeWidget->setCurrentItem(ui->treeWidget->topLevelItem(0));
//ui->treeWidget->setCurrentItem(ui->treeWidget->topLevelItem(1));
//ui->treeWidget->setCurrentItem(ui->treeWidget->topLevelItem(2));
the first and the last item height are UNNormal but the second and the third is NORMAL
all the sub items are normal
case 2:
in the main function i have used the setStyleSheet and use it before the mainwindow's construct function
ui->setupUi(this);
ui->treeWidget->setCurrentItem(ui->treeWidget->topLevelItem(0));
ui->treeWidget->setCurrentItem(ui->treeWidget->topLevelItem(1));
//ui->treeWidget->setCurrentItem(ui->treeWidget->topLevelItem(2));
the first the second and the last item height are UNNormal but the third is NORMAL
all the sub items are normal
case 3
i change the order of mainwindow's construct function and the setStyleSheet func
QApplication a(argc, argv);
MainWindow w; //to here
QString str1;
str1.append("uistyle.css");
QFile file(str1);
if(file.open(QFile::ReadOnly))
{
QString styleSheet = QObject::tr(file.readAll());
a.setStyleSheet(styleSheet);
file.close();
}
//MainWindow w; //old position
w.show();
return a.exec();
all the item are normal
why? the attachment is follow
if i do not use any setCurrentItem function in the QTreeWidget,all the item are normal
QApplication a(argc, argv);
QString str1;
str1.append("uistyle.css");
QFile file(str1);
if(file.open(QFile::ReadOnly))
{
QString styleSheet = QObject::tr(file.readAll());
a.setStyleSheet(styleSheet);
file.close();
}
MainWindow w;
w.show();
return a.exec();
ui->setupUi(this);
//ui->treeWidget->setCurrentItem(ui->treeWidget->topLevelItem(0));
//ui->treeWidget->setCurrentItem(ui->treeWidget->topLevelItem(1));
//ui->treeWidget->setCurrentItem(ui->treeWidget->topLevelItem(2));
case 1:
in the main function i have used the setStyleSheet and use it before the mainwindow's construct function
if i use
ui->setupUi(this);
ui->treeWidget->setCurrentItem(ui->treeWidget->topLevelItem(0));
//ui->treeWidget->setCurrentItem(ui->treeWidget->topLevelItem(1));
//ui->treeWidget->setCurrentItem(ui->treeWidget->topLevelItem(2));
the first and the last item height are UNNormal but the second and the third is NORMAL
all the sub items are normal
case 2:
in the main function i have used the setStyleSheet and use it before the mainwindow's construct function
ui->setupUi(this);
ui->treeWidget->setCurrentItem(ui->treeWidget->topLevelItem(0));
ui->treeWidget->setCurrentItem(ui->treeWidget->topLevelItem(1));
//ui->treeWidget->setCurrentItem(ui->treeWidget->topLevelItem(2));
the first the second and the last item height are UNNormal but the third is NORMAL
all the sub items are normal
case 3
i change the order of mainwindow's construct function and the setStyleSheet func
QApplication a(argc, argv);
MainWindow w; //to here
QString str1;
str1.append("uistyle.css");
QFile file(str1);
if(file.open(QFile::ReadOnly))
{
QString styleSheet = QObject::tr(file.readAll());
a.setStyleSheet(styleSheet);
file.close();
}
//MainWindow w; //old position
w.show();
return a.exec();
all the item are normal
why? the attachment is follow