Hide QPushButton in release build and show it in debug mode
Solved
General and Desktop
-
Hello! Is there a way to hide certain UI objects when the Qt Widgets application is built in release mode, but show them in a debug build?
For example, let's have a QPushButton added to the MainWindow with Qt Designer. Is it possible to do something like this (pseudo-code below)?
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { ui->setupUi(this); if(RELEASE_MODE) { ui->pushButton->hide(); } }
-
Hi
Yes.
#ifdef QT_DEBUG
....
#endifor
#ifndef QT_DEBUG
....
#endif