Tuesday, July 9, 2013

Using kdewidgets.so and QtCreator together Qt 5?

EDIT: Just a quick FYI: In the following steps I will tell you what you need to know to use the KDE SDK Widgets that count for more than half of qtcreator's toolbox. It isn't just a gripe blog -- You will leave this post happy that you can finally get the compiler to compile the qt application with KDE widgets in it (the Kledindicator, kcolorvalueselector, etc, etc) and I won't forget the -lkdeui :) !! So read on..


You'd think there would be a more straight forward answer about this, but there just isn't. After running around like a chicken with it's head cut off for a week or so trying to figure out why the kde widgets weren't showing up in Qtcreator anymore since the upgrade to the supposed 5.0.2 framework i have discovered a few things:

- Nobody knows what the fuck they are doing, in other words, everyone is so god damned enveloped in updating their libraries and pressing on into QML which apparently everyone in the KDE world (and ubuntu too??) are now going to be using instead of the classic method.  This wouldn't be a problem but what about those of us out of the loop, you update the software, and don't give outside developers much info on what to do (unless of course, you want to do everything the "hard" way --- text developing, you know).  Sure sure, I'm a whiner, I'm lazy, but damnit don't make the tools if you don't plan on making something to use them with.

- Qt 5 pretty much takes it's massive arm, and "slides" it across the table full of all your Qt4 stuff and do you know what is at the end of the thanksgiving table?? Thats right, a BIG BLACK GARBAGE BAG! That's right folks, out with the old... literally. I'll prove it... if you are using a bunch of Qt4 stuff, and ask to install the new qtcreator package, it asks you to remove one package, THE MAIN qt4 package, which of course gets rid of most everything you use right now. So, I did the opposite.

- This mad push to the future leaves the little guy in the dust and bleeding with no concearn which is funny because that is the trend in Linux, people are so obsessed with "design freedom" and "nonstandardization" that they are creating their own demise and making Windows look good when they want the opposite. Get a clue, standardization and design rules are the only thing that will make Linux ever true a Windows Competitor. Case in point, back a few years, "He said init.d, She said upstart!" see? fighting... just what Microsoft wants us to do.

Now to the coupe de grace; how do you get your Qt creator back to letting you happily make Applications and have a HUGE amount of those nice Qt4 (and even Qt3) widgets at your fingertips because I'm too lazy to make my own, wait, NIH, doh!??? How?? Well, I'll share this because nobody helped me:

first, you probably take note of any packages that you remove during this process so If you want to UNDO it, you will know how.  Also I assume you aren't developing with Qt5, obviously if you do you do not need this anyways. In a year or so (Dec 2013 or perhaps Mar 2014) this tutorial won't be useful to anyone because hopefully people will have facilitated Qt5 enough by then (crosses fingers)

Now, follow the instructions:

1 - get to a terminal with root privelidges, if you dont know what that is, then you shouldnt be attempting this, and then type

apt-get install qt4.*
(if it goes well, there'll only be 1 package to remove, thats the newer qt5 devel files you do not want)

2 - now don't fire up qtcreator just yet, you now need an older version of it to get this to work, because those qt4 plug-ins don't work in the new qtcreator (2.7.xx), i recommend version 2.5.2, and it isn't all that different from 2.7.1 to the casual observer anyway. You can get those old versions HERE: http://download.qt-project.org/archive/qtcreator/2.5/

3 - chmod the file you downloaded (probably qt-creator-linux-x86_64-opensource-2.5.2.bin or simmilar) so the permissions let you execute it
   chmod 755 qt-creator-linux-x86_64-opensource-2.5.2.bin
and run it

4 - once installed, go to the place where you installed it, do a search to find your kdewidgets.so file and copy it to your /installdir/bin/designer/plugins folder, along with any other widgets that dont work in the new Qtcreator, then start the old qtcreator:
cd /myinstalldir/bin
and create a project to test it, go to the form, and check the widgets on the side, WOW!!! they are there!!! woohoo!

Now you can be happy again, I hope this helps you as much as it didn't help me because I had to find it out on my own without ANY help :(   saving you the trouble because I just couldn't bear the thought of someone else going through the same thing even though I usually would like to make someone suffer

.........pshew........(nap time)