(C++) Qt Creator differences between Run and Debug modes

February 24, 2017 · View on GitHub

 

 

 

 

 

(C++) Qt CreatorWindowsVirtualBoxUbuntu Qt Creator differences between Run and Debug modes

 

Qt FAQ.

 

There are the following differences between Run and Debug mode:

  • The slashes in a filename's path vary (*):
    • WindowsVirtualBoxUbuntu Desktop Run: 'C:\QtSDK\Projects\CppQtCreatorDifferences-build-desktop\debug\CppQtCreatorDifferences.exe' (screenshot (png))
    • WindowsVirtualBoxUbuntu Desktop Debug: 'C:/QtSDK/Projects/CppQtCreatorDifferences-build-desktop/debug/CppQtCreatorDifferences.exe' (screenshot (png))
    • WindowsVirtualBoxUbuntu Simulator Run: 'C:\QtSDK\Projects\CppQtCreatorDifferences-build-simulator\debug\CppQtCreatorDifferences.exe' (screenshot (png))
    • WindowsVirtualBoxUbuntu Simulator Debug: 'C:/QtSDK/Projects/CppQtCreatorDifferences-build-simulator/debug/CppQtCreatorDifferences.exe' (screenshot (png))
    • Ubuntu  Desktop Run: '/home/richel/qtsdk-2010.04/bin/Projects/Website/CppQtCreatorDifferences-build-desktop/CppQtCreatorDifferences' (screenshot (png))
    • Ubuntu  Desktop Debug: '/home/richel/qtsdk-2010.04/bin/Projects/Website/CppQtCreatorDifferences-build-desktop/CppQtCreatorDifferences' (screenshot (png))
    • Ubuntu  Simulator Run: '/home/richel/qtsdk-2010.04/bin/Projects/Website/CppQtCreatorDifferences-build-simulator/CppQtCreatorDifferences' (screenshot (png))
    • Ubuntu  Simulator Debug: '/home/richel/qtsdk-2010.04/bin/Projects/Website/CppQtCreatorDifferences-build-simulator/CppQtCreatorDifferences' (screenshot (png))
  • Different DLL's/shared libaries are called

 

(*) This is checked by the program below.

 

 

 

 

 

Technical facts

 

Application type(s)

Operating system(s) or programming environment(s)

IDE(s):

Project type:

C++ standard:

Compiler(s):

Libraries used:

  • Qt Qt: version 4.7.0 (32 bit)

 

 

 

 

 

Qt project file: CppQtCreatorDifferences.pro

 


#------------------------------------------------- # # Project created by QtCreator 2011-02-09T11:50:27 # #------------------------------------------------- QT       += core gui TARGET = CppQtCreatorDifferences CONFIG   += console CONFIG   -= app_bundle TEMPLATE = app SOURCES += main.cpp \     dialog.cpp HEADERS += \     dialog.h FORMS += \     dialog.ui unix:!symbian {     maemo5 {         target.path = /opt/usr/bin     } else {         target.path = /usr/local/bin     }     INSTALLS += target }

 

 

 

 

 

dialog.cpp

 


#include "dialog.h" #include "ui_dialog.h" Dialog::Dialog(QWidget *parent) :     QDialog(parent),     ui(new Ui::Dialog) {     ui->setupUi(this); } Dialog::~Dialog() {     delete ui; } void Dialog::setText(const char* c) {   ui->label->setText(c); }

 

 

 

 

 

dialog.h

 


#ifndef DIALOG_H #define DIALOG_H #include <QDialog> namespace Ui {     class Dialog; } class Dialog : public QDialog {     Q_OBJECT public:     explicit Dialog(QWidget *parent = 0);     ~Dialog();     void setText(const char* ); private:     Ui::Dialog *ui; }; #endif // DIALOG_H

 

 

 

 

 

main.cpp

 


#include <QApplication> #include "dialog.h" int main(int argc, char *argv[]) {   QApplication a(argc, argv);   Dialog d;   d.setText(argv[0]);   d.show();   return a.exec(); }

 

 

 

 

 

Downloads