我正在为kde linux环境制作文件哈希计算器应用程序 但是我遇到了一些问题: 在此代码中计算文件的哈希值
hashwrapper * sha512 = new sha512wrapper(); std :: string sha512Hashing = sha512-> getHashFromFile(file01.iso);你注意到 file01.iso 这里 我的问题是: 1.如何在此处放置插值文件而不是预定义的文件? i意味着我不知道用户将在高级中选择的文件的名称 所以我如何在Ruby中进行插值移动我们这样做
userInput =获取#{userInput}我如何在Qt Creator中这样做 2.我有一个lineEdit框,我只用来显示文件的名称 ,用户将在关闭QFileDialog后选择 如何显示lineEdit框中的文件名? 我很感谢谁回答我的问题 我的尝试:
QFile filename01; hashwrapper * sha512 = new sha512wrapper(); std :: string sha512Hashing = sha512-> getHashFromFile(filename01);和很多类似的动作但没有运气
解决方案您很可能会使用对话框。预定义的OpenFileDialog或 QDialog Class | Qt 4.8 [ ^ ]。
我找到了solusion QString open_file = QFileDialog :: getOpenFileName(此, 打开文件, / home path); QFile file01(open_file);
现在如果您想将该文件用于您喜欢的任何操作 例如(获取文件名或大小)只需使用(file01) 即可进行操作 顺便提一下QFileDialog上有两种类型的文件 1.静态文件....示例(/home/user/documents/file01.iso) 2.动态文件...示例(用户将从Open Dialog中选择的文件) i希望这对我这样的初学者来说很清楚
i'm making a files hash calculator app for a kde linux enviroment but i'm facing a few problems: in this code that calculate the file's hash
hashwrapper *sha512 = new sha512wrapper(); std::string sha512Hashing = sha512->getHashFromFile("file01.iso");you notice the file01.iso here my question is: 1. how to place an interpolation file here instead of a predefined file? i mean i don't know the name of the file that the user will choose in advanced so how i do an interpolating move like in Ruby we do
userInput=gets #{userInput}how do i do so in Qt Creator 2. i have a lineEdit box that i made only to display the name of the file that the user will choose after closing QFileDialog how display the file name in the lineEdit box ? i'm so grateful to whoever whom will answer my questions What I have tried:
QFile filename01; hashwrapper *sha512 = new sha512wrapper(); std::string sha512Hashing = sha512->getHashFromFile(filename01);and a lot of similar moves but no luck
解决方案 You would most likely use a dialog. Either a predefined OpenFileDialog or QDialog Class | Qt 4.8[^].i have found the solusion QString open_file = QFileDialog::getOpenFileName(this,"open file","/home path"); QFile file01(open_file);now if you want to use the file for any operation you like for example (get the file name or size) just use (file01) to do operations on by the way there's 2 types of files on QFileDialog 1. Static File....example ("/home/user/documents/file01.iso") 2. Dynamic File...example (the file that the user WILL pick from Open Dialog) i hope this will be clear to the beginners like myself
更多推荐
Qt创建者生成问题
发布评论