FAQ Database Discussion Community


how to use a library in c++ Qt creator

c++,qt,include,qt-creator,dicom
I downloaded a library for processing DicOM FILES . The tree of library is : |--include |-----dicom.h |-----dicomcfg.h |--lib |--------dicomsdl.lib But I do not know how to use and built-in Qt Creator . If anyone can help me I will be very grateful....

QT duplicate symbol in mainwindow.o and ***.o file

c++,qt,qt-creator,tinyxml,duplicate-symbol
I am a little confused, I am trying to develop a simple application. Application Flow: MainWindow -> Dialog 1 -> Dialog 2. MainWindow imports Dialog1.h and Dialog1.h imports Dialog2.h 1) If I import TinyXML Libraries in both Dialog1.cpp and Dialog2.cpp, the compiler throws following error: duplicate symbol **RANDOM TINYXML CLASS*...

Debug error: &“warning: GDB: Failed to set controlling terminal: Inappropriate ioctl for device\n”

debugging,gdb,qt-creator,ubuntu-14.04
I've recently updated my system to Ubuntu 14.04 LTE. I've also updated the version of my QtCreator to 3.3. When I run in Release mode, no problem. However, when I tried to debug, something strange happens: The system throws a Segmentation Fault, and the application give me this message: &"warning:...

Qt Creator's project messed up

c++,qt,qt-creator,qcustomplot
I am trying to add crypto++ library to Qt project in QtCreator IDE. I've made a mistake by adding crypto++ sources to project instead of adding .so library. Thus I've deleted crypto++ directory from qt projects to regain pre-crypto++ project state, which compiled and linked without problems. Before crypto++ I've...

Qt : No rule to make target '../controlpanel.ui', needed by 'ui_controlpanel.h'. Stop

c++,qt,mingw,qt-creator
I met very strange problem on the Qt Creator. :-1: error: No rule to make target '../controlpanel.ui', needed by 'ui_controlpanel.h'. Stop. mingw32-make[1]: *** No rule to make target '../controlpanel.ui', needed by 'ui_controlpanel.h'. Stop. mingw32-make: *** [debug] Error 2 makefile:34: recipe for target 'debug' failed 22:43:11: The process "C:\Qt\Qt5.4.0\Tools\mingw491_32\bin\mingw32-make.exe" exited with...

How to manage QSplitter in Qt Designer

c++,qt,qt-creator,qt-designer,qsplitter
When I press a button, I bring up a dialog where user select things and press 'Ok' at the end. I want a splitter in this dialog. Left pane will show tree and right will show something else. How do I do that right? From Qt example itself: QSplitter *splitter...

Determining if a file is parsed by Qt Creator (CUDA Syntax highlighting)

cuda,ide,qt-creator
I switched recently from Visual Studio to Qt Creator. I am still using the Visual Studio Compiler on Windows as CUDA has this as a dependency. CUDA uses some functions and keywords that are only valid when compiled by nvcc, so I did a workaround in Visual Studio to enable...

glew linking problems qt creator qmake

opengl,linker,qt-creator,qmake,glew
I am trying to get a project working with SDL2, assimp, opengl, and glew and cannot get glew to link properly (almost a duplicate but a more comprehensive question and answer, I think). My qmake .pro file : CONFIG += console CONFIG -= app_bundle CONFIG -= qt HEADERS += \...

Qt creator: include path for external lib not found

qt,qt-creator
I'm trying to add net-snmp lib to my project using win7 + cygwin: Project file seems to contain valid lib and path entries: win32:CONFIG(release, debug|release): LIBS += -L$$PWD/C:/usr/lib/ -lnetsnmp else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/C:/usr/lib/ -lnetsnmpd INCLUDEPATH += $$PWD/C:/usr/include DEPENDPATH += $$PWD/C:/usr/include But I can't build the project, because include file...

Cannot connect (null)::selectionChanged to QTableView

c++,qt,qt-creator,signals-slots,qtableview
I have the following promoted QTableView: class QRightClickableTableView : public QTableView { Q_OBJECT public: explicit QRightClickableTableView(QWidget *parent = 0): QTableView(parent) {} private slots: void mouseReleaseEvent(QMouseEvent *e) { if(e->button()==Qt::RightButton) emit rightClicked(); else if (e->button()==Qt::LeftButton) emit leftClicked(); } signals: void rightClicked(); void leftClicked(); }; When binding the selectionChanged signal of QRightClickableTableView, but...

How can I force QT Creator's toggle comment feature to not skip lines

