user3733164

1

votes
0

answer
53

views

Why a NULL value in PostgreSQL table is returned as 0?

I have the following PostgreSQL table, called mytable: id | col1 | col2 ----+----------+-------- 0 | | 0 1 | 0 | 1 2 | 0 | 2 I am trying to get the value of col1, where col2 is equal to 0: const QString &str('SELECT col1 FROM mytable WHERE col2 = 0');...
user3733164
0

votes
0

answer
4

views

Call pyqt widget from Qt widgets application

I am trying to extend my Qt application with python scripts plugins. It works fine if I call any not pyqt script. It works fine too if I call any pyqt script from c++ function, but I am outside a Qt Widget Application. Something like that: #include '/usr/include/python3.5m/Python.h' int CargaPlugins...
user3733164
1

votes
1

answer
29

views

Assign select value to variable into Execute in PostgreSQL 9.3 function

Consider a function like that: CREATE OR REPLACE FUNCTION public.foo( string1 character varying ) RETURNS integer AS $BODY$ DECLARE id1 INTEGER; BEGIN id1 := (SELECT id FROM mytable WHERE mycolumn = string1); END; ...... It works fine and I get the id1 value for using in other part of the funct...
user3733164
1

votes
1

answer
25

views

Return a table of custom type in Postgresql

I have a function like that foo() RETURNS TABLE(col1,col2,col3) AS.... But I want to change it for return a custom type CREATE TYPE mytype AS (col1,col2,col3); And: foo() RETURNS mytype AS.... But I don't know how can I do it
user3733164
1

votes
1

answer
699

views

How to use QProcess?

I want to open a project of QGIS from a QProcess object. If I am under console I must type qgis --project /path/of/my/qgis/project/nameofproject.qgs Then, I do the next: QString app='qgis'; QStringList arguments; arguments.append ('--project /path/of/my/qgis/project/nameofproject.qgs'); And then I c...
user3733164
2

votes
3

answer
198

views

Qt doesn't read a string properly in Linux

Well, I'll try to explain. I have a Class named Calc that evaluate a string or const char* numeric expresion, like '2*(3/5)' or similars. Now I am trying to build a calculator in Qt, using those class to evaluate the input of a QLineEdit. The class works like that: Calc(const std::string &sExpresion...
user3733164