mirror of
https://gitee.com/drabel/LibQQt.git
synced 2025-01-04 10:18:44 +08:00
update: add QT_CHECK_VERSION
This commit is contained in:
parent
85d14aafdd
commit
b6661014ac
@ -1,7 +1,7 @@
|
|||||||
TEMPLATE = subdirs
|
TEMPLATE = subdirs
|
||||||
SUBDIRS += \
|
SUBDIRS += \
|
||||||
src/qqt.pro \
|
src/qqt.pro \
|
||||||
# examples/qqtframe \
|
examples/qqtframe \
|
||||||
# examples/animationframe \
|
# examples/animationframe \
|
||||||
# examples/cmdwidget \
|
# examples/cmdwidget \
|
||||||
# examples/qqtliveplayer \
|
# examples/qqtliveplayer \
|
||||||
|
@ -24,7 +24,7 @@ void QQTLanServer(QObject* parent = 0)
|
|||||||
|
|
||||||
QQTApp::QQTApp(int &argc, char **argv) : QApplication(argc, argv)
|
QQTApp::QQTApp(int &argc, char **argv) : QApplication(argc, argv)
|
||||||
{
|
{
|
||||||
#ifndef __QT5__
|
#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
|
||||||
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
|
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
|
||||||
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
||||||
#endif
|
#endif
|
||||||
|
@ -4,13 +4,15 @@
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------
|
#-------------------------------------------------
|
||||||
|
|
||||||
QT += core gui
|
QT += core gui network sql xml
|
||||||
|
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport serialport
|
||||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
|
||||||
greaterThan(QT_MAJOR_VERSION, 4): DEFINES += __QT5__
|
greaterThan(QT_MAJOR_VERSION, 4): DEFINES += __QT5__
|
||||||
|
|
||||||
TARGET = qqtframe
|
TARGET = qqtframe
|
||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
|
macx {
|
||||||
|
CONFIG += app_bundle
|
||||||
|
}
|
||||||
|
|
||||||
OBJECTS_DIR = obj
|
OBJECTS_DIR = obj
|
||||||
MOC_DIR = obj/moc.cpp
|
MOC_DIR = obj/moc.cpp
|
||||||
@ -20,8 +22,25 @@ RCC_DIR = qrc
|
|||||||
DESTDIR = bin
|
DESTDIR = bin
|
||||||
#DESTDIR = ../../../Product/install/Application
|
#DESTDIR = ../../../Product/install/Application
|
||||||
|
|
||||||
INCLUDEPATH += ../../src
|
INCLUDEPATH += $$PWD \
|
||||||
include(../../src/qqt.pri)
|
$$PWD/../../src \
|
||||||
|
$$PWD/../../src/core \
|
||||||
|
$$PWD/../../src/gui \
|
||||||
|
$$PWD/../../src/multimedia \
|
||||||
|
$$PWD/../../src/network \
|
||||||
|
$$PWD/../../src/printsupport \
|
||||||
|
$$PWD/../../src/sql \
|
||||||
|
$$PWD/../../src/widgets \
|
||||||
|
$$PWD/../../src/customplot \
|
||||||
|
$$PWD/../../src/pluginwatcher \
|
||||||
|
$$PWD/../../src/dmmu \
|
||||||
|
$$PWD/../../src/frame
|
||||||
|
|
||||||
|
#include(../../src/qqt.pri)
|
||||||
|
macx {
|
||||||
|
LIBS += -F/Users/abel/Develop/c0-buildstation/a0-qqtfoundation/MacOS/Release/src/bin
|
||||||
|
LIBS += -framework QQt
|
||||||
|
}
|
||||||
|
|
||||||
QT_KIT = $$(QKIT)
|
QT_KIT = $$(QKIT)
|
||||||
|
|
||||||
@ -51,9 +70,13 @@ CONFIG(debug, debug|release) {
|
|||||||
|
|
||||||
|
|
||||||
equals(QT_KIT, MIPS32) {
|
equals(QT_KIT, MIPS32) {
|
||||||
mips32.path = /Application
|
target.path = /Application
|
||||||
INSTALLS += mips32
|
INSTALLS += target
|
||||||
} else {
|
} else: unix {
|
||||||
|
macx{
|
||||||
|
target.path = /Users/abel/Develop/b1-Product/a0-qqtbased/Application
|
||||||
|
INSTALLS += target
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
INCLUDEPATH += $$PWD
|
INCLUDEPATH += $$PWD
|
||||||
|
@ -70,7 +70,7 @@ QQTWIFIWidget::QQTWIFIWidget(QWidget *parent) :
|
|||||||
setItemDelegateForColumn(ESSID_STATUS, dg);
|
setItemDelegateForColumn(ESSID_STATUS, dg);
|
||||||
for(int i = ESSID_TYPE; i < ESSID_MAX; i++)
|
for(int i = ESSID_TYPE; i < ESSID_MAX; i++)
|
||||||
setColumnHidden(i, true);
|
setColumnHidden(i, true);
|
||||||
#ifdef __QT5__
|
#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
|
||||||
horizontalHeader()->setSectionResizeMode(0, QHeaderView::Fixed);
|
horizontalHeader()->setSectionResizeMode(0, QHeaderView::Fixed);
|
||||||
#else
|
#else
|
||||||
horizontalHeader()->setResizeMode(0, QHeaderView::Fixed);
|
horizontalHeader()->setResizeMode(0, QHeaderView::Fixed);
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
#ifndef QQTGUIQT_H
|
#ifndef QQTGUIQT_H
|
||||||
#define QQTGUIQT_H
|
#define QQTGUIQT_H
|
||||||
|
|
||||||
#ifndef __QT5__
|
#include <qglobal.h>
|
||||||
|
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
|
||||||
#include <QtCore>
|
#include <QtCore>
|
||||||
#include <QtGui>
|
#include <QtGui>
|
||||||
#include <QWSInputMethod>
|
#include <QWSInputMethod>
|
||||||
|
104
src/qqt.pri
104
src/qqt.pri
@ -4,14 +4,33 @@
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------
|
#-------------------------------------------------
|
||||||
|
|
||||||
##Project version
|
############
|
||||||
|
##install and build
|
||||||
|
############
|
||||||
|
OBJECTS_DIR = obj
|
||||||
|
MOC_DIR = obj/moc.cpp
|
||||||
|
UI_DIR = obj/ui.h
|
||||||
|
RCC_DIR = qrc
|
||||||
|
#user directory
|
||||||
|
DESTDIR = bin
|
||||||
|
macx {
|
||||||
|
###if install product to same path,use this.
|
||||||
|
target.path = /Users/abel/Develop/b1-Product/a0-qqtbased/Application
|
||||||
|
INSTALLS += target
|
||||||
|
}
|
||||||
|
|
||||||
|
#############
|
||||||
|
##project version
|
||||||
|
#############
|
||||||
unix:VERSION = 1.0.0
|
unix:VERSION = 1.0.0
|
||||||
|
|
||||||
##Qt version
|
##Qt version
|
||||||
QT += core gui network sql xml
|
QT += core gui network sql xml
|
||||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport serialport
|
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport serialport
|
||||||
greaterThan(QT_MAJOR_VERSION, 4): DEFINES += __QT5__
|
|
||||||
|
|
||||||
|
#############
|
||||||
|
##definition
|
||||||
|
#############
|
||||||
##Arch type
|
##Arch type
|
||||||
QT_KIT = $$(QKIT)
|
QT_KIT = $$(QKIT)
|
||||||
message($${QT_KIT} Defined in qqtfoundation)
|
message($${QT_KIT} Defined in qqtfoundation)
|
||||||
@ -36,33 +55,52 @@ equals(QT_KIT, MIPS32) {
|
|||||||
} else:equals(QT_KIT, macOS) {
|
} else:equals(QT_KIT, macOS) {
|
||||||
DEFINES += __DARWIN__
|
DEFINES += __DARWIN__
|
||||||
}
|
}
|
||||||
win32 {
|
|
||||||
win32:DEFINES += _CRT_SECURE_NO_WARNINGS #fopen fopen_s
|
|
||||||
QMAKE_CXXFLAGS += /wd"4819" /wd"4244" /wd"4100"
|
|
||||||
LIBS += -luser32
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
############
|
|
||||||
##install and build
|
|
||||||
############
|
|
||||||
macx {
|
|
||||||
target.path = /Users/abel/Develop/b1-Product/a0-qqtbased/Application
|
|
||||||
INSTALLS += target
|
|
||||||
}
|
|
||||||
OBJECTS_DIR = obj
|
|
||||||
MOC_DIR = obj/moc.cpp
|
|
||||||
UI_DIR = obj/ui.h
|
|
||||||
RCC_DIR = qrc
|
|
||||||
#user directory
|
|
||||||
DESTDIR = bin
|
|
||||||
CONFIG(debug, debug|release) {
|
CONFIG(debug, debug|release) {
|
||||||
} else {
|
} else {
|
||||||
DEFINES -= QT_NO_DEBUG_OUTPUT
|
DEFINES -= QT_NO_DEBUG_OUTPUT
|
||||||
}
|
}
|
||||||
|
win32 {
|
||||||
|
win32:DEFINES += _CRT_SECURE_NO_WARNINGS #fopen fopen_s
|
||||||
|
QMAKE_CXXFLAGS += /wd"4819" /wd"4244" /wd"4100"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#############
|
||||||
|
##libraries
|
||||||
|
#############
|
||||||
|
win32 {
|
||||||
|
LIBS += -luser32
|
||||||
|
}else: unix {
|
||||||
|
macx {
|
||||||
|
#min macosx target
|
||||||
|
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.9
|
||||||
|
#deperated
|
||||||
|
#QMAKE_MAC_SDK=macosx10.12
|
||||||
|
#MACOSXSDK = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$${QMAKE_MACOSX_DEPLOYMENT_TARGET}.sdk
|
||||||
|
#QMAKE_LIBDIR = $${MACOSXSDK}
|
||||||
|
#LIBS += -F$${MACOSXSDK}/System/Library/Frameworks
|
||||||
|
#LIBS += -L$${MACOSXSDK}/usr/lib
|
||||||
|
LIBS += -framework DiskArbitration -framework Cocoa -framework IOKit
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
###########################
|
||||||
|
##include directories
|
||||||
|
###########################
|
||||||
|
INCLUDEPATH += $$PWD
|
||||||
|
INCLUDEPATH += $$PWD/serialport
|
||||||
|
INCLUDEPATH += $$PWD/core
|
||||||
|
INCLUDEPATH += $$PWD/customplot
|
||||||
|
INCLUDEPATH += $$PWD/dmmu
|
||||||
|
INCLUDEPATH += $$PWD/frame
|
||||||
|
INCLUDEPATH += $$PWD/gui
|
||||||
|
INCLUDEPATH += $$PWD/multimedia
|
||||||
|
INCLUDEPATH += $$PWD/network
|
||||||
|
INCLUDEPATH += $$PWD/pluginwatcher
|
||||||
|
INCLUDEPATH += $$PWD/printsupport
|
||||||
|
INCLUDEPATH += $$PWD/sql
|
||||||
|
INCLUDEPATH += $$PWD/widgets
|
||||||
|
|
||||||
#root dir
|
#root dir
|
||||||
win32 {
|
win32 {
|
||||||
@ -72,17 +110,14 @@ win32 {
|
|||||||
unix {
|
unix {
|
||||||
macx {
|
macx {
|
||||||
HEADERS += $$PWD/qqtdarwin.h
|
HEADERS += $$PWD/qqtdarwin.h
|
||||||
LIBS += -framework DiskArbitration -framework Cocoa -framework IOKit
|
|
||||||
} else {
|
} else {
|
||||||
HEADERS += $$PWD/qqtlinux.h
|
HEADERS += $$PWD/qqtlinux.h
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
INCLUDEPATH += $$PWD
|
|
||||||
HEADERS += $$PWD/qqt.h \
|
HEADERS += $$PWD/qqt.h \
|
||||||
$$PWD/qqtversion.h \
|
$$PWD/qqtversion.h \
|
||||||
$$PWD/qqt-local.h \
|
$$PWD/qqt-local.h \
|
||||||
$$PWD/qqt-qt.h \
|
$$PWD/qqt-qt.h
|
||||||
$$PWD/widgets/qqtapplication.h
|
|
||||||
|
|
||||||
|
|
||||||
#serialport
|
#serialport
|
||||||
@ -90,7 +125,6 @@ HEADERS += $$PWD/qqt.h \
|
|||||||
#DEFINES += __QTEXTSERIALPORT__
|
#DEFINES += __QTEXTSERIALPORT__
|
||||||
contains (DEFINES, __QTEXTSERIALPORT__) {
|
contains (DEFINES, __QTEXTSERIALPORT__) {
|
||||||
message ( __QTEXTSERIALPORT__ defined in qqtfoundation)
|
message ( __QTEXTSERIALPORT__ defined in qqtfoundation)
|
||||||
INCLUDEPATH += $$PWD/serialport
|
|
||||||
include ( $$PWD/serialport/qextserialport.pri )
|
include ( $$PWD/serialport/qextserialport.pri )
|
||||||
} else {
|
} else {
|
||||||
lessThan(QT_MAJOR_VERSION, 5): CONFIG += serialport
|
lessThan(QT_MAJOR_VERSION, 5): CONFIG += serialport
|
||||||
@ -104,7 +138,6 @@ contains (DEFINES, __QTEXTSERIALPORT__) {
|
|||||||
|
|
||||||
|
|
||||||
#core
|
#core
|
||||||
INCLUDEPATH += $$PWD/core
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
$$PWD/core/qqtcore.cpp \
|
$$PWD/core/qqtcore.cpp \
|
||||||
$$PWD/core/qqtanimation.cpp \
|
$$PWD/core/qqtanimation.cpp \
|
||||||
@ -117,7 +150,6 @@ HEADERS += \
|
|||||||
|
|
||||||
|
|
||||||
#customplot
|
#customplot
|
||||||
INCLUDEPATH += $$PWD/customplot
|
|
||||||
contains (DEFINES, QQT_LIBRARY) {
|
contains (DEFINES, QQT_LIBRARY) {
|
||||||
DEFINES += QCUSTOMPLOT_COMPILE_LIBRARY
|
DEFINES += QCUSTOMPLOT_COMPILE_LIBRARY
|
||||||
}
|
}
|
||||||
@ -130,7 +162,6 @@ HEADERS += $$PWD/customplot/qcpdocumentobject.h \
|
|||||||
|
|
||||||
|
|
||||||
#dmmu
|
#dmmu
|
||||||
INCLUDEPATH += $$PWD/dmmu
|
|
||||||
equals(QT_KIT, MIPS32) {
|
equals(QT_KIT, MIPS32) {
|
||||||
SOURCES += $$PWD/dmmu/dmmu.c
|
SOURCES += $$PWD/dmmu/dmmu.c
|
||||||
HEADERS += $$PWD/dmmu/dmmu.h \
|
HEADERS += $$PWD/dmmu/dmmu.h \
|
||||||
@ -141,7 +172,6 @@ equals(QT_KIT, MIPS32) {
|
|||||||
|
|
||||||
|
|
||||||
#frame
|
#frame
|
||||||
INCLUDEPATH += $$PWD/frame
|
|
||||||
equals(QT_KIT, MIPS32) {
|
equals(QT_KIT, MIPS32) {
|
||||||
SOURCES += $$PWD/frame/qqtpreviewwidget.cpp \
|
SOURCES += $$PWD/frame/qqtpreviewwidget.cpp \
|
||||||
$$PWD/frame/qqtwifiwidget.cpp
|
$$PWD/frame/qqtwifiwidget.cpp
|
||||||
@ -175,7 +205,6 @@ FORMS += \
|
|||||||
|
|
||||||
|
|
||||||
#gui
|
#gui
|
||||||
INCLUDEPATH += $$PWD/gui
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
$$PWD/gui/qqtftptreemodel.cpp \
|
$$PWD/gui/qqtftptreemodel.cpp \
|
||||||
$$PWD/gui/qqtsqltreemodel.cpp \
|
$$PWD/gui/qqtsqltreemodel.cpp \
|
||||||
@ -193,13 +222,11 @@ HEADERS += \
|
|||||||
|
|
||||||
|
|
||||||
#multimedia
|
#multimedia
|
||||||
INCLUDEPATH += $$PWD/multimedia
|
|
||||||
SOURCES += $$PWD/multimedia/qqtmplayer.cpp
|
SOURCES += $$PWD/multimedia/qqtmplayer.cpp
|
||||||
HEADERS += $$PWD/multimedia/qqtmplayer.h
|
HEADERS += $$PWD/multimedia/qqtmplayer.h
|
||||||
|
|
||||||
|
|
||||||
#network
|
#network
|
||||||
INCLUDEPATH += $$PWD/network
|
|
||||||
equals(QT_KIT, MIPS32) {
|
equals(QT_KIT, MIPS32) {
|
||||||
SOURCES += $$PWD/network/qqtethenetmanager.cpp
|
SOURCES += $$PWD/network/qqtethenetmanager.cpp
|
||||||
HEADERS += $$PWD/network/qqtethenetmanager.h
|
HEADERS += $$PWD/network/qqtethenetmanager.h
|
||||||
@ -230,7 +257,6 @@ HEADERS += \
|
|||||||
$$PWD/network/qqtnetwork.h
|
$$PWD/network/qqtnetwork.h
|
||||||
|
|
||||||
#pluginwatcher
|
#pluginwatcher
|
||||||
INCLUDEPATH += $$PWD/pluginwatcher
|
|
||||||
contains (DEFINES, QQT_LIBRARY) {
|
contains (DEFINES, QQT_LIBRARY) {
|
||||||
DEFINES += BUILD_QDEVICEWATCHER_LIB
|
DEFINES += BUILD_QDEVICEWATCHER_LIB
|
||||||
}
|
}
|
||||||
@ -252,19 +278,16 @@ HEADERS += $$PWD/pluginwatcher/qqtpluginwatcher.h \
|
|||||||
$$PWD/pluginwatcher/qdevicewatcher_p.h
|
$$PWD/pluginwatcher/qdevicewatcher_p.h
|
||||||
|
|
||||||
#printsupport
|
#printsupport
|
||||||
INCLUDEPATH += $$PWD/printsupport
|
|
||||||
SOURCES += $$PWD/printsupport/qqtprinter.cpp
|
SOURCES += $$PWD/printsupport/qqtprinter.cpp
|
||||||
HEADERS += $$PWD/printsupport/qqtprinter.h
|
HEADERS += $$PWD/printsupport/qqtprinter.h
|
||||||
|
|
||||||
|
|
||||||
#sql
|
#sql
|
||||||
INCLUDEPATH += $$PWD/sql
|
|
||||||
SOURCES += $$PWD/sql/qqtsql.cpp
|
SOURCES += $$PWD/sql/qqtsql.cpp
|
||||||
HEADERS += $$PWD/sql/qqtsql.h
|
HEADERS += $$PWD/sql/qqtsql.h
|
||||||
|
|
||||||
|
|
||||||
#widgets
|
#widgets
|
||||||
INCLUDEPATH += $$PWD/widgets
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
$$PWD/widgets/qqtcheckbox.cpp \
|
$$PWD/widgets/qqtcheckbox.cpp \
|
||||||
$$PWD/widgets/qqtheaderview.cpp \
|
$$PWD/widgets/qqtheaderview.cpp \
|
||||||
@ -306,7 +329,8 @@ HEADERS += \
|
|||||||
$$PWD/widgets/qqtgraphicsview.h \
|
$$PWD/widgets/qqtgraphicsview.h \
|
||||||
$$PWD/widgets/qqttreewidget.h \
|
$$PWD/widgets/qqttreewidget.h \
|
||||||
$$PWD/widgets/qqtwidget.h \
|
$$PWD/widgets/qqtwidget.h \
|
||||||
$$PWD/widgets/qqtwidgets.h
|
$$PWD/widgets/qqtwidgets.h \
|
||||||
|
$$PWD/widgets/qqtapplication.h
|
||||||
FORMS += \
|
FORMS += \
|
||||||
$$PWD/widgets/qqtcheckbox.ui \
|
$$PWD/widgets/qqtcheckbox.ui \
|
||||||
$$PWD/widgets/qqtlistview.ui \
|
$$PWD/widgets/qqtlistview.ui \
|
||||||
|
@ -6,9 +6,14 @@
|
|||||||
TARGET = QQt
|
TARGET = QQt
|
||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
|
|
||||||
|
macx {
|
||||||
|
CONFIG += lib_bundle
|
||||||
|
}
|
||||||
|
|
||||||
#QQT LIBRARY (DLL)
|
#QQT LIBRARY (DLL)
|
||||||
#DEFINES += QQT_LIBRARY
|
#DEFINES += QQT_LIBRARY
|
||||||
|
|
||||||
DEFINES += QQT_LIBRARY
|
DEFINES += QQT_LIBRARY
|
||||||
|
|
||||||
|
|
||||||
include ($$PWD/qqt.pri)
|
include ($$PWD/qqt.pri)
|
||||||
|
@ -22,7 +22,7 @@ QQtApplication::QQtApplication(int &argc, char **argv
|
|||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
#ifndef __QT5__
|
#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
|
||||||
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
|
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
|
||||||
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
||||||
#endif
|
#endif
|
||||||
|
@ -115,17 +115,17 @@ void QQTMPTableWidget::query(QString filter)
|
|||||||
//ptime();//1ms
|
//ptime();//1ms
|
||||||
page->setSelectionMode(selectionMode);
|
page->setSelectionMode(selectionMode);
|
||||||
page->setAlternatingRowColors(altColor);
|
page->setAlternatingRowColors(altColor);
|
||||||
#ifdef __QT5__
|
#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
|
||||||
page->horizontalHeader()->setSectionResizeMode(resizeMode);
|
|
||||||
#else
|
|
||||||
page->horizontalHeader()->setResizeMode(resizeMode);
|
page->horizontalHeader()->setResizeMode(resizeMode);
|
||||||
|
#else
|
||||||
|
page->horizontalHeader()->setSectionResizeMode(resizeMode);
|
||||||
#endif
|
#endif
|
||||||
//ptime();//0ms
|
//ptime();//0ms
|
||||||
for(int i = 0; i < m_model->columnCount(); i++)
|
for(int i = 0; i < m_model->columnCount(); i++)
|
||||||
#ifdef __QT5__
|
#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
|
||||||
page->horizontalHeader()->setSectionResizeMode(i, m_resizeMode.value(i, resizeMode));
|
|
||||||
#else
|
|
||||||
page->horizontalHeader()->setResizeMode(i, m_resizeMode.value(i, resizeMode));
|
page->horizontalHeader()->setResizeMode(i, m_resizeMode.value(i, resizeMode));
|
||||||
|
#else
|
||||||
|
page->horizontalHeader()->setSectionResizeMode(i, m_resizeMode.value(i, resizeMode));
|
||||||
#endif
|
#endif
|
||||||
//ptime();//QHash(338ms) QMap(372ms) 400ms(QHash等几乎不耗时)
|
//ptime();//QHash(338ms) QMap(372ms) 400ms(QHash等几乎不耗时)
|
||||||
for(int i = 0; i < m_model->columnCount(); i++)
|
for(int i = 0; i < m_model->columnCount(); i++)
|
||||||
@ -292,18 +292,18 @@ QQTTableWidget* QQTMPTableWidget::selectedRows(int column)
|
|||||||
m_headerData.value(i, m_model->headerData(i, Qt::Horizontal).toString()));
|
m_headerData.value(i, m_model->headerData(i, Qt::Horizontal).toString()));
|
||||||
page->setSelectionMode(selectionMode);
|
page->setSelectionMode(selectionMode);
|
||||||
page->setAlternatingRowColors(altColor);
|
page->setAlternatingRowColors(altColor);
|
||||||
#ifdef __QT5__
|
#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
|
||||||
page->horizontalHeader()->setSectionResizeMode(resizeMode);
|
|
||||||
#else
|
|
||||||
page->horizontalHeader()->setResizeMode(resizeMode);
|
page->horizontalHeader()->setResizeMode(resizeMode);
|
||||||
|
#else
|
||||||
|
page->horizontalHeader()->setSectionResizeMode(resizeMode);
|
||||||
#endif
|
#endif
|
||||||
for(int i = 0; i < m_model->columnCount(); i++)
|
for(int i = 0; i < m_model->columnCount(); i++)
|
||||||
{
|
{
|
||||||
page->setColumnHidden(i, m_columnHidden.value(i));
|
page->setColumnHidden(i, m_columnHidden.value(i));
|
||||||
#ifdef __QT5__
|
#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
|
||||||
page->horizontalHeader()->setSectionResizeMode(i, m_resizeMode.value(i, resizeMode));
|
|
||||||
#else
|
|
||||||
page->horizontalHeader()->setResizeMode(i, m_resizeMode.value(i, resizeMode));
|
page->horizontalHeader()->setResizeMode(i, m_resizeMode.value(i, resizeMode));
|
||||||
|
#else
|
||||||
|
page->horizontalHeader()->setSectionResizeMode(i, m_resizeMode.value(i, resizeMode));
|
||||||
#endif
|
#endif
|
||||||
page->setColumnWidth(i, m_columnWidth.value(i));
|
page->setColumnWidth(i, m_columnWidth.value(i));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user