qtcore

QString New Line

房东的猫 提交于 2021-02-10 07:14:00
问题 I want to add a new line to my QString . I tried to use \n , but I am receiving an error of "Expected Expression". An example of my code can be found below: if (ui->lineEdit_Company_Name->text().isEmpty()) ErrorLog = ErrorLog + "Company Name is empty", \r\n; if(ui->lineEdit_Company_Owner->text().isEmpty()) ErrorLog = ErrorLog + "Company Owner is empty", \r\n; 回答1: You need to use operator+, push_back, append or some other means for appending when using std::string , QString and the like.

QString New Line

我只是一个虾纸丫 提交于 2021-02-10 07:06:51
问题 I want to add a new line to my QString . I tried to use \n , but I am receiving an error of "Expected Expression". An example of my code can be found below: if (ui->lineEdit_Company_Name->text().isEmpty()) ErrorLog = ErrorLog + "Company Name is empty", \r\n; if(ui->lineEdit_Company_Owner->text().isEmpty()) ErrorLog = ErrorLog + "Company Owner is empty", \r\n; 回答1: You need to use operator+, push_back, append or some other means for appending when using std::string , QString and the like.

QString New Line

≡放荡痞女 提交于 2021-02-10 07:06:43
问题 I want to add a new line to my QString . I tried to use \n , but I am receiving an error of "Expected Expression". An example of my code can be found below: if (ui->lineEdit_Company_Name->text().isEmpty()) ErrorLog = ErrorLog + "Company Name is empty", \r\n; if(ui->lineEdit_Company_Owner->text().isEmpty()) ErrorLog = ErrorLog + "Company Owner is empty", \r\n; 回答1: You need to use operator+, push_back, append or some other means for appending when using std::string , QString and the like.

QString New Line

痞子三分冷 提交于 2021-02-10 07:06:08
问题 I want to add a new line to my QString . I tried to use \n , but I am receiving an error of "Expected Expression". An example of my code can be found below: if (ui->lineEdit_Company_Name->text().isEmpty()) ErrorLog = ErrorLog + "Company Name is empty", \r\n; if(ui->lineEdit_Company_Owner->text().isEmpty()) ErrorLog = ErrorLog + "Company Owner is empty", \r\n; 回答1: You need to use operator+, push_back, append or some other means for appending when using std::string , QString and the like.

Create .csv file in C++ in qt

若如初见. 提交于 2020-12-05 05:32:28
问题 I want to create an csv file using c++, using Qt for application and UI framework. Is there's library for csv file. 回答1: You could basically look into libqxt. Using QxtCsvModel The QxtCsvModel [libqxt.bitbucket.org] class provides a QAbstractTableModel [qt-project.org] for CSV Files. This is perhaps the easiest way possible to read and write csv files without having to parse the csv format to something qt can understand. It’s as simple as using one line of code, for example the following

Can't call slot or Q_INVOKABLE from QML in subclass of QQmlPropertyMap

佐手、 提交于 2020-07-05 07:25:10
问题 I'm trying to test drive the QQmlPropertyMap class. It seems like it might work well for what I want, if I can subclass it. The documentation here even gives some rudimentary instructions on what to do for subclassing it. Said documentation also indicates that this class derives from QObject . For what it's worth, I'm using QtCreator 2.6.1 on Qt 5.0.0 with QtQuick 2.0. My main.qml: import QtQuick 2.0 Rectangle { width: 360 height: 360 Text { text: owner.field anchors.centerIn: parent }

Can't call slot or Q_INVOKABLE from QML in subclass of QQmlPropertyMap

ぃ、小莉子 提交于 2020-07-05 07:23:12
问题 I'm trying to test drive the QQmlPropertyMap class. It seems like it might work well for what I want, if I can subclass it. The documentation here even gives some rudimentary instructions on what to do for subclassing it. Said documentation also indicates that this class derives from QObject . For what it's worth, I'm using QtCreator 2.6.1 on Qt 5.0.0 with QtQuick 2.0. My main.qml: import QtQuick 2.0 Rectangle { width: 360 height: 360 Text { text: owner.field anchors.centerIn: parent }

ImportError: No module named sip (python2.7 PyQt4)

*爱你&永不变心* 提交于 2020-05-29 11:09:07
问题 I'm currently using Ubuntu 18.04 LTS. I'm trying to install a program that need PyQt4 and QtWebKit, so a manual installation is necessary as QtWebKit have been excluded from PyQt4. I downloaded sip 4.19.12 (with 4.19.14 installation of PyQt4 fails) and PyQt4 4.12.13 I ran a virtualenv, made sure it was working as intended and tried installing sip, which works: $ python configure.py $ make $ make install Then I proceed with the same with PyQt4, with no errors. When I try to run my program .py,

ImportError: No module named sip (python2.7 PyQt4)

那年仲夏 提交于 2020-05-29 11:06:59
问题 I'm currently using Ubuntu 18.04 LTS. I'm trying to install a program that need PyQt4 and QtWebKit, so a manual installation is necessary as QtWebKit have been excluded from PyQt4. I downloaded sip 4.19.12 (with 4.19.14 installation of PyQt4 fails) and PyQt4 4.12.13 I ran a virtualenv, made sure it was working as intended and tried installing sip, which works: $ python configure.py $ make $ make install Then I proceed with the same with PyQt4, with no errors. When I try to run my program .py,

No matching function for QObject::connect

不打扰是莪最后的温柔 提交于 2020-05-26 11:12:17
问题 I'm writing a program that send an UDP frame every 10 mS. Here's how my program is supposed to work : I've got a client class : //Constructor clientSupervision::clientSupervision() { } void clientSupervision::sendDataUDP(){ //Create a frame and send it ... } void clientSupervision::sendDataUDPTimer(int timer){ QTimer *tempsEnvoieTrameSupervision = new QTimer();//Create a timer tempsEnvoieTrameSupervision->setInterval(timer);//Set the interval //Mise en place des connections QObject::connect