Показаны сообщения с ярлыком qt. Показать все сообщения
Показаны сообщения с ярлыком qt. Показать все сообщения

вторник, 15 марта 2011 г.

LDAP + PHP + C++(Qt)

http://pdf.sp-atelier.ru/ldap/

http://api.kde.org/4.5-api/kdepimlibs-apidocs/kldap/html/annotated.html
kldap

http://www.userbooster.de/en/download/openldap-for-windows.aspx

https://laas.mine.nu/uclibc/openldap-2.1.30/libraries/libldap_r/

понедельник, 14 марта 2011 г.

QT Modal Dialog

For using Modal Dialogs in QT u must
1) setWindowModality(Qt::WindowModal);
2) exec();
3) Only exec() instead show()

вторник, 25 января 2011 г.

Qt + Berkley DB

http://qbdb.cvs.sourceforge.net/viewvc/qbdb/qbdb/src/driver.cpp?revision=1.1&view=markup

воскресенье, 23 января 2011 г.

Qt project file

For my Qt project, I use this scheme in *.pro file:

HEADERS += src/dialogs.h
SOURCES
+= src/main.cpp \
src
/dialogs.cpp

Release:DESTDIR = release
Release:OBJECTS_DIR = release/.obj
Release:MOC_DIR = release/.moc
Release:RCC_DIR = release/.rcc
Release:UI_DIR = release/.ui

Debug:DESTDIR = debug
Debug:OBJECTS_DIR = debug/.obj
Debug:MOC_DIR = debug/.moc
Debug:RCC_DIR = debug/.rcc
Debug:UI_DIR = debug/.ui

It`s simple, but nice! :)

MySql Static windows

Все работает но только с майкрософтовским компилером, значит
libmysql.lib - динамическая библиотека
mysqlclient.lib - статическая

просто заменил libmysql.lib на mysqlclient.lib и все работает без зависимостей
Тема исчерпана

Writing ODF Files with Qt

text
sources

суббота, 22 января 2011 г.

Програмно выбрать элемент в QListView

#include QApplication
#include
QListView
#include
QStringListModel

int main( int argc, char **argv )
{
  QApplication app( argc, argv );
  QListView list;
  QStringListModel model;
  QStringList strings;
  strings << "foo" << "bar" << "baz";
  model.setStringList( strings );
  list.setModel( &model );
  QModelIndex index =model.index(1);
  list.selectionModel()->select(index, QItemSelectionModel::Select);
  list.show();
  return app.exec();
}

вторник, 18 января 2011 г.

Qt Mysql Plugin

Для сборки MySql плагина, с версии mingw32 4.0 reimp не нужен.
Вот для себя небольшую инструкцию написал.

Компиляция клиента MySql для студии QtCreator и компилятора Mingw32.

.1 переконфигурирование исходников Qt.

Код:
cd c:\Qt\2010.02.1\qt\
configure.exe -debug-and-release -confirm-license ^
-plugin-sql-sqlite -plugin-sql-mysql -plugin-sql-odbc -qt-libpng -qt-libjpeg -openssl ^
-opensource -no-incredibuild-xge -dont-process -no-qmake

Важный параметр -dont-process который говорит qmake не делать переконфигурирование, а только обновить кеш настоек. Значительно ускоряет этап конфигурирования. Основные настройки при которых была собрана Qt можно увидеть в файле configure.cache.

.2 Сборка плагина QMySQL

Код:
cd c:\Qt\2010.02.1\qt\src\plugins\sqldrivers\mysql
qmake -o Makefile "INCLUDEPATH+=c:/Qt/MySql/include" "LIBS+=c:/Qt/MySql/lib/opt/libmysql.lib" mysql.pro
mingw32-make

.3 Установка
Необходимо скопировать библеотеку libmysql.dll в папку c:\Qt\2010.02.1\qt\bin

SubVersion Repo

link for DocClient

вторник, 11 января 2011 г.

QT TreeView

link

The Interview Framework (QListView)

Sharing a Model Between Views

In this example, we display the contents of a model using two different views, and share the user's selection between them. We will use the QDirModel supplied with Qt because it requires very little configuration, and provides existing data to the views.

The main() function for this example demonstrates all the principles involved in setting up a model and two views. We also share the selection between the two views:

    int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QSplitter *splitter = new QSplitter;

QDirModel *model = new QDirModel;
QTreeView *tree = new QTreeView(splitter);
tree->setModel(model);
tree->setRootIndex(model->index(QDir::currentPath()));

QListView *list = new QListView(splitter);
list->setModel(model);
list->setRootIndex(model->index(QDir::currentPath()));

QItemSelectionModel *selection = new QItemSelectionModel(model);
tree->setSelectionModel(selection);
list->setSelectionModel(selection);

splitter->setWindowTitle("Two views onto the same directory model");
splitter->show();
return app.exec();
}
source

QT independed tutorial (Qt v3)

link

понедельник, 10 января 2011 г.

qt +add dynamic widgets

//pushButton->setObjectName(QString::fromUtf8("pushButton"));
    //pushButton->setGeometry(QRect(310, 20, 75, 23));
    QPushButton *button = new QPushButton(this);
    button->setText("Hello");
    button->setGeometry(QRect(31, 31, 31, 31));
    this->ui->pushButton->setEnabled(false);
    QObject::connect(button, SIGNAL(clicked()), this, SLOT(View_MSG()));
    //button.parent(this->ui->DialogXX);
    button->show();
    return;

среда, 5 января 2011 г.

qt russian text on windows in console application

add to the top of main()

#ifdef Q_WS_WIN
    setlocale( LC_ALL, ".1251" );
#endif

среда, 29 декабря 2010 г.

Botan

Password based crypto
http://botan.randombit.net/examples/row_encryptor.cpp

https://community.emc.com/docs/DOC-4949

QT + Pdf

http://qtcoder.blogspot.com/2010/06/pdf-unicode.html

QT Serialization

source

#include "QtCore"
#include "QHash"
#include "QFile"
#include "QDataStream"
#define PATH "./file.dat"
int main()
{
//create a dictionary
QHashQString,QString> dict;
dict["project.owner"] = "owner";
dict["project.version"] = "0.10.0";
QFile file(PATH);
file.open(QIODevice::WriteOnly);
QDataStream out(&file);   // write the data
out  dict;
file.close();
//setting new a value
dict["project.owner"] = "new";
//update the dictionary
file.open(QIODevice::ReadOnly);
QDataStream in(&file);   // read the data serialized from the file
in >> dict;
qDebug()  "value: "  dict.value("project.owner");
return 0;
}


воскресенье, 26 декабря 2010 г.

Get Username

http://bytes.com/topic/c/answers/646042-get-username-string-windows-c
WIndows & *nix
http://en.wikipedia.org/wiki/Environment_variable
Only *nix
http://linux.die.net/man/7/environ
on Windows
#include
char *user = getenv("USERNAME");
on *nix
#include
char *user = getenv("USER");

пятница, 24 декабря 2010 г.

foxireader.exe --help

четверг, 16 декабря 2010 г.

Nokia QT Help

link

addWidget() !!!