My program doesn't show up in my enterprise device while in pc does
-
Hi,
Does LoadXMLInfo work on a local file ?
-
Hi @SGaist ! Yes, but the XML is ok and well loaded I imagine because the program reads it and load it into the combobox
-
What I meant is that if you are using a local file from your hard drive then it's normal that it won't load when running on a different device. If you don't change that file often, then use Qt's resource system to embedded the file in your application.
-
@SGaist oh sorry, I know what you mean, that's why I say it loads correctly in both sites... The XML is in both and yes, it will be changed every now and then so it has to be this way but... as I said, it is well loaded.... so I discard that as a problem :S
-
Ok, I misunderstood your original problem.
In such a strange case (meaning when nothing is obvious), one thing to do is to "disable everything". By that I mean start with only your main function showing a QWidget in place of your custom widget. I know it sounds basic but it confirms that Qt's working. The next step is to re-enable one by one your custom widgets until things break again.
-
Np :) Well its something similar to what I did... I commented everything until it stopped working so found the problem in that constructor.... comented everything ans was descomenting until found that and that's all.. If I switch lines, it crashes O.o
-
What did you have to switch ?
-
@SGaist
Hello, look up posts #2 and #4. He had switched:connect(my_combobox, SIGNAL(currentIndexChanged(int)), this, SLOT(SetSomeLabels(int))); LoadXMLInfo();
to make it work, although I see no logical reason not to work in the original order.
-
I also don't see any reason either.
However, one thing I usually do is to setup widgets and connection and then trigger data/settings loading once everything is done or even right after the event loop as started using e.g. a QTimer with a 0 timeout.
-
@SGaist
To be honest I've never found any use for single shot timers with 0 timeout. Although, this depends on a personal preference I have always usedQMetaObject::invokeMethod
withQt::QueuedConnection
for such purposes. :) -
QTimer is higher level and a bit clearer for people not going in the lower levels of Qt. But in the end, yes both have the same effects.
Also, invokeMethod doesn't have any overload for lambdas
-
Yup, good point.
For lambdas ? Two main things comes to mind for Qt: real private slots and processing of QNetworkReply :)
-
For lambdas ? Two main things comes to mind for Qt: real private slots and processing of QNetworkReply :)
Q_PRIVATE_SLOT works wonders for me, although I could appreciate one wanting to use lambdas for it.
QNetworkReply
I've never used, only raw TCP/UDP connections ... I guess, I'm pretty old school ... :) -
@kshegunov said:
Q_PRIVATE_SLOT
AFAIK, works only if you also use the PIMPL idiom, which is not the most common case.
QNetworkAccessManager is a good tool when you want to write a layer to access a REST service. You use what best fits your needs :)
-
wow! I've learned a lot with this little conversation, thank you so much! (Even if i don't understand everything but I'll take a look on it calmly later :D)
@kshegunov I'm not "he" , I'm "she" ;) but don't worry haha
I think I'll close this topic as I see that what happened is not normal but is difficult to know why happened so, don't worry about that :) (and of course because I have to move on and finish what I'm doing )
Thank you @SGaist and @kshegunov ^^
-
I'm not "he" , I'm "she" ;) but don't worry haha
I'm sorry, unfortunately there's almost no way to deduce that in English, so please allow amicably for such misunderstandings ... :)
Kind regards.
-
@kshegunov I know I know ^^and normally I don't pay much attention to this but.. this time wanted to point it out... dunno why hahahaso as I said np and code happily!! :D