mirror of
https://github.com/x-tools-author/x-tools.git
synced 2025-09-15 15:28:40 +08:00
chore: update files of project
This commit is contained in:
parent
9b9fb82f75
commit
1162562d90
@ -31,7 +31,7 @@ Application::Application(int argc, char** argv)
|
|||||||
// It can avoid app crash in this way to show a splashScreen. If you create a QSplashScreen and
|
// It can avoid app crash in this way to show a splashScreen. If you create a QSplashScreen and
|
||||||
// show it in the main function, app will crash(test on Ubuntu 16.04). Of course, it is because
|
// show it in the main function, app will crash(test on Ubuntu 16.04). Of course, it is because
|
||||||
// that I use a wrong way, also, it could be a bug of Qt.
|
// that I use a wrong way, also, it could be a bug of Qt.
|
||||||
QPixmap pixmap(":/resources/images/StartUi.jpg");
|
QPixmap pixmap(":/Resources/Images/StartUi.jpg");
|
||||||
m_splashScreen = new QSplashScreen(pixmap);
|
m_splashScreen = new QSplashScreen(pixmap);
|
||||||
showSplashScreenMessage(tr("Initializing..."));
|
showSplashScreenMessage(tr("Initializing..."));
|
||||||
m_splashScreen->show();
|
m_splashScreen->show();
|
||||||
@ -41,8 +41,8 @@ Application::Application(int argc, char** argv)
|
|||||||
int ret = xToolsSettings::instance()->palette();
|
int ret = xToolsSettings::instance()->palette();
|
||||||
if ((ret == xToolsDataStructure::PaletteDark) || (ret == xToolsDataStructure::PaletteLight)) {
|
if ((ret == xToolsDataStructure::PaletteDark) || (ret == xToolsDataStructure::PaletteLight)) {
|
||||||
QString fileName = (ret == xToolsDataStructure::PaletteLight
|
QString fileName = (ret == xToolsDataStructure::PaletteLight
|
||||||
? ":/resources/palette/SAKAppPaletteLight"
|
? ":/Resources/Palettes/DarkPalette"
|
||||||
: ":/resources/palette/SAKAppPaletteDark");
|
: ":/Resources/Palettes/DarkPalette");
|
||||||
setupPalette(fileName);
|
setupPalette(fileName);
|
||||||
} else {
|
} else {
|
||||||
QString customPalette = xToolsSettings::instance()->customPalette();
|
QString customPalette = xToolsSettings::instance()->customPalette();
|
||||||
@ -87,14 +87,14 @@ Application::Application(int argc, char** argv)
|
|||||||
bool tooHeight = (mainWindow->height() > screenRect.height());
|
bool tooHeight = (mainWindow->height() > screenRect.height());
|
||||||
if (tooWidth || tooHeight) {
|
if (tooWidth || tooHeight) {
|
||||||
mainWindow->showMaximized();
|
mainWindow->showMaximized();
|
||||||
qInfo() << "too small screen";
|
qInfo() << "The screen is too small.";
|
||||||
} else {
|
} else {
|
||||||
mainWindow->move((screenRect.width() - mainWindow->width()) / 2,
|
mainWindow->move((screenRect.width() - mainWindow->width()) / 2,
|
||||||
(screenRect.height() - mainWindow->height()) / 2);
|
(screenRect.height() - mainWindow->height()) / 2);
|
||||||
}
|
}
|
||||||
showSplashScreenMessage(tr("Finished..."));
|
showSplashScreenMessage(tr("Finished..."));
|
||||||
|
|
||||||
QString msg = QString("the size of main window is: %1x%2")
|
QString msg = QString("The size of main window is: %1x%2")
|
||||||
.arg(mainWindow->width())
|
.arg(mainWindow->width())
|
||||||
.arg(mainWindow->height());
|
.arg(mainWindow->height());
|
||||||
qInfo() << qPrintable(msg);
|
qInfo() << qPrintable(msg);
|
||||||
@ -114,8 +114,8 @@ void Application::setupPalette(const QString& fileName)
|
|||||||
out >> p;
|
out >> p;
|
||||||
file.close();
|
file.close();
|
||||||
setPalette(p);
|
setPalette(p);
|
||||||
qInfo() << "current palette:" << fileName;
|
qInfo() << "Current palette is:" << fileName;
|
||||||
} else {
|
} else {
|
||||||
qWarning() << "open palette file error:" << file.errorString();
|
qWarning() << "Open palette file error:" << file.errorString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,37 +17,25 @@ public:
|
|||||||
explicit xToolsTableModel(QObject *parent = nullptr);
|
explicit xToolsTableModel(QObject *parent = nullptr);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const final;
|
// clang-format off
|
||||||
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const final;
|
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||||
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const final;
|
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||||
virtual bool setData(const QModelIndex &index,
|
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||||
const QVariant &value,
|
virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
|
||||||
int role = Qt::EditRole) final;
|
virtual bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
|
||||||
virtual bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) final;
|
virtual bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
|
||||||
virtual bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) final;
|
virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
|
||||||
virtual QVariant headerData(int section,
|
// clang-format on
|
||||||
Qt::Orientation orientation,
|
|
||||||
int role = Qt::DisplayRole) const final;
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
// You must connect these signals using Qt::DirectConnection way.
|
// You must connect these signals using Qt::DirectConnection way.
|
||||||
|
// clang-format off
|
||||||
void invokeGetRowCount(int &count);
|
void invokeGetRowCount(int &count);
|
||||||
void invokeGetColumnCount(int &count);
|
void invokeGetColumnCount(int &count);
|
||||||
void invokeGetData(QVariant &data, const QModelIndex &index, int role = Qt::DisplayRole);
|
void invokeGetData(QVariant &data, const QModelIndex &index, int role = Qt::DisplayRole);
|
||||||
void invokeSetData(bool &result,
|
void invokeSetData(bool &result, const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
|
||||||
const QModelIndex &index,
|
void invokeInsertRows(bool &result, int row, int count, const QModelIndex &parent = QModelIndex());
|
||||||
const QVariant &value,
|
void invokeRemoveRows(bool &result, int row, int count, const QModelIndex &parent = QModelIndex());
|
||||||
int role = Qt::EditRole);
|
void invokeGetHeaderData(QVariant &data, int section, Qt::Orientation orientation, int role = Qt::DisplayRole);
|
||||||
void invokeInsertRows(bool &result,
|
// clang-format on
|
||||||
int row,
|
|
||||||
int count,
|
|
||||||
const QModelIndex &parent = QModelIndex());
|
|
||||||
void invokeRemoveRows(bool &result,
|
|
||||||
int row,
|
|
||||||
int count,
|
|
||||||
const QModelIndex &parent = QModelIndex());
|
|
||||||
void invokeGetHeaderData(QVariant &data,
|
|
||||||
int section,
|
|
||||||
Qt::Orientation orientation,
|
|
||||||
int role = Qt::DisplayRole);
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -6,14 +6,15 @@
|
|||||||
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
|
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
|
||||||
* code directory.
|
* code directory.
|
||||||
**************************************************************************************************/
|
**************************************************************************************************/
|
||||||
#include "xTools.h"
|
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
|
#include "xTools.h"
|
||||||
|
|
||||||
int main(const int argc, char *argv[])
|
int main(const int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
Q_INIT_RESOURCE(xToolsCommon);
|
||||||
QString appName = QString("xTools");
|
QString appName = QString("xTools");
|
||||||
#ifndef X_TOOLS_IMPORT_MODULE_PRIVATE
|
#ifdef X_TOOLS_BUILD_FOR_STORE
|
||||||
appName += QObject::tr("(Community)");
|
appName += QObject::tr("(Store)");
|
||||||
#endif
|
#endif
|
||||||
sakDoSomethingBeforeAppCreated(argv, appName);
|
sakDoSomethingBeforeAppCreated(argv, appName);
|
||||||
Application app(argc, argv);
|
Application app(argc, argv);
|
||||||
|
|||||||
23
xTools.qrc
23
xTools.qrc
@ -47,5 +47,28 @@
|
|||||||
<file>Resources/Icons/IconZoomOut.svg</file>
|
<file>Resources/Icons/IconZoomOut.svg</file>
|
||||||
<file>Resources/Translations/xTools_en.qm</file>
|
<file>Resources/Translations/xTools_en.qm</file>
|
||||||
<file>Resources/Translations/xTools_zh_CN.qm</file>
|
<file>Resources/Translations/xTools_zh_CN.qm</file>
|
||||||
|
<file>Resources/Images/Android.png</file>
|
||||||
|
<file>Resources/Images/AndroidLogo.png</file>
|
||||||
|
<file>Resources/Images/Gitee.png</file>
|
||||||
|
<file>Resources/Images/GitHub.png</file>
|
||||||
|
<file>Resources/Images/Gz.png</file>
|
||||||
|
<file>Resources/Images/I18n.png</file>
|
||||||
|
<file>Resources/Images/iOS.png</file>
|
||||||
|
<file>Resources/Images/Linux.png</file>
|
||||||
|
<file>Resources/Images/Logo.jpg</file>
|
||||||
|
<file>Resources/Images/Logo.png</file>
|
||||||
|
<file>Resources/Images/Logo.svg</file>
|
||||||
|
<file>Resources/Images/Mac.png</file>
|
||||||
|
<file>Resources/Images/MainWindow.png</file>
|
||||||
|
<file>Resources/Images/Pi.png</file>
|
||||||
|
<file>Resources/Images/QSAKQQ.jpg</file>
|
||||||
|
<file>Resources/Images/Qt.png</file>
|
||||||
|
<file>Resources/Images/QtQQ.jpg</file>
|
||||||
|
<file>Resources/Images/StartUi.jpg</file>
|
||||||
|
<file>Resources/Images/WeChat.jpg</file>
|
||||||
|
<file>Resources/Images/Windows.png</file>
|
||||||
|
<file>Resources/Images/Zip.png</file>
|
||||||
|
<file>Resources/Palettes/DarkPalette</file>
|
||||||
|
<file>Resources/Palettes/LightPalette</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user