c++,ide,qt-creator
Using QT Creator, given the following: int example = 1; if (example == 1) { example = 2; } If I select that text and enter ctrl-/ to toggle comments on the selection, I get: //int example = 1; //if (example == 1) //{ // example = 2; //} But...

How to avoid user to click outside popup Dialog window using Qt and Python?

qt,user-interface,python-3.x,dialog,qt-creator
I created a Dialog window using Qt Creator and Python. I would like that Window stays on the top of my Gui AND avoid users to click outside that Dialog Until this dialog was closed.

Unable to create a debugger engine of the type “No engine”

c++,windows,gdb,qt-creator
I just installed Qt Creator (Windows 64 bits) and I am checking that everything works as expected. At this point the only problem I have is related to the debuggers. Firstly I tried adding gdb manually (gdb.exe) and some problem about python popped-up, so I added gdb-python (gdb-python27.exe) and the...

How to import the QML-Book examples into QT Creator 3.4.0?

qt,qml,qt-creator
How can I import these code examples into QT Creator 3.4.0 ? I tried the available import options but they don't work. I tried to create an empty QML project and add the rectangle.qml file to it. When I tried to run it, nothing showed up. The book examples contain...

Can Qt Creator recognize TODO and FIXME comments?

c++,qt-creator,todo,fixmetodo
Is there a way to make Qt Creator recognize TODO and FIXME comments, so that I can access a compiled list somewhere of all these comments?

Make with Qt Creator : no rule to make target needed by

