/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Quick Controls module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
.pragma library
var daysInAWeek = 7;
var monthsInAYear = 12;
// Not the number of weeks per month, but the number of weeks that are
// shown on a typical calendar.
var weeksOnACalendarMonth = 6;
// Can't create year 1 directly...
var minimumCalendarDate = new Date(-1, 0, 1);
minimumCalendarDate.setFullYear(minimumCalendarDate.getFullYear() + 2);
var maximumCalendarDate = new Date(275759, 9, 25);
function daysInMonth(date) {
// Passing 0 as the day will give us the previous month, which will be
// date.getMonth() since we added 1 to it.
return new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate();
}
/*!
Returns a copy of \a date with its month set to \a month, keeping the same
day if possible. Does not modify \a date.
*/
function setMonth(date, month) {
var oldDay = date.getDate();
var newDate = new Date(date);
// Set the day first, because setting the month could cause it to skip ahead
// a month if the day is larger than the latest day in that month.
newDate.setDate(1);
newDate.setMonth(month);
// We'd like to have the previous day still selected when we change
// months, but it might not be possible, so use the smallest of the two.
newDate.setDate(Math.min(oldDay, daysInMonth(newDate)));
return newDate;
}
/*!
Returns the cell rectangle for the cell at the given \a index, assuming
that the grid has a number of columns equal to \a columns and rows
equal to \a rows, with an available width of \a availableWidth and height
of \a availableHeight.
If \a gridLineWidth is greater than \c 0, the cell rectangle will be
calculated under the assumption that there is a grid between the cells:
31 | 1 | 2 | 3 | 4 | 5 | 6
--------------------------------
7 | 8 | 9 | 10 | 11 | 12 | 13
--------------------------------
14 | 15 | 16 | 17 | 18 | 19 | 20
--------------------------------
21 | 22 | 23 | 24 | 25 | 26 | 27
--------------------------------
28 | 29 | 30 | 31 | 1 | 2 | 3
--------------------------------
4 | 5 | 6 | 7 | 8 | 9 | 10
*/
function cellRectAt(index, columns, rows, availableWidth, availableHeight, gridLineWidth) {
var col = Math.floor(index % columns);
var row = Math.floor(index / columns);
var availableWidthMinusGridLines = availableWidth - ((columns - 1) * gridLineWidth);
var availableHeightMinusGridLines = availableHeight - ((rows - 1) * gridLineWidth);
var remainingHorizontalSpace = Math.floor(availableWidthMinusGridLines % columns);
var remainingVerticalSpace = Math.floor(availableHeightMinusGridLines % rows);
var baseCellWidth = Math.floor(availableWidthMinusGridLines / columns);
var baseCellHeight = Math.floor(availableHeightMinusGridLines / rows);
var rect = Qt.rect(0, 0, 0, 0);
rect.x = baseCellWidth * col;
rect.width = baseCellWidth;
if (remainingHorizontalSpace > 0) {
if (col < remainingHorizontalSpace) {
++rect.width;
}
// This cell's x position should be increased by 1 for every column above it.
rect.x += Math.min(remainingHorizontalSpace, col);
}
rect.y = baseCellHeight * row;
rect.height = baseCellHeight;
if (remainingVerticalSpace > 0) {
if (row < remainingVerticalSpace) {
++rect.height;
}
// This cell's y position should be increased by 1 for every row above it.
rect.y += Math.min(remainingVerticalSpace, row);
}
rect.x += col * gridLineWidth;
rect.y += row * gridLineWidth;
return rect;
}
没有合适的资源?快使用搜索试试~ 我知道了~
FDM - Free Download Manager
共940个文件
qml:438个
qmlc:159个
dll:144个
需积分: 0 1 下载量 132 浏览量
2023-11-02
20:01:36
上传
评论
收藏 35.75MB RAR 举报
温馨提示
FDM --- Free Download Manager
资源推荐
资源详情
资源评论
收起资源包目录
FDM - Free Download Manager (940个子文件)
opengl32sw.dll 19.95MB
Qt5Gui.dll 6.2MB
Qt5Core.dll 5.7MB
Qt5Widgets.dll 5.32MB
d3dcompiler_47.dll 4.67MB
Qt5Qml.dll 3.83MB
Qt5Quick.dll 3.63MB
libGLESV2.dll 3.41MB
downloadsbt.dll 2.83MB
Qt5XmlPatterns.dll 2.77MB
libcrypto-1_1-x64.dll 2.74MB
qtquickcontrols2imaginestyleplugin.dll 2.15MB
qwindows.dll 1.4MB
Qt5Network.dll 1.28MB
qsqlite.dll 1.17MB
Qt5QuickTemplates2.dll 1011KB
ucrtbase.dll 960KB
qtquickextrasflatplugin.dll 813KB
Qt5Multimedia.dll 713KB
libssl-1_1-x64.dll 673KB
msvcp140.dll 553KB
qtquickcontrols2materialstyleplugin.dll 541KB
qwebp.dll 518KB
downloadsms.dll 501KB
vmsclshared.dll 497KB
Qt5RemoteObjects.dll 489KB
qtquickcontrols2plugin.dll 478KB
Qt5QuickParticles.dll 455KB
qjpeg.dll 448KB
qtquickcontrols2universalstyleplugin.dll 438KB
qtquickcontrols2fusionstyleplugin.dll 438KB
qtiff.dll 389KB
Qt5Svg.dll 337KB
qtquickcontrolsplugin.dll 330KB
qtquicktemplates2plugin.dll 307KB
qsgd3d12backend.dll 301KB
dsengine.dll 300KB
downloadswww.dll 263KB
qtlabsplatformplugin.dll 227KB
Qt5Sql.dll 210KB
quazip.dll 204KB
Qt5QuickShapes.dll 191KB
downloadsm3u.dll 183KB
Qt5QuickControls2.dll 176KB
qmldbg_debugger.dll 159KB
dialogplugin.dll 144KB
qwindowsvistastyle.dll 142KB
widgetsplugin.dll 129KB
Qt5Gamepad.dll 103KB
qtaudio_wasapi.dll 99KB
qquicklayoutsplugin.dll 98KB
qsqlodbc.dll 96KB
vcruntime140.dll 96KB
qmldbg_preview.dll 95KB
Qt53DQuickScene2D.dll 92KB
downloadsjsp.dll 88KB
qmlxmllistmodelplugin.dll 84KB
qmldbg_inspector.dll 80KB
qtquickextrasplugin.dll 79KB
qsqlpsql.dll 79KB
qmldbg_profiler.dll 77KB
qtquickscene3dplugin.dll 76KB
downloadsbatch.dll 74KB
qtqmlstatemachine.dll 72KB
qtmedia_audioengine.dll 71KB
api-ms-win-crt-private-l1-1-0.dll 69KB
qtgraphicaleffectsplugin.dll 68KB
qmlfolderlistmodelplugin.dll 68KB
qmldbg_server.dll 66KB
qtaudio_windows.dll 66KB
qmldbg_nativedebugger.dll 65KB
qtgraphicaleffectsprivate.dll 62KB
wmfengine.dll 62KB
winunwanted3dpartydllsblocker.dll 57KB
qmllocalstorageplugin.dll 56KB
Qt53DLogic.dll 56KB
qgenericbearer.dll 56KB
dialogsprivateplugin.dll 55KB
qicns.dll 50KB
qmlsettingsplugin.dll 45KB
qmlshapesplugin.dll 45KB
qsvgicon.dll 45KB
winunivappfeatures.dll 43KB
qico.dll 41KB
qgif.dll 41KB
qmldbg_native.dll 40KB
qmldbg_quickprofiler.dll 37KB
logger.dll 37KB
vcruntime140_1.dll 36KB
Qt5Concurrent.dll 36KB
xinputgamepad.dll 36KB
qtmultimedia_m3u.dll 36KB
qsvg.dll 34KB
qtqmlremoteobjects.dll 34KB
qtga.dll 34KB
qmldbg_local.dll 33KB
qwbmp.dll 33KB
qmldbg_tcp.dll 32KB
qtquickscene2dplugin.dll 32KB
qmldbg_messages.dll 31KB
共 940 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10
资源评论
kentrl
- 粉丝: 188
- 资源: 37
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功