Chinglish
Leave a reply
bool UserSoils::connectDb()
{
//for access
//QString connStr=QString(
// "DRIVER={Microsoft Access Driver (*.mdb)};FIL={MS Access};DBQ=c:xxxx.mdb");
qDebug()<<"UserSoils::connectDb(), connStr ="<< connStr;
QSqlDatabase db=QSqlDatabase::addDatabase("QODBC");
db.setDatabaseName(connStr);
return db.open();
//qDebug()<<"UserSoils::connectDb(),"<<db.lastError().databaseText();
}
并不是很好的方法,在WindowStateChange后,实际上minimizing已经完成,
而最好的地点应该是clicking后,但未实际招执行minimizing的位置上。
重载winEvent是个不错的方法
bool event(QEvent *event)
{
if(event->type() == QEvent::WindowStateChange)
{
if (event->spontaneous() && isMinimized()) {
hide();
setWindowFlags(Qt::FramelessWindowHint);
//if you want to show the window again you need the following
//setWindowFlags(Qt::Window);
//show();
return true;
}
else
QWidget::event(event);
}
else
QWidget::event(event);
}
If you need to use all available screen, then you must look up in qmenu.cpp source file in 1273 line where is:
QRect screen = QApplication::desktop()->availableGeometry(p);Change it to:QRect screen = QApplication::desktop()->screenGeometry(p);then it works like you need
Yes, it does!