Questions tagged as 'qt'

1
answer

Returns the previous month of a date entered in Qt

How do I return the previous month of the date reported in Qt, does it have any function in QDate that does this? I found only the one that adds addMonths . Example: Month 04 reported returns month 03.     
asked by 06.04.2015 / 17:46
1
answer

Problems eliminating node of a Vector

I have two classes: class CAlbum { private: QString Nome; /**< Nome do Álbum */ QString Descricao; /**< Descrição do Álbum */ QString Diretoria; /**< Diretoria onde se encontra o Álbum */ //QPixmap Imagem; std::vec...
asked by 29.05.2016 / 06:08
1
answer

find_package failed to generate project (in Qt) with CMake

I'm trying to generate the build configuration from a simple example in Qt using CMake. The example code is this: #include <QApplication> #include <QTextEdit> int main(int argc, char** argv) { QApplication app(argc, argv);...
asked by 24.02.2016 / 15:28
1
answer

QVector for QImage

I have to transform a QVector 2d into a QImage to display the image in a label. The QVector in this case is an array of integers with value from 0 to 255 representing an image in PGM or PPM, this vector makes grayscale or RG...
asked by 03.04.2014 / 02:34
2
answers

QMYSQL driver not loaded QtCreator

I'm trying to connect to the database with QtCreator as follows: this->db = QSqlDatabase::addDatabase("QMYSQL"); this->db.setHostName("localhost"); this->db.setDatabaseName("Pessoa"); this->db.setUserName("root"); this->db.setPa...
asked by 18.03.2014 / 23:30
3
answers

AttributeError: 'QString' object has no attribute 'strip'

I'm doing a small application in Pyqt4 to understand the operation. In a given part, I'm using a callback function to display a QLabel text that is typed in QtextEdit . This text should be trimmed (remove spaces before and after...
asked by 14.10.2016 / 19:28
2
answers

Is it possible to use Elide with QLabel?

I want to use the element QLabel and if the text execest the width size it may look like this: Add 3 points to the right: Foo bar baz foo bar... Add 3 points from the center: Foo bar ba...oo bar baz Add 3 points left:...
asked by 21.12.2016 / 13:06
1
answer

Command to exit the scope of a function (equivalent to 'break')

How can I create an algorithm in C++ (using Qt ) to abort processing of the following codes? I have to validate many different entries and I do not want to be creating if else if else . It gets ugly fro...
asked by 17.03.2014 / 17:59
2
answers

Convert QVectorQString to int in C ++

I have a QVector and I want to convert it so I can make comparisons to find out which one is greatest. I tried to do this but it does not work: QVector<QString> vector; std::atoi(vector.value (i).toStdString ());     
asked by 01.06.2014 / 02:40
1
answer

QT - Identify coordinates of an image in a different sized QLabel?

Hello, I recently had a question about how to trace coordinates of a QLabel using the mouse cursor. It worked well for what I thought of doing. What I want to do is the following, I have an image that I project on the screen through a QLabel, I...
asked by 07.08.2016 / 03:19