LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Blogs > rainbowsally
User Name
Password

Notices

Rate this Entry

Enabling qt examples in openSUSE & new mc2 version uploaded.

Posted 04-27-2012 at 05:05 PM by rainbowsally
Updated 09-04-2013 at 10:14 PM by rainbowsally

Enabling qt examples in openSUSE and new mc2 version uploaded.

PART 1.

The issue: The examples in openSUSE 11.4 expect their resources to be in
Code:
/usr/lib/qt4/examples
which did not exist on my system.

I can no longer verify this as an 11.4 issue easily but it appears that in openSUSE we may need a symlink under /usr/lib/qt4 pointing to /usr/share/qt4/examples in order for the qt examples to run.

Code:
ls /usr/lib/qt4/examples      # if there's nothing there
ls /usr/share/qt4/examples    # AND if there is something there
# then...
cd /usr/lib/qt4
sudo ln -s /usr/share/qt4/examples .
That folder or (preferably) a symlink to it MUST exist for the examples in the /usr/share/qt4/examples folder to run in openSUSE 11.4.

If that is actually an omission in these distros, tell someone working on openSUSE 12.x about it and tell them The Computer Mad Science Team sent you. ;-)

I think there was something funny in Kubuntu too, but I can't remember the details.

Corrections welcome. As I said, I can no longer easily verify this situation with my modified system.

-------------------------

PART 2.

The issue: interactively generating makefiles, including makefiles for qt4

Since we're getting serious about using QT for a gui, it seems fitting to have some tools specialized for generating QT makefiles.

We can either generate makefiles directly or we can generate qt *.pro files to generate the makefiles, which isn't much of a gain, so let's go straight for the Makefiles. You can use qt creator, of course, but that locks you into their system, even for simple C apps.

We now have a '-create qt4-files' switch that is implemented as a simple addin. It would work with older mc2 installations. Same goes for the
'-run qt4-ui <srcdir>' switch.

Creating your own specialized functions is absolutely possible, as is combining functionality in your own script programs.

qmake syntax is also forgiving about separators, but being its own dialect, has zero resemblance to what it produces (i.e., makefiles). And for mc2, a qt4 makefile is just another makefile.

Nothing particularly special about it.

Here's what our two new plugins do.

mc2 version 2.0.5

Code:
added qt4 mc2.def template to build qt4 apps from any file set.
added 'mc2 -create qt4-files' to generate a basic fileset for new *.ui file.
added 'mc2 -run qt4-ui' function to write ui: tag for moc, uic, and qrc files.
For these plugins to work, no changes were required to the basic functionality of mc2.

We also reordered copy and notice operations in the -fetch <templatename> switch so we don't do anything if the template doesn't exist and we added -i[nit] as an alias for -u[pdate] for purely conceptual reasons.

http://rainbowsally.net/rainbowsally...x-2.0.5.tar.gz

I'll leave the older version up for a bit until I can verify the installer itself. If the newer one doesn't install right, get the older one and add the plugins for now.

Here's the previous version.
http://rainbowsally.net/rainbowsally...x-2.0.4.tar.gz

Notes.

I noticed the bad paths when qmake-d examples didn't work and I converted some of them to mc2 makefiles. After getting a couple of them to work, I discovered the pattern. They all wanted the examples to be in the non-existent folder.

The kde3 version of kdevelop was invaluable in this endeavor. The grepper for finding text in files is outstanding.

I'm not selling anything here. Just offering a different perspective. A simpler, approach can sometimes do what the big muscle-bound tools cannot.

After installation type 'mc2 -fetch qt4' and take a look at the notes in the new mc2.def it writes.

The Computer Mad Science Team.

:-)
Posted in Uncategorized
Views 386 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 03:10 PM.

Main Menu
Advertisement

My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration