System: Red Hat Enterprise Linux 7.2 Qt Creator 4.1.0 Qt 5.6.1
So, when I use Qt Creator to build a GUI everything looks great. However, once I compile and run the check boxes and radio buttons go away and push buttons look like labels.
I have used style sheets to fix the push buttons using borders and gradients but I can't seem to figure out the check boxes or radio buttons.
#include <QApplication>
#include <QWidget>
#include <QCheckBox>
#include <QVBoxLayout>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QWidget w;
QCheckBox* box = new QCheckBox();
box->setText("BLARG");
QVBoxLayout* layout = new QVBoxLayout;
layout->addWidget(box);
w.setLayout(layout);
w.show();
return a.exec();
}
[![minmal example][1]][1]
This doesn't seem to be causing too many issues or my google-fu is weak as I can't find examples of anybody else having this issue. So, does anybody know why this would be happening? Is the only solution to replace the check boxes and radio buttons with images of my own using style sheets? I'm going to do that for now but would prefer to do this the correct way if possible.
Update 1: Just because I should know better I went ahead and updated Qt to the latest and greatest 5.8.0. Still having the same issue.
Update 2: So, turns out that Qt Creator was acting up. When the program mysteriously stopped building because I didn't have an Android NDK on the system I discovered that a rogue install of Qt was lurking in /lib64. The theory is that it was compiling against one version and trying to dynamically link with the other causing undefined behavior.
After scrubbing all traces of that Qt version from Creator's kits everything works like a charm. It seems to be a known problem that Qt Creator's auto detect feature is just a shade less than reliable. I have now added a new troubleshooting step to my toolkit.
So, turns out that Qt Creator was acting up. When the program mysteriously stopped building because I didn't have an Android NDK on the system I discovered that a rogue install of Qt was lurking in /lib64. The theory is that it was compiling against one version and trying to dynamically link with the other causing undefined behavior.
After scrubbing all traces of that Qt version from Creator's kits everything works like a charm. It seems to be a known problem that Qt Creator's auto detect feature is just a shade less than reliable. I have now added a new troubleshooting step to my toolkit.