qt

Why am I getting server replied forbidden from google drive rest api?

隐身守侯 提交于 2021-02-08 10:42:33
问题 My Goal: I am trying to connect my Qt desktop app with google drive. Right now my goal is simple i.e get list of all files from my drive (In JSON form) What I have done so far. I have followed this tutorial Connecting your Qt application with Google Services using OAuth 2.0 and created my own wrapper class for it. I have followed all the steps till grant() function is called. The scope is https://www.googleapis.com/auth/drive . Everything is working fine till now. I used the signal

Few shell commands doesn't work when I Invoke a script via QProcess in Qt

微笑、不失礼 提交于 2021-02-08 10:28:25
问题 Hi I have a shell script which executes some commands, when I invoke that script using terminal it works fine but when I invoke the script using a QProess few commands doesn't works well. Here is the script #!/bin/bash echo "Invoking the script" euid=$1 if [ $# -ne 1 ]; then echo "Arguments missing" exit 1 fi echo "arg 1: $1" data=$1; name=$(echo $data | cut -b 1-7) age= $(echo $data | cut -b 10-11) echo "$name" echo "$age" Here is the way I use QProcess // Environment setup

Using UWP API with Qt

懵懂的女人 提交于 2021-02-08 10:27:22
问题 In Visual Studio I included: using namespace Windows::Devices::Enumeration; and it works. When adding/including namespaces in Qt I get errors. Any documentation how to use UWP API with Qt ? For example: .h #include <windows.devices.enumeration.h> .cpp DeviceAccessInformation deviceInfo; I get error: C2065: 'DeviceAccessInformation': undeclared identifier Update: I have found some information related the issue. So I have added the Win SDK path ( INCLUDEPATH += "C:/Program Files (x86)/Windows

Few shell commands doesn't work when I Invoke a script via QProcess in Qt

不羁岁月 提交于 2021-02-08 10:26:04
问题 Hi I have a shell script which executes some commands, when I invoke that script using terminal it works fine but when I invoke the script using a QProess few commands doesn't works well. Here is the script #!/bin/bash echo "Invoking the script" euid=$1 if [ $# -ne 1 ]; then echo "Arguments missing" exit 1 fi echo "arg 1: $1" data=$1; name=$(echo $data | cut -b 1-7) age= $(echo $data | cut -b 10-11) echo "$name" echo "$age" Here is the way I use QProcess // Environment setup

Design custom QT Widget on top of QT Window

好久不见. 提交于 2021-02-08 10:22:47
问题 I have a QT main window and on top of this I want to add a widget ( containing buttons), as similar to image below. If I add a dock widget , it is added in separate row, but not added as overlay on existing main window. Any inputs ? 回答1: The easiest is to set your overlay widget's parent to be the main window. But because it will not be in any layout you have to take care of its geometry yourself. In case you want to have multiple overlays, the last added will be the top most. #include

How to create/destroy dynamic objects after the same event in QML?

青春壹個敷衍的年華 提交于 2021-02-08 10:20:47
问题 I have a GridLayout dynamicLayout which has dynamically created/destroyed elements. Create/destroy happens when I click a Button myButton , for which I also provided the code below. GridLayout { id: dynamicLayout anchors.fill: parent Component { id: imageComponent Image { visible: true function deleteImage() { console.log("destroying image") destroy() } } } } Button { id: myButton visible: true x: 200 y: 200 onClicked: { createImageObjects(); } } function createImageObjects() { if

How to create/destroy dynamic objects after the same event in QML?

↘锁芯ラ 提交于 2021-02-08 10:20:23
问题 I have a GridLayout dynamicLayout which has dynamically created/destroyed elements. Create/destroy happens when I click a Button myButton , for which I also provided the code below. GridLayout { id: dynamicLayout anchors.fill: parent Component { id: imageComponent Image { visible: true function deleteImage() { console.log("destroying image") destroy() } } } } Button { id: myButton visible: true x: 200 y: 200 onClicked: { createImageObjects(); } } function createImageObjects() { if

c++ error: :-1: error: symbol(s) not found for architecture x86_64 - in Qt-Creator

给你一囗甜甜゛ 提交于 2021-02-08 10:18:42
问题 i'm working on an exercise at uni and every time i try to compile the main.cpp i got always the same error. actor.h: class Actor { public: Actor(); Actor(double x0, double y0); void move(); double pos_x(); double pos_y(); static const int ARENA_W = 500; static const int ARENA_H = 500; }; plane.h (subclass of actor): class Plane:Actor { public: Plane(); Plane(double x0, double y0); void move(); double pos_x(); double pos_y(); //int dx = 5; static const int W = 50; static const int H = 20;

How to update QTableView when database updated?

走远了吗. 提交于 2021-02-08 09:52:48
问题 I use QSqlRelationalTableModel to extract data from database, and use tableView to show it. Now, when I update my database, how to update tableView automatically to show it? I know i need to use function dataChanged() to make this automatically, but i do not know how to use it? Any suggestion will be appreciated. The main code is as follows: QSqlRelationalTableModel *model = new QSqlRelationalTableModel(NULL, db); model->setTable(tableName); model->select(); tableView->setModel(model);

QML: Multi-level Menu from ListModel

只愿长相守 提交于 2021-02-08 09:50:55
问题 I have an example multi-level ListModel: ListModel{ id: myModel ListElement{ name: "File" subItems:[ ListElement{ name: "Open" }, ListElement{ name: "Open Recent" subItems:[ ListElement{ name: "Bla.txt" } ] }, ListElement{ name: "Save" }, ListElement{ name: "Save as" }, ListElement{ name: "Exit" } ] } ListElement{ name: "Edit" subItems:[ ListElement{ name: "Undo" }, ListElement{ name: "Redo" }, ListElement{ name: "Select All" } ] } ListElement{ name: "Help" subItems:[ ListElement{ name: