LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Blogs > rainbowsally
User Name
Password

Notices

Rate this Entry

Another Dopey Calculator (qt4)

Posted 06-10-2013 at 03:04 PM by rainbowsally
Updated 06-10-2013 at 04:20 PM by rainbowsally

Another Dopey Calculator

Today's feature
  • Another dopey calculator

First a bit of news re. the lq libs and mc2. (mc2 is the makefile creator developed here at this blog.)

The latest version of mc2 is undergoing testing and with any luck will include a SNAZZY set of graphics routines. The uitool is very nice for quickly writing moc files ui headers, etc. Currently some of the built-ins are a bit clunky, but they are effective and easy to use, such as the msgBox and infoBox things. You'll see.

Here's a preview of the uitool as a stand-alone app (2013-06-10).

http://www.linuxquestions.org/questi...3-06-10-35568/

However...

We're finding it very challenging getting the qwt lib widgets to play in designer. The way the colors are handled makes it easier to use the QT palettes when hand coding, but either messes with the base widget's palette (e.g., dial needles) or uses a private palette that may or may not be based on the user's 'theme' but in either case is set forever at object instantiation.

There are many ways to deal with this problem, and we've tried several with varying degrees of success. Unfortunately, we lost the code for the almost-successes, and so...

It's BREAK time! :-)

Here's a calculator called lq-calc that at least allows keyboard entry of numbers and the +,-,*,/ stuff.

It's not finished and it may never be. It has a slot for 'evaluate' to accept a string from the clipboard, but for that to be useful we also need parentheses, at a minimum, the "=" key needs to become ENTER and probably more scientific functions... and it's just not worth it at this time.

Pasting long complicated evaluations from a clipboard is a very useful function!

Even though it's missing this feature (at this time), it DOES have a Designer UI file, so it's much easier to edit than if it were all just straight C++, in case you are interested in adding anything to it. Or if you just want to break it. ;-)

This self extractor was generated with 'new.sfxz', available here at the blog. The full size of the expanded files is about 75K (74,091 bytes). This is self extractor is 13,862 bytes.

The Makefile was generated with mc2. The file in the src directory called ui_cmds.txt is a dump from the latest uitool. The slots in lqcalc.h were written with the uitool too, as were the implementations in lqcalc.cpp. But this wasn't meant to be an advertisement for the LQ-qt/mc2 d/load (here at the blog), and so with no further adue, here's a calculator that responds to keyboard key presses.

file: lq-calc.sfxz
purpose: utility (executable)
Code:
#!/bin/sh
# base64 self extractor
# file: lq-calc

filename=lq-calc

# don't allow user to click on the file
if ! tty >/dev/null; then
  xmessage -center "
  $(basename $0)
  must be run in a terminal 
  "
  exit
fi

# create and/or clear out tmp dir
mkdir -p $HOME/tmp/sfxz
rm -rf $HOME/tmp/sfxz/*
base64 -d << _BEOF >$HOME/tmp/sfxz/$filename.xz
/Td6WFoAAATm1rRGAgAhARYAAAB0L+Wj4Wf/JQddABcLygevsDubPTGvNf/UW1qMYEwB1U+LNFCy
wZQgD0b9i+wOoigVr/ksLdKh4V0JvVfXH+iUns/Cbj3HJhNpCB2VhA/kwT+fCfxop4ZL+KECPT4U
uh+oGlnDLfX8FSQf5cuiy5v56TOabLZpmMTXsVaGVem6QJrT2xqCbZ+s9S1maldYTPPpGAJU0t84
V4EbS23g+vC3+KLYWj/JjakXDCb/mxKjwGiDxmG1D5sca+1y9blZIAusq+emXL1ijmZU6fx3xmlC
oVt1salrSQMD2fnoN9/3y0699UxElPEqAteFVDfK3aTixmO6bBurlxI0JAKXMi2MKOOLJoR1I1c7
Bnc4MotfM7hBvWHxOJnTKhUM4UqYkW6A+uNQzfPyZdtK3hLb1vrpD2tXUjK9ojXiS907DJ8BhfE1
c2fMGvvLkwYc+OVI2IwnayPGYYZ9c0EPe+EqxHnMXoTAC9Y34M2rYjoirhuaZMQSRz/JVma3FCco
b63HefMrSO2pSFNHbHU5RAQ/jl6iueu6n8VyxRZatvN9jOQZRFZNkw0aA8hVyR1OexPmOV2rQrdA
pr6H3+Ps37ReXAWsFqoAJYL82dcW3r2OkloehaRYBX9RLSF5HBY0rc0/EPf1WRY+PAfgS9qIQLmf
5vOEKNvpGm9anfcdGctj8+4D2NlCeqbg/jzGUZKIruezAHoCmZey7fEIqT/Lz/CPC7xTV7Lvk0sg
RTSNkrTP9r2JFKJuDJ4bcZErN81bDUwVpYCPiAXXQMKDavlJO5pHkVJcFgGqPIyPXg0R8WOnHVeE
5E8IBPBQQ96j7S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GF0gj4m9HXZWy5an/avoYCdD+jxxMdYS0stKbMaepMWmGJlV76leaVAp1G9btTZ8Pr9L
BTXYP6TYLfnaU/PsmQX0pAmRnz3rZYWL8ulUk3Ag+51xgEAb+oYLejxwhETpXgECAACV67QGaSOV
gQABo0qA0AUAO4A5U7HEZ/sCAAAAAARZWg==
_BEOF

(cd $HOME/tmp/sfxz && tar -xaf lq-calc.xz)
rm -f $HOME/tmp/sfxz/lq-calc.xz
 
cat << _BEOF > $HOME/tmp/sfxz/post-extract
#!/bin/sh

is_yes() # returns OK if first char is Y or y
{
  local key=`echo $1 | cut -b1 | sed 's/y/Y/; /Y/!d'`
  [ "$key" == 'Y' ] && return 0 # true
  return 1 # false
}

if [ -e lq-calc ]; then
  printf "
  Overwrite existing file(s)? [N/y]:"
  read key
  if ! is_yes $key ;then
  echo "Aborting.."
    exit 0
  fi
fi

mv $HOME/tmp/sfxz/lq-calc .
_BEOF

sh $HOME/tmp/sfxz/post-extract
rm -rf $HOME/tmp/sfxz/*
rmdir $HOME/tmp/sfxz 2>/dev/null || true
rmdir $HOME/tmp 2>/dev/null || true

- The Computer Mad Science Team

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

Comments

 

  



All times are GMT -5. The time now is 07:50 AM.

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