qt4

How to deploy Qt applications for Linux

烈酒焚心 提交于 2019-12-30 06:19:27
问题 I followed all the steps successfully as mention in the Qt documentation: Qt for Linux/X11 - Building from Source Qt for Linux/X11 - Deployment But I still couldn't make static Qt application, the executable generated by the above documented steps still needs Qt shared objects on other system. Any ideas? 回答1: You need to deploy the application, for this purpose I use the utility cqtdeployer This utility itself collects all the necessary dependencies of your application and you do not have to

How to deploy Qt applications for Linux

风流意气都作罢 提交于 2019-12-30 06:19:09
问题 I followed all the steps successfully as mention in the Qt documentation: Qt for Linux/X11 - Building from Source Qt for Linux/X11 - Deployment But I still couldn't make static Qt application, the executable generated by the above documented steps still needs Qt shared objects on other system. Any ideas? 回答1: You need to deploy the application, for this purpose I use the utility cqtdeployer This utility itself collects all the necessary dependencies of your application and you do not have to

Build Qt in “Release with Debug Info” mode?

廉价感情. 提交于 2019-12-30 02:44:05
问题 Is there a way to build Qt in "Release with Debug info" mode ? My application crashes only in "release" mode (works fine in Debug mode) and seems the issue comes from Qt (may be a bug in Qt).So I want to see the debug info of Qt. Qt docs has "debug" , "release" but not "release with debug" mode. [Upate] My application works fine with Mingw 32bit Release/Debug and VSC++ Compiler 64bit Debug. Only crashes on VSC++ 64Bit Release Any tips ? 回答1: Update: See @milanw's answer below. This is now

Downloading File in Qt From URL

一世执手 提交于 2019-12-30 02:17:25
问题 In my program I need to download a file, and I came across this article: http://www.java2s.com/Code/Cpp/Qt/DownloadfromURL.htm This code does work but it doesn't fit into my program so I re-coded it. I haven't completed it all but I've got the basics coded. However, when I test it, it pops up with a send error report window. So far this is my code: QtDownload.h #include <QObject> #include <QString> #include <QNetworkAccessManager> #include <QNetworkReply> class QtDownload : public QObject { Q

Encrypt/Decrypt SQLite-database and use it “on the fly”

守給你的承諾、 提交于 2019-12-30 02:13:51
问题 Here's the thing: In my Qt4.6-Project, I use a SQLite-Database. This database shouldn't be unencrypted on my harddrive. So I want, that on every start of my program, the user gets asked to enter a password to decrypt the database. Of course the database never should appear "in clear" (not encrypted) on my harddrive. So is there any possibility to decrypt a SQLite-database "on the fly" and read and write data? What algorithm is here the best (maybe AES)? When it's not possible (or very slow),

Two colours text in QPushButton

限于喜欢 提交于 2019-12-29 08:37:04
问题 I need a QPushButton with two colors in the text. I found a solution with a html code in QTextDocument and it's working. But I need center align and the html code isn't working. QTextDocument Text; Text.setHtml("<p align=center><font>Button</font><br/><font color=yellow>1</font></p>"); QPixmap pixmap(Text.size().width(), Text.size().height()); pixmap.fill( Qt::transparent ); QPainter painter(&pixmap); Text.drawContents(&painter, pixmap.rect()); QIcon ButtonIcon(pixmap); ui->toolButton-

QTableView output save as .csv or .txt

故事扮演 提交于 2019-12-29 05:29:04
问题 I wrote the below code for a qt gui to view the query output in a QTableView(Model oriented). now i want to save this output as a .csv or .txt file. There were suggestions to use QTableWidget(Item oriented) but I would like to stick to the model based approach. void MainWindow::on_pushButton_clicked() { db = QSqlDatabase::addDatabase("QOCI"); db.setHostName("host"); db.setDatabaseName("db"); db.setUserName("uid"); db.setPassword("pw"); db.setPort(port); QString MyQuery = ui->lineEdit->text();

Qt QWebView class custom User-Agent

為{幸葍}努か 提交于 2019-12-28 13:51:12
问题 Is there an easy way to setup the User-Agent the QWebView class is using? The only relevant link I found searching was this http://www.qtforum.org/article/27073/how-to-set-user-agent-in-qwebview.html I'm learning C++/Qt right now and I don't really understant what's explained on that website. Maybe someone knows an easy way to do it? Or can help me understand that code? 回答1: Qt allows you to provide a user agent based on the URL rather than a single user agent no matter what the URL is. The

Slot is being called multiple times every time a signal is emitted

馋奶兔 提交于 2019-12-28 05:58:10
问题 I am using one signal and slot connection in a block. My code as follows in a.cpp { QObject::connect(m_ptheFlange2Details,SIGNAL(GetFlang1DimAfterAnalysis()), this,SLOT(GetFlang1DimAftrAnalysis())); m_ptheFlange2Details->get();// one function inside which i am emiting // GetFlang1DimAfterAnalysis() signal ; QObject::disconnect(m_ptheFlange2Details,SIGNAL(GetFlang1DimAfterAnalysis()), this,SLOT(GetFlang1DimAftrAnalysis())); } Inside the get() function when this emit statement executes, the

How signal and slots are implemented under the hood?

不羁岁月 提交于 2019-12-28 05:49:46
问题 This question is already asked in this forum but I don't understand the concept. I was reading around and it seems that signal and slots are implemented using function pointers i.e the signal is one big function which inside it calls all connected slots (function pointers). Is this correct? And what is the role of the generated moc files in the whole story? I don't understand how the signal function knows which slots to call i.e which slots are connected to this signal. Thanks for your time