A few things what I setup when I create a new Qt Widget project 

1.Add the folowing to pro file:


OBJECTS_DIR = build
MOC_DIR = build
UI_DIR = build
RCC_DIR=build

DESTDIR = bin

and the binaries won't mess up your sorce code directory

2. Make the following modifications in the main.cpp:


#include <QtGui/QApplication>
#include <QtCore/QTextCodec>
#include "mainwindow.h"

int main(int argc, char *argv[])
{
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8";));
QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8";));

QCoreApplication::setOrganizationName("MM";);
QCoreApplication::setApplicationName("Mikrotik data miner";);
QCoreApplication::setApplicationVersion("0.1";);

QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}


Why?
The QTextCodec trick is neccessary because the sourcecode is UTF-8 encoded, and if I want to put a string from the code to somewhere I would need to use QString::fromUtf8(). If you do not believe check a generated ui_*.h file.

Always give set the name to your application and the application domain. This is useful when you are using QSettings, you do not need to give constructor arguments when creating a settings object. The settings object constructed in this way always use a separate data area specified by the platform. (.config/QCodeApplication::applicationDomain/QCoreApplication:applicationName.ini on Linux and registry on Windows)


[ hozzászólás ] ( 15 megtekintés ) [ 0 trackbackek ] permalink ( 2.9 / 229 )
[Project announce] Linux kernelmodul az NI DAQCard-4050-hez 

Ma sikerrel portoltam az National Instruments 4050 PCMCIA DMM-hez gányolt gyári példaprogramokat egy Linux kernelmodullá.

Kód a szokásos helyen a googlekódon figyel:
http://code.google.com/p/ni4050/

Nem bírhattam ki hogy ne hegesszek hozá valami GUI-t Qt-ban természetesen:




[ hozzászólás ] ( 14 megtekintés ) [ 0 trackbackek ] permalink ( 3 / 197 )
Mjpeg-streamer input plugin for Icamview based IP cameras 

Today I have managed to create an input plugin for the Mjpg streamer which grabs the JPG frames from my Asus Mimic CX200 IP camera trough it's properitary protocoll.

Q: Ok but what is it good for?
A: Originally this camera was purcashed by my father for survillance purposes. But the quality of the supported softwares, made it unusable to it. The client software could only record to AVI which means the PC have to deconvert the JPG frames, and compress them to the video format. With two cameras it was a challange for his old AMD Duron config. I am going to write a survillance output plugin to the mjpg-streamer which will allows to control the input plugins and the output_file plugin configuration in a comfortable way.


I send my greetings to all developers at the Megatec for their bullshit products.

[ 1 hozzászólás ] ( 87 megtekintés ) [ 0 trackbackek ] permalink ( 3 / 381 )
Daily Qt Sapience - Fix broken associate with the .pro files under Win 7 

I have installed a new version of Qt SDK on my Win7. Of course I have kept in my mind the Windows's fragile internal mind, so I have uninstalled my previous Qt and QtCreator installations.
The SDK installed fine, but I cannot set the QtCreator to be the default associated program with the pro files anymore. Rightclick associate with browse the qtcreator.exe, and nothing happends. No error message, nothing. Typical M$ related error. After googling a half an hour I have found the solution:
Read more...
[ hozzászólás ] ( 11 megtekintés ) [ 0 trackbackek ] permalink ( 2.9 / 316 )
Daily Qt sapience - Reading ras files from sequential devices not supported  

I have written a library to get JPG files from a webserver continously. It worked fine with Qt 4.6.3 but with the new Qt 4.7.0 I have get the following error for every frame:


Reading ras files from sequential devices not supported


The workaround is the following:

Turn off the automatic format detection, and set the file format explititly:


imageReader->setAutoDetectImageFormat(false);
imageReader->setFormat("JPG";);


And no more warnings :)
[ hozzászólás ] ( 1 megtekintés ) [ 0 trackbackek ] permalink ( 3.1 / 394 )

<< <Előző | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | Következő> >>

 
számláló