我的主页

快递查询 :http://m.kuaidi100.com     爱快递查询 :http://www.aikuaidi.cn/              

http://www.qtcn.org/bbs/u/168050  [收藏] [复制]

w642833823

  • 9

    关注

  • 29

    粉丝

  • 27

    访客

  • 等级:新手上路
  • 总积分:41
  • 保密,2011-12-07

最后登录:2020-10-01

更多资料

日志

2020-09-22 14:12

//函数setAlignment()主要将是消除布局中的空隙,让两个控件紧紧挨在一起
ui->textEdit->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
//隐藏横向滚动条
ui->textEdit->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
//隐藏竖向滚动条
ui->textEdit->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );

阅读全文»分类:QT|回复:0|浏览:38
2020-09-21 15:45

/设置动态背景图片
QString image_url=song_urll_list.at(index).image_url;
//为了不占空间所以不用这句song_info_list.at(index).songname而用song_url.song_name的目的数据会覆盖该隐形文件
//如果在手机上路径要改"./sdcard/.jpg"
QString file_path=QString("./.jpg").arg(song_url.song_name);
get_pixmap=new Get_Pixmap;

get_pixmap->getPixmap_File(file_path,image_url);
QString css=QString("background-image:url(./.jpg)").arg(song_url.song_name);
ui->lycwidget->s ..

阅读全文»分类:QT|回复:0|浏览:45
2020-09-21 12:17

//实现颜色随机
int R=qrand()%255;
int G=qrand()%255;
int B=qrand()%255;
if(m_lyric_list.size() <= 0 || m_iCurrentIndex >= m_lyric_list.size())
return;


for(int i = 0; i < m_lyric_list.size(); i++)
{

if(position > m_lyric_list.at(i).time)
{
m_iCurrentIndex = i;
}
}


if(position > m_lyric_list.at(m_iCurrentIndex).time)
{
QString lrc;
lrc.clear();
lrc += QString("<p align='center'><span style=' font-style:italic;color:green'>" ..

阅读全文»分类:QT|回复:0|浏览:43
2020-06-17 11:10

//数字大小写转换
QString Widget::numberToZh(int num)
{
QStringList zh = {"零","一","二","三","四","五","六","七","八","九","十"};
QString res = "";
if(num <= 10) {
res = zh;
} else if(num < 20) {
int bits = num % 10;
res = zh[10] + zh;
} else if(num < 100) {
int bits = num % 10;
int decade = num / 10;
if(bits == 0) {
res = zh + zh[10] + "整";
} else ..

阅读全文»分类:QT|回复:0|浏览:87
2020-05-25 15:22

//延时
void SLEEP::sleep(int sec)
{
    QTime dieTime = QTime::currentTime().addMSecs(sec);
    while( QTime::currentTime() < dieTime )
        QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
}

阅读全文»分类:QT|回复:0|浏览:117
2020-05-09 15:05

//获取当前系统语言环境,并设置语言
static QString find_translation_file()
{
QString locale = QLocale::system().name(); // language code + country code (xx_XX)
QString language = locale.mid(0, 2); // language code (first two chars of locale)
QString translation_file_basename =
//QDir(Paths::translationPath()).absoluteFilePath("mystiq_");
QDir(":/translations/").absoluteFilePath("mystiq_");

// look for mystiq_xx_XX.qm in the translation directory
QString trans ..

阅读全文»分类:QT|回复:0|浏览:116
2020-04-24 13:51

QDir dir3;
//判断以参数中为路径名的路径是否存在,如果存在该路径则返回真
if(dir3.exists(Path)==NULL)
{
//该函数是创建以Path为路径的一个路径,如果父路径不存在的话,则一起同时创建;创建成功返回1,否则返回0
// dir3.mkdir(Path);
dir3.mkpath(Path);
qDebug()<<"路径创建成功";

}
else
qDebug()<<"路径已经存在";

阅读全文»分类:QT|回复:0|浏览:77
2020-04-01 14:56

//复杂的QTJson数组QJsonArray arrays; for (int i = 0; i < 5;i++) { arrays.insert(i, QString("复杂数据组:%1").arg(image)); } QJsonObject json_ct; json_ct.insert("ct","24"); json_ct.insert("cv","10000"); QJsonObject json_albumMid; json_albumMid.insert("albumMid",QString("%1").arg(album_Mid));
QJsonObject json_albumDetail; json_albumDetail.insert("module","music.musichallAlbum.AlbumInfoServer"); json_a ..

阅读全文»分类:QT|回复:0|浏览:138
2019-10-03 23:39

import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Window 2.2
import QtQuick.Dialogs 1.2
import QtMultimedia 5.4

ApplicationWindow {
title: qsTr("简易视频播放器")
width: 640
height: 480
visible: true
Rectangle {
color: "black"
anchors.fill: parent

MediaPlayer {
id: mediaPlayer
source: "file:///storage/sdcard0/1.mp4"
autoPlay: true
}

Rectangle {
color: "black"
anchors.fill: parent

VideoOutput {
id: video
anchors.fill ..

阅读全文»分类:手机端开发版|回复:0|浏览:640
2019-09-24 16:50

//需要指定文件路径,和后缀名

QString GetName::set_file_name(QString path,QString suffix_name)
{
//判断路径是否存在
QDir dir(path);
if(!dir.exists())
{
return "文件夹不存在或者路径不正确";
}
dir.setFilter(QDir::Files | QDir::NoSymLinks);
QFileInfoList list = dir.entryInfoList();

int file_count = list.count();
if(file_count <= 0)
{
return "文件不存在";
}
//开始处理

QString string_list;
for(int i=0; i<list.count();i++)
{
QFileInfo file_info = list.at(i ..

阅读全文»分类:QT|回复:0|浏览:341
12

Powered by phpwind v8.7 Certificate Copyright Time now is:10-01 11:30
©2005-2016 QTCN开发网 版权所有 Gzip disabled