Posts

Showing posts with the label user-interface

C++ QThread and connect causing crashes

C++ QThread and connect causing crashes My QThread counter crashes giving odd results for what the number should be as the Thread counts properly but in the SetLabel function I get a different number to whats in the QThread ands it then crashes after 3 seconds and the label doesnt seem to update. QThread* CountThread = new QThread; Counter* Count = new Counter(); Count->moveToThread(CountThread); connect(CountThread, SIGNAL(started()), Count, SLOT(Process())); connect(Count, &Counter::SecondsUpdate, this, [=]{ SetLabel(Count->Seconds) ;}); connect(Count, SIGNAL(finished()), CountThread, SLOT(quit())); CountThread->start(); void Counter::Process() { int secs = 0; while (secs < 1000) { qDebug() << "hello" << secs; secs += 1; Sleep(1000); emit SecondsUpdate(); } emit finished(); } void BaseWindow::SetLabel(int Seconds) { qDebug() << Seconds; this->Test->setText(QString("Seconds: " + QString::number(Seconds))); } c...

Progress bars for tasks that can take an indeterminate ammount of time? [closed]

Image
Progress bars for tasks that can take an indeterminate ammount of time? [closed] Another random question that hit me (I've drank ~9 cups of coffee in the last 5 hours, so sorry...) -- What kind of progress bar would you show a user for a taks that you do don't know how long it would take, but you have a good idea of an "average" time. For example, a task that would usually take around 30 seconds, but you have no way of knowing the progress (other than if its still going on or just failed). What would be the best UX?: Would the answer differ if the average time was 10 minutes instead of 30 seconds? Thanks, Robert EDIT: Just to be clear, the question is about progress bars where you have NO idea/indication of how long it will take (for example, executing a task on a remote machine). If you do have some indication of progress, it's often good to use that. Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Av...

UTF-8 & IsAlpha() in PHP

UTF-8 & IsAlpha() in PHP I'm working on a application which supports several languages and has a functionality in place which tries to use the language requested by the browser and also allows manual override of this function. This part works fine and picks the correct templates, labels, etc. User have to enter sometimes text on their own and that's where I run into issues because the application has to accept even "complicated" languages like Chinese and Russian. So far I've taken care of the things mentioned in other posting, i.e.: mb_internal_encoding( 'UTF-8' ) meta http-equiv=Content-Type content=text/html;charset=UTF-8 mb_detect_encoding() == UTF-8 setLocale(LC_CTYPE, "UTF-8") setLocale(LC_CTYPE,"zh__CN.utf8") ctype_alpha() It seems that even explicit language selection doesn't make ctype_alpha() useful. ctype_alpha() Hence the question is: how should I check for alphabetic characters in all languages? The only idea I had...

android design editor doesn't work with backwards compatibility enabled

android design editor doesn't work with backwards compatibility enabled So I created a project and when I added buttons and stuff to my activity_main.xml they didn't show. When I ran the app they where there but the design editor showed just a white screen with the black bar on the bottom. activity_main.xml So I tried some stuff and found out it works fine if I disable backward compatibility. Is this a bug or how can I fix this? I don't post any code because it doesn't even work with the templates you can choose when creating the project. Thanks for answers! By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Getting error : org.openqa.selenium.WebDriverException: unknown error: keys should be a string

Getting error : org.openqa.selenium.WebDriverException: unknown error: keys should be a string I am getting the error to access the data from the properties file in my selenium UI : How can this be solved ? org.openqa.selenium.WebDriverException: unknown error: keys should be a string. I have the following framework. I made it for my self for ease, looks like complicating myself. If any good ideas to better it, please suggest. Appreciate all suggestions. Framework contains the following : 1. config properties file 2. utilities class 3. Page elements definition class file 4. reusable functions class file 5. test classes config.properties file has the following content : config.properties url=http://some.com Email=someuser Password=somepassword Utilities class ( BrowserCalls ) the following code : BrowserCalls import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import ja...

Decreasing a static image progress bar horizontally in SDL

Decreasing a static image progress bar horizontally in SDL In my project, I have a decreasing timer progress bar PNG image on display. This image and its background can be found at the below link: https://s3.eksiup.com/df7dd38f781.png My goal is to make the bar decrease starting from the upper green side to the lower red side. My code for this is the following: void EntityTimer::OnRender(SDL_Renderer *ren) { SDL_Rect currRect,dstRect; double rem=0.0; memcpy(&currRect,&origRect,sizeof (SDL_Rect)); memcpy(&dstRect,&origRect,sizeof (SDL_Rect)); if (timerObjPtr->remainingDuration>timerObjPtr->durationInMilisec) timerObjPtr->durationInMilisec=timerObjPtr->remainingDuration; rem=((double)timerObjPtr->remainingDuration/timerObjPtr->durationInMilisec); currRect.h=(origRect.h)*rem; currRect.h = currRect.h; dstRect.x=0; dstRect.y=0; dstRect.h=currRect.h...