• 5853阅读
  • 0回复

请大家指导:QT4.4.3中关于QDateTimeEdit 类的问题 [复制链接]

上一主题 下一主题
离线dahan12
 
只看楼主 倒序阅读 楼主  发表于: 2009-12-24
硬件:s3c2440  QT版本: qt-embedded-linux-opensource-src-4.4.3

当配置使用release时:./configure -prefix /home/ssss/qt-embedded-linux-opensource-src-4.4.3  -release -shared -fast -pch -no-qt3support -qt-sql-sqlite -no-libtiff -no-libmng -qt-libjpeg -qt-zlib -qt-libpng -qt-freetype -no-openssl -nomake examples -nomake demos -nomake tools -optimized-qmake -no-largefile -no-webkit -no-phonon -no-nis -no-opengl -no-cups -no-xcursor -no-xfixes -no-xrandr -no-xrender -no-xkb -no-sm -no-xinerama -no-xshape -no-separate-debug-info -xplatform qws/linux-arm-g++ -embedded arm -depths 16 -no-qvfb -qt-gfx-linuxfb -no-gfx-qvfb -no-kbd-qvfb -no-mouse-qvfb -qt-kbd-usb -confirm-license -qt-mouse-tslib -I/home/share/qt-box/tslib/include -L/home/share/qt-box/tslib/lib

编译出来的库文件将QDateTimeEdit 或者 QTimeEdit类加入布局时会阻塞QT图形界面的线程

而相同的代码使用debug编译的库文件则能在布局中显示:./configure -prefix /home/ssss/qt-embedded-linux-opensource-src-4.4.3  -debug -shared -fast -pch -no-qt3support -qt-sql-sqlite -no-libtiff -no-libmng -qt-libjpeg -qt-zlib -qt-libpng -qt-freetype -no-openssl -nomake examples -nomake demos -nomake tools -optimized-qmake -no-largefile -no-webkit -no-phonon -no-nis -no-opengl -no-cups -no-xcursor -no-xfixes -no-xrandr -no-xrender -no-xkb -no-sm -no-xinerama -no-xshape -no-separate-debug-info -xplatform qws/linux-arm-g++ -embedded arm -depths 16 -no-qvfb -qt-gfx-linuxfb -no-gfx-qvfb -no-kbd-qvfb -no-mouse-qvfb -qt-kbd-usb -confirm-license -qt-mouse-tslib -I/home/share/qt-box/tslib/include -L/home/share/qt-box/tslib/lib


使用的代码:
DateEdit = new QDateTimeEdit();
DateEdit->setDateTime(QDateTime::currentDateTime());
DateEdit->setDisplayFormat("dd/M/yyyy");
DateEdit->setCalendarPopup(true);

dateLabel = new QLabel(tr("&Date:"));
//dateLabel->setBuddy(dateEdit);

timeEdit = new QTimeEdit(QTime::currentTime());
timeEdit->setAlignment(Qt::AlignCenter);

timeLabel = new QLabel(tr("&Time:"));
timeLabel->setBuddy(timeEdit);

OKbuttonBox = new QDialogButtonBox(QDialogButtonBox::Ok);
                                
ClosebuttonBox = new QDialogButtonBox(QDialogButtonBox::Close);

connect(OKbuttonBox, SIGNAL(accepted()), this, SLOT(dis_sql_data()));
connect(ClosebuttonBox, SIGNAL(rejected()), this, SLOT(hide_windows()));

QGridLayout *mainLayout = new QGridLayout;
mainLayout->addWidget(dateLabel, 0, 0);
mainLayout->addWidget(DateEdit, 0, 1);
mainLayout->addWidget(timeLabel, 0, 2);
mainLayout->addWidget(timeEdit, 0, 3);

mainLayout->addWidget(OKbuttonBox, 3, 0);
mainLayout->addWidget(ClosebuttonBox, 3, 1);

setLayout(mainLayout);

简单的说就是相同的代码,使用debug编译的库可以正确显示,而使用release编译的库则会阻塞图形界面的线程,高手请指导,项目时间很紧,有哪位高手知道请多多指导,谢谢。
快速回复
限100 字节
 
上一个 下一个