Category: c++

Posted by Kieren Searle on the 01/19/10

Resizing a QGraphicsPixmapItem

I've just finished fighting with some code where I wanted to resize some QGraphicsPixmapItems. I was able to scale them but this didn't allow me to resize to specific pixels. I decided to take a step back and noticed that if I create a pixmap object firs… more »

When converting a tm structure to a string using the asctime function in c++ you are left with a cstring ending with a newline character (\n). This is often a pain if you want to insert the date into another string to use later. Since we are using a… more »

I have been fighting with Qt over the weekend to get a QWidget containing some buttons to scroll when there was overflow. I couldn't get a scrollbar to display for some time when my project consisted of a QMainWindow containing a QWidget that was subsequ… more »

This week I started to create my first Qt application. One of the first problems I came across was that once I had created a class that inherited QWidget for it's display I wanted to place it into a KMainWindow display that I had already created earlier.… more »

Posted by Kieren Searle on the 04/21/09

Compare two dates in C++

When comparing two dates that are of the data type string they will need to be first converted to dates. Once this is done a simple comparison test is possible. void compareDates(string date1, string date2) { //create a time_t object time_t rawt… more »

1 2 >>

My name is Kieren and this is my blog. I use it mostly to document any solutions to problems I come across in computing.

Search

XML Feeds