qt,compilation,qt-creator,qmake
Using QT Creator I'm having a project (let's call it Proj A) that has a dependency on a static linked project (let's call it Proj B). Proj A includes some headers needed from Proj B . In Proj B I removed a header file named "SomeHeader.h" that was used by...

Boost, Windows, and QtCreator

c++,windows,boost,qt-creator
I've been working with boost under linux for awhile now, but I will soon be working on a Windows project, so I decided to setup Boost for windows, and get it working with QtCreator (also worked with under linux). So, downloaded and built the windows boost libs and went to...

Qt: QHostAddress: No such file or directory

c++,qt,qt-creator
I'm new to Qt and when I try to run a program I get import error fatal error: QHostAddress: No such file or directory Caused by the import in main.cpp #include <QCoreApplication> #include <QHostAddress> It seems that there is missing of QHostAddress.h while QCoreApplication.h is available...

undefined reference to `[email protected]' with Crypt32.Lib && wincrypt.h included

c++,qt,qt-creator,wincrypt
I have a problem with my one of my projects. I use QtCreator with MinGW and Qt 5.4.0 When I try to compile, this simple line gets me some errors : CryptUnprotectData(data.password, NULL, NULL, NULL, NULL, (DWORD) 0, data.uncryptedPassword); ( with DATA_BLOB* data.password and DATA_BLOB* data.uncryptedPassword ) Gets me :...

Static linking against non-binary libs

c++,qt,static-libraries,qt-creator,static-linking
I want to make use of two libraries QCustomPlot and Eigen with Qt Creator on OS X. Both do not need to be installed and work fine if I just put them into my project folder and add them to the project. They do not have to be installed, "you...

Running python code exported from qt creator and converted to python using pyqt5

qt,python-3.x,qt-creator,pyqt5
I recently encountered this error after attempting to run my python script. In short, I simply don't understand how I've fed three arguments. I've included what I considered to be the most relevant snippets of code. Help is very appreciated. Thank you. Traceback (most recent call last): File "DESeq_rpkm_gui.py", line...

How to do conditional statements based on SqlQuery results in QtCreator?

c++,sqlite,qt-creator,qsqlquery
What I want to do is to query.exec() a DELETE statement, and if delete is successful I want to display the updated table, else display a QMessageBox saying that the name did not match. I was under the impression that if DELETE statement does not find an entry, query.exec() will...

What does the “I” stand for in the QtCreator API for classes such as “IRunConfigurationFactory”, “IFile”, “IProjectManager”?

qt,qt-creator
What does the "I" stand for in the QtCreator API for classes such as "IRunConfigurationFactory", "IFile", "IProjectManager", etc? What does this indicate to the person who looks to use the API?...

QtDesigner for Raspberry Pi

qt4,raspberry-pi,qt-creator,qt-designer
I am building a UI with QT Designer. I need this UI to run on a Raspberry Pi. What do I need to do to make the UI for the Pi? Does it have to be written in a specific language like python or can I just write it in...

lowest() is not a member of std::numeric_limits

c++,gcc,qt-creator
I am trying to compile the following code: #include <iostream> #include <limits> int main() { std::cout << std::numeric_limits<int>::lowest() << std::endl; } and I get the following error: ../main.cpp:5: error: 'lowest' is not a member of 'std::numeric_limits<int>' cout << std::numeric_limits<int>::lowest() << std::endl; ^ I am using QT Creator 3.1.1 on Ubuntu...

Qt Creator does not find Boost via CMake, CMake itself does

boost,cmake,qt-creator
I have a project which uses Boost and Qt and is compiled using CMake. When I build it using cmake … -DCMAKE_RELEASE_TYPE=Release -G ninja and build it using ninja, it works just fine. To to UI and debugging, I would like to use Qt Creator. When I open the CMake...

Extending QFrame in custom class

qt,compiler-errors,qt-creator,qframe
I want to create my own custom widget that extends a QFrame, however when I am trying to make the constructor I get an error. #ifndef CONTROLFRAME_H #define CONTROLFRAME_H #include <QObject> #include <QFrame> #include <QWidget> #include <QtGui> class ControlFrame : public QFrame { Q_OBJECT public: ControlFrame(QWidget *parent = 0); ~ControlFrame();...

Adding an image file (.PNG) programatically in Qt Creator using QPixmap and QLabel

c++,qt,qt-creator
Good morning all, I am having trouble adding a .PNG file to my Qt Creator project using the QPixmap and QLabel method. The different ways I've tried to do this (in code snippet format) appear below. System: Raspberry Pi 2 running Debian Wheezy Builder: Qt Version 4.8.2 For Embedded Linux...

Unable to build Android APK in Qt Creator

android,qt,android-ndk,qt-creator
I am trying to build an android APK in Qt Creator 3.0.1 . I have properly given the configured Android SDK, NDK, Ant, Java Jdk. In Build Android APK step under Build there is a option to specify Android Build SDK i.e target SDK. I am currenty using API 21...

How to prevent a user from moving the size of a column in QtableWidget using Python and Qt?

python,qt,qt-creator,qtablewidget
I created a QTableWidget whith two columns in Qt Creator. I already found out how to set the width of a column with the setColumnWidth() function. But in my GUI the user can still change the width of columns. How can I set the width to a fixed size and...

Qt Creator 3.3.0: Open file in project without using mouse

c++,qt-creator
I'm trying Qt Creator to see if it can be used as Visual Studio replacement. (seeing that Mingw 4.9 is bundled with it and has decent C++11 support and u8 strings which aren't present in VC2013). I can't, however, find a way to open existing file in a project without...

Can't select GDB in Qt Creator on Windows

c++,windows,gdb,qt-creator
I've selected GDB instead of CDB as the debugger in Qt Creator on Windows: But when I start debugging a program, it fails with this error: Unable to create a debugger engine of the type "No engine" It works if I select CDB from the Combo. Why am I getting...

How to change build directory in QtCreator?

build,directory,cmake,qt-creator
I have a cmake based C++ project done with QtCreator. I wrote the CMakeLists.txt files manually. When building either from the command line of from QtCreator, I get this directory structure, as expected: MyProj/ - source code MyProj_build/ - object files and executable; I launch cmake from here Now I...

Qt Creator can't break on thrown exceptions (when using CDB as debugger)

c++,debugging,qt-creator,breakpoints,cdb
I set Qt Creator to break when a C++ exception is thrown: I then tested it with this code: try { throw std::runtime_error("error"); } catch (std::exception &e) { qDebug("%s", e.what()); } But it didn't break on throw std::runtime_error("error");. I'm using CDB, not GDB, because I'm using the MSVC Kit. Edit:...

How to dock horizontally Qt widgets?

c++,qt,qt-creator,qt-designer
I am migrating to Qt from Microsoft Visual Studio. Common design for dialog boxes in desktop applications is set of labels and fields, where dialog looks like grid with labels and related fields. So, we can have Username label and text box to the right from that label, then Password...

QMake conditions don't work

c++,qt,qt-creator,qmake
I created a project in which I would like to have different source files added to my project for different platforms. For that I used conditions: QT += core gui greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = untitled16 TEMPLATE = app MY_WIN_SOURCES = \ file1.cpp \ file2.cpp MY_WIN_HEADERS = \...

QT 4.5.2, QTableView is not editable

c++,qt,qt-creator
I just add a new QTableView to my form, set the model and configure it, but i cant edit cells. In other table there is no problems with editing. Whats wrong with me? Code: void MethodicWorkWidget::setupMethod3Model() { method3Model = new ExtSqlModel(this); method3Model->setTable("methodworks3"); method3Model->setEditStrategy(QSqlTableModel::OnFieldChange); int typeInd = method3Model->fieldIndex("typeid"); method3Model->setRelation(typeInd, QSqlRelation("methodworks3types", "id",...

Installation directory in CMakeLists.txt, suitable for Visual Studio and Qt Creator

c++,visual-studio,cmake,qt-creator
I have to deal with CMake 3.x, Qt Creator 3.3.0, Qt 4.8.6, Visual Studio 2008 in Windows (and rarely Qt Creator + GCC in Debian). This instruction install(TARGETS ${PROJECT} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) is not comfortable because of mixing debug and release *.lib files in the same directory. I'd like to save...

Qt Creator doesn't display QML folder

qt,qml,qt-creator,qtquick2,qt-quick
I have a Qt project in Qt Creator. I have a qrc file with the QMLs registered and everything works. However for some reason the "projects" view of Qt Creator doesn't show the QML folder (screenshot attached) like it does for any example project. I'm just curious. Why does QML...

implement empirical cdf c++

c++,qt-creator,cdf
I want to define empirical cdf in C++ according to intervals fixed by N samples received and I should save the 2 vectors (T and Y)! I made this code but it didn't work: double cum_dist_funct::real_cdf_function(vec X,double x,int N,int Ndft,vec &T, vec &Z) { Z.set_size(X.length()); Z.zeros(); vec V; V.set_size(N); V.zeros();...

Qt Creator puts quotation marks around command name in custom process step

windows,qt,qt-creator
I'm trying to add a simple custom process step during build to copy a text file from source dir to build dir. The command is just copy /y sourceFile destFile, it can't really get any more simple. I have copy in command field, and /y %{sourceDir}\Config.ini %{buildDir}\Config.ini in arguments field....

How can I listen to a C++ signal from QML?

c++,qt,qml,qt-creator
I have what I'm calling a C++ "service" who's interface I want to expose to QML. I'm trying to use QQmlContext's setContextProperty to link the object into the QML and connect to it from a QML Connections block. QML isn't complaining with a reference error as it did previously when...

Using Poco with QtCreator (Windows)

qt-creator,poco-libraries
I'm trying to use Poco 1.6.0 in QtCreator, and I'm getting some strange errors on my build. Most of the errors are along the following theme: warning: 'void Poco::Dynamic::Var::swap(Poco::Dynamic::Var&)' redeclared without dllimport attribute after being referenced with dll linkage I've built Poco with MinGW and was planning to use that,...

Selective histogram equalization (only on a specified area of the image)

c++,opencv,qt-creator,histogram
I am developping on Qt creator, with opencv. I have to developp a program that does the histogram equalization of an image. My images are 16bits grayscale images so I cannot use the opencv function "equalizeHist" because it only works with 8bit grayscale images. The code I wrote to do...

Run the code continuously until “Stop” is pressed

c++,qt-creator
I want to execute some code when I press a "Start" button and it have it continue running until I press "Stop". However, with the following code once I press "Start", I can't press "Stop" anymore: void MainWindow::on_pushButton_clicked() { if (ui->pushButton->text()=="Start") { ui->pushButton->setText("Stop"); vec spectrum_sensed,Sn,sigma,alpha; mat ydata; condition=true; while (condition)...

Tricky bugs in refacored pong from sfml examples

c++,qt-creator,sfml,pong
I am learning SFML by pong example. Original code can be found there. I am trying to put this lines in a function and then make a call: sf::RenderWindow window( sf::VideoMode( gameWidth, gameHeight, 32 ), "SFML Pong", sf::Style::Titlebar | sf::Style::Close ); window.setVerticalSyncEnabled( true ); sf::RenderWindow CreateWindow( int width, int height,...

IDE doesn't recognize the method

c++,dictionary,hash,qt-creator,code-completion
I'm trying to acces the cityMethod() inside the class City. class City { void cityMethod() { } } So, I do: map<string,City> mymap; City c; mymap["Madrid"] = c; Now, when I do this: mymap["Madrid"].cityMethod(); Ok, it works. But the IDE(Qt) doesn't recognize the "cityMethod". Am I doing something wrong? Is...

Show QWidget or QWindow near QSystemTrayIcon in QT C++

c++,qt,qt-creator
I have managed to get the QSystemTrayIcon visible similar to this: using the following line of code (with the signal slots working): #include "dialog.h" #include "ui_dialog.h" #include <QMessageBox> #include <form.h> Dialog::Dialog(QWidget *parent) : QDialog(parent), ui(new Ui::Dialog) { ui->setupUi(this); QIcon icon("/Users/JohnnyAppleseed/IMAGE.png"); m_ptrTrayIcon = new QSystemTrayIcon(icon ); m_ptrTrayIcon->setToolTip( tr( "Bubble Message" )...

Why is BUILD FAILED?

android,qt,qt-creator
I am trying to run simplest Qt application on android device. There are AVD and real phone with android. For both of them I get error: BUILD FAILED /home/user1/dev/android-sdk-linux/tools/ant/build.xml:649: The following error occurred while executing this line: /home/user1/dev/android-sdk-linux/tools/ant/build.xml:655: Execute failed: java.io.IOException: Cannot run program "/home/user1/workspace/build-Test11123-Android_for_armeabi_v7a_GCC_4_9_Qt_5_4_2-Debug/android-build/${aidl}": error=2, No such file or...

How to share build step in Qt Creator

qt,qt-creator,qt5,qmake
Qt Creator has an option to add custom build steps for the project which is cool. However the command line for the additional build step is stored in the .pro.user file which should not be added to version control, because it contains machine specific data. When I push my project...

Qt Creator. Change code generating template for slots

c++,qt,qt-creator,code-generation
I'm using Qt Creator 3.2.1 based on Qt 5.3.2 When in the designer, you can right click on a pushButton and select "Go to slot ...". A dialogue box opens allowing you to select a slot ... for example Clicked(). Then you will receive autogenerated method void MyClass::on_Button_clicked() {} But...

QtCreator - start external tool in an interactive bash

linux,bash,terminal,settings,qt-creator
A while ago I discovered that you can make QtCreator call external tools directly from within the IDE and pass various arguments to those via the Tool->External. I find this pretty convenient however I'm currently struggling with the issue of starting a terminal-based application in an interactive bash. I am...

Target x86 instead of x64?

qt,qt-creator
Using QtCreator with visual studio 2013 x64 kit (which I think contains compilers for both 32 bit and 64 bit) How can I tell it to specifically target 32 bit instead of 64 bit?...

How do I specify an iOS simulator in Qt Creator?

ios,qt,ios-simulator,qt-creator
In Qt Creator, when I click the run button in the bottom left corner to build and run my program in an iOS simulator, it is using the iPhone simulator, but I want to use the iPad simulator instead. In XCode, you can specify which iOS simulator to run via...

Smart code completion in Qt Creator

c++,qt-creator,code-completion
Is Qt Creator present smart code completion like Intellij IDEA? For example: void main() { QString simpleVariableName = "First string"; QString anotherVariableName = "Second string"; // If I type "variable" and press Ctrl + Space I would like to get // all matching variables(simple and another) in popup list. In...

Replace function $$find always returns nothing

qt,qt-creator,qmake
I have a QT project file (.pro), and would like to add some compiler specific flags. Rather than typing out if win32-msvc2013|win32-msvc2010|... for every version of MSVC, I thought I could just search for the substring "msvc". I did some research and found the find function, which seems perfect for...

QtCreator CMake project - how to show all project files

c++,c,cmake,qt-creator
I use QtCreator to open CMake project. Some directories apart from CMakeLists.txt contains only headers files *.h and for those directories QtCreator in the project tree view shows only CMakeLists.txt. How to fix that ? I need to see all project files from QtCreator.

How can I change the --android-platform in Qt Creator to not be android--1 in debug mode?

android,qt,qt-creator,android-sdk-tools,qt-necessitas
I'm trying to run a new Qt Quick application on my android device through Qt Creator. However, Qt Creator keeps using Android API version 1 whereas I would like it to target an Android API version 10 ( aka Android 2.3.3). When I run Debug->Start Debugging and then select either...

OpenGL Ubuntu 12.04 QtCreator - undefined reference to `__glewTexImage3D' [duplicate]

opengl,ubuntu,qt-creator
This question already has an answer here: What is an undefined reference/unresolved external symbol error and how do I fix it? 18 answers I try to run the code from the website.It can work in Win7,but it have error in Ubuntu. error: undefined reference to `__glewTexImage3D' I fixed some...

Python PySide modal Qdialog without OS decoration (title bar, …)

python,qt,qt-creator,pyside,qdialog
I'am going to start coding a GUI with Python and Qt using PySide. I'am using Qt-creator to generate ui for my application. I need a dialog without os decoration such titlebar, statusbar, ... And this Dialog must be modal, or at least it must close when I click outside its...