QtCreator error: No GL capable X visuals available Fedora 16 Linux

So you are trying to run the example applications in Qt Creator to see if you have installed correctly and you get:

No GL capable X visuals available.

Well, if you are running Fedora 16 with an nVidia graphics card then this link might just help you fix that problem.  The methods described here have only been tested on a Fedora 16 system running Qt Creator 2.5 installed on Qt SDK 1.2.1 and with an nVidia GeForce GT 240 graphics card.  So try at your own risk, because changing your graphics drivers obviously could cause major problems (i.e. you won't be able to see anything!!)


Many thanks to if-not-true-then-false!

Uh oh!  So you did that and it STILL gives you the error.  Well then try this guy's advice.  It worked for me.


Just look on the left panel of Qt Creator.  Just below the "Debug" bug icon, there is a sideways folder thing called Projects.  Click on it.  At the top you will see a funny looking widget that looks like this:

Make sure you have "Run" clicked.  (I know, right?  Why do they make it like solving some kind of hieroglyphic puzzle in an Indiana Jones movie?  I mean who is looking for a thing that looks like that for switching pages?)  Anyway...

After you make sure you are looking at the Run Settings page.  Scan down and find "Run Environment".  Look over to the right and click on "Details", if it isn't open already, and then scan the list until you find:
Click on it and then click on the "Unset" button on the right.

That should do it.  Now go back to the "Welcome" screen of Qt Creator 2.5 and select "Examples" and run one of them.  Works for me.

No warranties or promises here.  Good luck.


UPDATE:  While this did work for the 2dpainting example, I ran into a new problem.  When I tried to open an existing project (of mine) and run it.  I actually copied this project over from another work station.  I copied the entire project folder and placed it in my working directory.

The first problem was that I got this error:
Failed to start program. Path or permissions wrong?

I fixed this by selecting Build>Rebuild project...
Now it tried to run, but then it went back to the error:
QGLTempContext: No GL capable X visuals available.

So I picked up my computer and threw it out the window and...  No wait that was just a daydream.
I went BACK into the Projects>Run Settings (as described above) and found that the LD_LIBRARY_PATH was set again.  I unset it and now it works.  My project was "Set as Active Project" when I did this.  To set any project as "active" just right click on it and click the first selection.  Does this mean that I will have to do this for every project?  Not sure yet.  We shall see......

Install QtCreator 2.5 Linux Fedora from the binary (.bin) download

What I am describing here is kind of noob stuff, but then that's what I do :  kick ass for the noobs every day.

You will need to have already installed the Software Development Kit before you do this.  Currently, on May 29, 2012, the latest version of the Qt SDK is 1.2.1.  You can get the installer here.  For my installation I used the Linux 64 bit Offline Installer.  This will also install QtCreator 2.3.1 as part of the whole package.  Now, since they haven't (yet) released an SDK that includes QtCreator 2.5, you can just grab the binary here and install it yourself.

Download it, it should be about 98mb so it will depend on your connection speed how long it takes.
Open the folder where you downloaded it.
Right click on it.  It should look like this:  qt-creator-linux-x86_64-opensource-2.5.0.bin
Select properties.
Select the permissions tab.
Check the box for "Allow executing file as program."

Now I would just say, "Now double-click on it", but that didn't work for me.  It gave me some error:

Could not display "/home/ultrajones/Downloads/q...x-x86_64-opensource-2.5.0.bin"

The file is of an unknown type

No it isn't.
So open a terminal and CD to the directory where you downloaded it.  Most likely this is the Downloads folder in your Home directory.  When you open a terminal you will already be in the Home directory, so just type:

cd Downloads

And you will be there.


You will see a list of all the files and folders in that directory.
Somewhere on the list you should see:


Here's a nice trick.  Now type:


and hit the tab key.  The terminal should fill out the rest of the name for you, since it is the only thing in the folder with a name starting with "qt-".  Oooh magic.  By the way, the dot ( . ) stands for current directory and the slash ( / ) just tells the terminal to execute the following file.  Now just hit enter and the installer should fire up.  

If it didn't, don't blame me.  I do this for free!  



YouTube is blue!

All my other visual media are fine, but YouTube is blue!

Or I should say, it WAS blue.  I figured out how to fix it.  At least temporarily.  Thanks to this link:

Another thumbs down for Flash.


Create a file listing all files in directory Linux

This is really simple stuff, but, since I never had a formal Linux class, I never knew!

To create a .txt file listing all the files in a directory simply enter:

ls > anyfilenameyouwant.txt

I wanted to create a text file that listed all of the MP3's in my Home/Music directory.  Good thing I was using Linux, because this incredibly simple task is impossible without installing software in Windows.  It is really quite powerful for getting things done!

All I had to do was.  Open a terminal.  CD to the Music directory and enter:

ls *.mp3 > mp3list.txt

mp3list.txt is just a name I made up on the spot.  The file did not yet exist, but it does now!

Another neat little trick I learned is to create an alphabetized version of a file.  This should only be done with simple files like .txt or .dat.  You see I had been compiling a list of songs that I wanted to add to a compilation I am going to burn for someone, and they were not in any sort of order.  I wanted the list to be alphabetical for readability purposes.

cat my_mix.txt |sort -d my_mix_AZ.txt

That's it!  It creates the my_mix_AZ.txt file on the fly.  Just be very careful with this.  If you designate the second file the same as the first it will erase everything.  I found out the hard way.  Luckily I had another copy laying around in my messy folders.

Now I can take the two files and diff them using Meld, or just eyeball them side by side to find differences so much easier now that I have alphabetical versions.


Fedora 16 Enable Keeping Files and Folders on Desktop

So you installed Fedora 16 (with Gnome 3) and now you are all like "Yo?  Why can't I put folders and files on my desktop?  What is a desktop FOR if I can't put stuff on it!?!!"  Actually that was ME.

So just open a terminal and enter this:

sudo yum install gnome-tweak-tool

Then type this:


There you go.  Try the options and your desktop will be useful again.  ALSO, if you have installed Fedora 16 on a laptop you can change the laptop lid close actions options, like whether it goes to sleep or just turns off or does nothing (which is nice if you are hooking it up to a monitor and using it as a workstation.)



Flash plugin not showing up in Chrome Fedora Linux

I worded that title to try and make it easy to find this post.  This is the second time I had to deal with this and so I thought I'd better record a post, since I couldn't remember how I did it the first time, it had been so long.

I remember now!

Problem:  If you go to a site that uses Flash, like Pandora, you get a message telling you to install the latest version of Flash plugin.  Flash plugin is nowhere, even after installing through YUM or apt (ubuntu software center).

Google, meanwhile, will tell you that Flash is already installed in Chrome, because the latest versions, for a few years now, are bundled with Flash.  But it sure isn't working.  So what gives?

Even when you type "about:plugins" in the address bar in Chrome there is absolutely no listing for Flash.  It SHOULD say Shockwave Flash, but it just isn't there.  Manually installing it and all of the other advice you find on most forums will be completely useless.

Never fear - THIS site has the solution.  In a nutshell, you will need to install the latest Flash in Firefox, before it will start working in Chrome.  Messed up huh?  There are also some other command line things they give you over there and I just did them all just to make sure, but I think some are unnecessary once you get the Firefox plugin installed.

How my hours of Googling did not lead me straight to this Fedora Project page, I have no idea.



Good QML QtQuick C++ Tutorial (finally)

I searched long and hard for something like this, so I thought I'd pass it along to those who are Googling for the same thing.  There are tons of tutorials and samples and examples out there that use the Qt API with C++, but I found it quite difficult to find any complete and comprehensive tutorials and/or code that includes the method that integrates QML as the User Interface and C++ for the application logic.  Here's what I was looking for:


or here


Thanks to Kaitsu and QUIt Coding for the good work and generosity.

Some notes on installation:

I had to install mesa-libGLU-devel in my Fedora 16 system in order to get the game to run.

I had another problem getting the game to run.  Although the project would build, when I tried to run it I would get an error saying "No such file or directory" referring to the "content" folder where all of the QML is kept.  The build was not copying this folder into the shadow build copy that it was then attempting to run from.

So I sent an email to QUItcoding.com.  Kaitsu answered me back very quickly and let me know that I only needed to disable "shadow build" under the build settings in the "projects" view ( found on the left side of QtCreator).  That fixed the issue immediately.

I should also mention that I replaced the line:
import Qt 4.7

at the top of all the .qml files with:
import QtQuick 1.0

I don't think this really mattered since the newer versions retain previous version functionality, but I thought I'd mention it anyway.