Friday, May 30, 2014

Qt custom widget inside a widget

A school project has had me learn Qt. Which I learned the pronunciation is (cute) from a Youtube tutorial. In this program we have a GUI that is sending to and receiving from a business logic(BL) that sends to and receives from a database(DB). The latest challenge is receiving from the BL and populating fields on the GUI. One of the problems I solved. So I have a custom widget that declares another custom widget.


class custom : public QWidget
{
private:
        Participants *claimant;
}

In the constructor of custom:

claimant = new Participants(ui->widget);

This uses the QWidget on the view as the parent so that's where it gets rendered. Then in a function to populate the fields I used this:

claimant->setName(recieved->getClaimant().getName());

The getName function is a function in a class that gets the name field for a person class I made. The setName is in the Paricipants widget that populates a lineEdit.


void Participants::setName(std::string str)
{
         ui->nameLineEditPar->setText(QString::fromStdString(str));

}


 Hope this helps anyone struggling with Qt. Any suggestion on other ways, or improvements would be gladly appreciated.




Friday, May 23, 2014

Space Engineers

Space Engineers from Keen Software House

    This sandbox in space game is "Minecraft" meets "Kerbal Space Program," using building blocks to create the space ship, and space stations of your dreams. This game is very nice even though it's still in beta. Great graphics are just the tip of the ice berg for this game. Real physics that crumple and destroy the blocks when hit. Meteor showers that rain destruction onto your ships and stations. Computer controlled ships that pass through the area for you to loot and salvage. Plus the developers aren't done yet, there will be more to come.

    Building and maintaining the space ships and stations is what this game is all about. With multiplayer support for up to 16 there's the possibility to form teams, and play a team death match, or play completely co-op. There's a creative game type that allows players to build what ever their heart desires with endless resources, and no health damage. Also a newly  added (May, 2014) survival game type that requires players to mine the asteroids for resources, refine them into usable materials, and produce the parts needed to build the ships. I find the mining of resources very relaxing almost zen like, but that me. There is also missile launchers, auto turrets, and other weapons to defend what you've build, or try and take what others have built.

    Some of the down sides of survival mode, which may be changed in the future, are you can't just start or respawn with out a ship. Currently if your character dies you respawn in a starter ship. With out this starter ship you don't have any way of refining the materials to make parts, or means of recharging your space suit. If you're trying to play a scenario where you want to gather the resources yourselves there's the temptation of using the starter ship to get them, or killing yourself to keep getting more and more starter ships. There are also no planets in this sandbox game.

    All in all I really enjoy this game. The graphics, and the survival mode really sold it for me. You might enjoy it as well, check it out with the link at the top.

Wednesday, May 21, 2014

The Start

I'm Tweety79rw, I have a youtube channel where I do let's plays of video games. This is just a test if I feel that I'm going to have time to do blogs. Heck I don't really know what blogs are about or how to write one, but here goes.