www.pudn.com > treeView.rar > mainwindow.cpp, change:2011-03-12,size:1177b


#include "mainwindow.h" 
#include <QTreeWidgetItem> 
#include "tree.h" 
#include <QLineEdit> 
#include <QCompleter> 
#include <QDateTimeEdit> 
MainWindow::MainWindow(QWidget *parent) : 
    QMainWindow(parent) 
{ 
    setupUi(this); 
     Tree *t = new Tree; 
 
     t->show(); 
    //qApp->setStyleSheet(); 
     QStringList wordList; 
     wordList << "alpha" << "omega" << "omicron" << "zeta"; 
 
     QLineEdit *lineEdit = new QLineEdit(this); 
 
     QCompleter *completer = new QCompleter(wordList, this); 
     completer->setCaseSensitivity(Qt::CaseInsensitive); 
     lineEdit->setCompleter(completer); 
 
     ///////// 
     QDateTimeEdit *dateEdit = new QDateTimeEdit(QDate::currentDate(),this); 
     dateEdit->setMinimumDate(QDate::currentDate().addDays(-365)); 
     dateEdit->setMaximumDate(QDate::currentDate().addDays(365)); 
     dateEdit->setDisplayFormat("yyyy.MM.dd"); 
     ListView *list = new ListView; 
     list->show(); 
} 
 
void MainWindow::changeEvent(QEvent *e) 
{ 
    QMainWindow::changeEvent(e); 
    switch (e->type()) { 
    case QEvent::LanguageChange: 
        retranslateUi(this); 
        break; 
    default: 
        break; 
    } 
}