qt-creator

QtCreator for Eclipse Users

自闭症网瘾萝莉.ら 提交于 2019-12-24 05:36:13
问题 I recently switched to QTCreator for C++ from Eclipse background. I am looking for these two features in QtCreator... (1) I want to open the file a class is written in by typing that class's name. For example Ctrl + Shft + T in Eclipse. (2) I want to move back to where my cursor were before the current operation. Any shortcuts for above two features? 回答1: To open the file of a class: If you are in a file that is making use of the class, you can place the cursor on the class then press F2. By

QT Creator has Error Locating OpenCV Sub-Headers Within Headers

[亡魂溺海] 提交于 2019-12-24 01:09:35
问题 Problem: I am trying to integrate an OpenCV project I have been working on into a Qt GUI. That being said, I figured the most simplistic way of going about that was to integrate OpenCV into Qt Creator, rather than continue to work in Visual Studio 2015. However, I have ran into a problem. My project will not compile because it cannot find the directory for the sub-header files within whatever header file I call upon. For example, if include highgui.hpp and try to compile my program, it will

Can't see some objects' internals in Qt Creator's Locals and Expressions debug window

☆樱花仙子☆ 提交于 2019-12-23 22:09:43
问题 I'd like to see the member variables of objects whilst debugging in Qt Creator. I can see all of the internals of my own objects, but I can't see the members of a QGraphicsView , for example. I'm also curious to know why it says <unavailable synchronous data> for std::map . Here's a small example of that: #include <map> #include <string> int main(int argc, char *argv[]) { std::map<int, std::string> someMap; someMap.insert(std::make_pair(1, "cats")); someMap.insert(std::make_pair(2, "dogs"));

How rename files .h .cpp in QtCreator

僤鯓⒐⒋嵵緔 提交于 2019-12-23 20:48:46
问题 How rename source files in QtCreator? I have changed name of class but I don't see option to change files it containing. I'm using 2.7.0 version. 回答1: If you're using qmake, renaming is easy. Find your files in "Projects" left panel and choose "Rename" in the context menu. Qt Creator will automatically edit .pro file replacing filenames. This option doesn't work with cmake projects. If you're using cmake, you need to rename files outside of Qt Creator. May be you then need to adjust your

Error while building project when executing build step 'Make'

一曲冷凌霜 提交于 2019-12-23 19:43:48
问题 I've just installed Qt SDK 1.2.1 on my PC. I created a new project as a test: File > New File or Project... > Other Project > Plain C++ Project I chose these build settings: Qt Creator generated this .pro file: TEMPLATE = app CONFIG += console CONFIG -= qt SOURCES += main.cpp and this main.cpp file: #include <iostream> using namespace std; int main() { cout << "Hello World!" << endl; return 0; } The build fails: 13:39:35: Running build steps for project test... 13:39:35: Starting: "C:\Dev\Qt

How to generate 64-bit Visual Studio projects from qmake

拟墨画扇 提交于 2019-12-23 16:50:04
问题 I am using Qt Creator to create some shared library and application projects so that I can easily build them on Windows and Linux. On Windows, some of us prefer using Visual Studio so I want to generate Visual Studio solution and project files from the Qt .pro files using qmake -tp vc -r file.pro . Everything works exactly as expected except that the generated Visual Studio solution and projects only contain 32-bit build configurations and I need 64-bit configurations. It's not a big deal to

QT Subdir- Undefined reference to main - Error

社会主义新天地 提交于 2019-12-23 16:26:13
问题 I have a simple QT subdir project with the structure of TestProject/ TestProject.pro Subdir1/ Subdir1.pro sources/ main.cpp Subdir2/ Subdir2.pro headers/ mainwindow.h sources/ mainwindow.cpp Here are my .pro files TestProject.pro TEMPLATE = subdirs SUBDIRS += \ Subdir1 \ Subdir2 Subdir1.pro SOURCES += \ main.cpp Subdir2.pro QT += sql SOURCES += \ mainwindow.cpp \ HEADERS += \ mainwindow.h \ When I try to run the application I get the following error: (.text+0x18):-1: error: undefined

How to setup Qt Creator to work with CMake on Mac with Qt 4.7 SDK?

旧街凉风 提交于 2019-12-23 15:13:36
问题 I'm using Qt Creator 2.2.1 under MacOS X 10.6.8, standard MacOS X install for CMake 2.8.5 and Qt SDK version 1.1.2 released on June 21st (Qt 4.7.3 libraries). My CMakeLists.txt fails in the find_package for Qt4 -- the second of the lines below: set (CMAKE_MODULE_PATH /Applications/CMake 2.8-5.app/Contents/share/cmake-2.8/Modules) find_package (Qt4 REQUIRED HINTS /Users/myname/QtSDK) I added the first just to make sure it knew where FindQt4.cmake lives, but same error either with or without

QtCreator build system is broken after OSX upgrade

£可爱£侵袭症+ 提交于 2019-12-23 11:53:12
问题 I recently upgraded my OSX to mountain lion and ever since I cannot compile my project using Qt Creator anymore. I get bunch of errors like the following: /Users/user/codes/lib/io/xdmfWriter.cpp:63: error: explicit instantiation of 'std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]' but no definition available /Users

QPushButton changes margins on other widgets in the same layout

拟墨画扇 提交于 2019-12-23 10:56:47
问题 I have a big layout that contains widgets and layouts of the following structure: QVBoxLayout QTableView QPushButton I set the margins, padding, and spacing on the layout to 0. The way this renders on Mac OS X, the button doesn't fill all of its space. Instead, there is some padding around it. Magically, the layout seems to know this, and makes sure the table view is exactly as wide as the button is wide: When I remove the button, the table view returns to its full width: How can I change it