Showing posts with label Qt. Show all posts
Showing posts with label Qt. Show all posts

Back in Business

The score editor project has come off the back burner and is now up front. I still have work to do with regards to my thesis but I expect I'll have that done before mid-summer. Right now the focus is on the following:
  • Completing the port from Java. This task is mostly done, and we just need to implement
    • MIDI playback, and
    • loading/saving of project files.
  • Rendering of both scores and tablature.
  • Create a website (partially done).
  • Fix some bugs and glitchy behaviour.'
So not much really. I'm really hoping to get the first public beta out before 2012, so here's hoping! For anyone interested, here are some of the technologies I'm currently using, all of which I enjoy:
  • Qt SDK
    • Qt Libraries
    • Qt Creator (highly recommended for C++ dev)
  • Boost C++ Libraries
    • Mostly for Boost Signals, which I prefer over the Qt signals/slots system due to it being far more flexible
  • Redmine
    • For internal project management (currently)
  • Django + virtualenv
    • For website dev (I edit everything with vim)
  • Inkscape
    • For vector graphics, which we use to produce the paths for various shapes (e.g., clefs and rests)
  • Git
    • For version control, which I highly recommend. Who knew branch-based development could be so easy? I also love being able to commit locally, and manually tweaking my commits.

Elided Labels in Qt

So for one of my projects I was dissatisfied with the fact that a QLabel whose horizontal size policy is Qt::Ignored will have its text clipped instead of having an ellipsis at the end (or somewhere in there). I whipped together a simple extension to QLabel that puts an ellipsis at the end based on the current size of the label. It's not complete in general (e.g., doesn't really support multiple lines), but for me it gets the job done. Feel free to use this code for whatever purpose you please (i.e., it's in the public domain).

elidedlabel.hpp
elidedlabel.cpp

Expressing Qt Love

The more I use Qt, the more I love it. Whenever I talk to people I'm always expressing my joy about how simple it is to do things with Qt. Whenever I do something new, no matter how small, I'm excitedly telling and showing friends what I've done. For example, recently I had the requirement that I wanted to be able to save images displayed by QGraphicsPixmapItem to a file. In a matter of a couple of minutes I extended QObject and QGraphicsPixmapItem, wrote an override for the contextMenuEvent to display a "Save Image" menu, and a simple slot to show a "Save File" dialog. Now all the images I'm showing on my QGraphicsView can be optionally saved to a file at the user's request.

A really simple thing, but that's because it was done in Qt! If it weren't for the existence of Qt I would probably still be using Java and Swing.

A New Look

Well, the score editor project my friend and I have been working on has taken a bit of a regression. In particular, we decided to switch to Qt and C++ because Swing just wasn't doing it for us. It just lacked in a native feel, particularly on the Mac.

So there's nothing much new here, but by using QGraphicsView we have been able to really do some neat stuff. In particular, printing was a breeze but also exporting PDFs and supporting zoom. We also decided to display the score in pages instead of one long, unified page. I think it gives it a more professional feel, and also shows you exactly how it will look when printed. Anyways, a screen shot showing the zooming out, and also a new splash screen that yours truly put together. Not too shabby, but it still needs a bit more pizazz.