qt5: full qt5 compability

ifdef rest of the code which can't be ported 100%
add CMake option USE_QT5 to use qt5 ;)
Thanks to stretchtiberius for initial patch
This commit is contained in:
Peinthor Rene
2014-02-14 00:28:42 +01:00
parent 58ec477344
commit de1fb9ff2f
8 changed files with 77 additions and 20 deletions

View File

@@ -8,7 +8,11 @@ FilterTableHeader::FilterTableHeader(QTableView* parent) :
QHeaderView(Qt::Horizontal, parent)
{
// Activate the click signals to allow sorting
#if QT_VERSION >= 0x050000
setSectionsClickable(true);
#else
setClickable(true);
#endif
// Do some connects: Basically just resize and reposition the input widgets whenever anything changes
connect(this, SIGNAL(sectionResized(int,int,int)), this, SLOT(adjustPositions()));

View File

@@ -80,9 +80,11 @@ int main( int argc, char ** argv )
a.setApplicationName("SQLite Database Browser");
// Set character encoding to UTF8
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
#if QT_VERSION < 0x050000
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
#endif
// Enable translation
QTranslator translator;