Skip to content

Posts tagged ‘Qt’

24
May

Nokia Qt SDK, пишем первое приложение и запускаем его в эмуляторе и на устройстве

Как обычно, архивирую совю публикацию на хабре.

Доброго времени суток уважаемый читатель. Продолжаю писать о платформе Maemo (пока еще для Maemo Fremantle). Эта статья посвящена новости в мире Nokia – выход Nokia Qt SDK. Пока еще это TP (Technical Preview, долго силил перевод на русский, не получилось, так что пуст будет “TP” далее по тексту). Но писать на этом уже можно, но есть несколько оговорок. Подробности далее по порядку. Еще я расскажу подробней о MADDE, так как именно эта часть в Nokia Qt SDK отвечает за разработку для Maemo.

image

Как результат мы напишем приложение (очень громко сказано :-) , вообще так, приложенице ), соберем и запустим его на эмуляторе и на устройстве ( точнее на Nokia N900 ). Да и вообще разберемся что чем и как писать для устройств Nokia сейчас и в будущем.

Read moreRead more


Unique visitors to post: 368

13
Mar

Быстрая установка Fremantle SDK (Maemo 5). Установка Qt 4.6. Запуск и отладка в эмуляторе и на устройстве

Продолжаю цикл статей по программированию для Maemo.

Некоторым показалось, что начать программировать для Maemo тяжело. Именно поэтому я решил начать с демонстрации легкого пути “Easy way” (c), чтоб показать как легко начать. Далее, учитывая выход официального релиза t 4.6.2 для maemo 5, я покажу как поставить этот релиз на Fremantle SDK. Продемонстрирую отладку в эмуляторе. И самое главное, как отлаживать приложение на устройстве используя обычное сетевое подключение и подключение по USB.

Результатом нашего труда будет вот такое вот окошечко на устройстве:

image

Примечание: в качестве IDE используется Scratchbox, так как речь идет о Fremantle SDK. QtQreator можно использовать, но как таковой поддержки Fremantle в нем нет и не будет. Почему ? Да потому-что в нем делают поддержку нового, кросс-платформенного SDK – MADDE, о котором я уже упоминал (и упомяну еще в заключении).

Read moreRead more


Unique visitors to post: 135

12
Jan

Qt-creators’s shortcut reference card.

In previous post I wrote how to create plugins for Qt-creator. In this mini post I’d like to share one more helpful information about Qt-creator.
Good guys form KDAB created and shared Qt Creator reference card. This nice reference card helps you to easily adapt to new IDE.

Links for download:
Qt Creator Reference Card – A4
Qt Creator Reference Card – US Letter
Qt Creator Reference Card Mac – A4
Qt Creator Reference Card Mac – US Letter

qtcreator reference card

qtcreator reference card


You can click to picture to view how it’s looks.

I wish you a fan development with Qt-creator.


Unique visitors to post: 16

12
Jan

Qt-creator, шпаргалка по комбинациям клавиш.

В предыдущем посте я отписался о том как создавать свои плагины для Qt-creator. В этом мини посте хочу продолжить тему и поделится находкой.
Хорошие ребята из KDAB создали и выложили Qt Creator reference card. Шпаргалка по IDE, которая поможет очень быстро адаптироваться к новой среде.

Ссылки для скачивания:
Qt Creator Reference Card – A4
Qt Creator Reference Card – US Letter
Qt Creator Reference Card Mac – A4
Qt Creator Reference Card Mac – US Letter

qtcreator reference card

qtcreator reference card


Кликнув по картинке слева можно посмотреть как это выглядит на примере “Qt Creator Reference Card – A4″.

Всем приятной работы в Qt-creator’e.


Unique visitors to post: 18

12
Jan

How-to write your own plugin for Qt-Creator.

Qt-creator is rather new and extremely dynamic growing project. The main benefits: cross-platform, suitable, fast and scalable.

It’s a link to official page of project.
Small video preview:
YouTube Preview Image
Qt-creator’s whitepaper.
Here you can download latest snapshots.
Manual about writing plugins inside (traffic warning, 2.5Mb will be loaded).
Read moreRead more


Unique visitors to post: 41

30
Dec

I added new feature to Qt-creator.

Hello. I started qt-creator hacking two days ago. It took one evening to understand internal basics and one evening to decide hw to realise this feature. And so one hour to implement it.

You can see results in my “merge request” on gitorious .

I recorded small video to show this feature.
YouTube Preview Image

I changed FolderNode class, now it has property FileType contentType(). This property represent content type of folder. And added excludeFolderType property to FlatMode. This property exclude Folder with children with appropriate type from model.

Why I did it:
1. I’d like to understand internals of Qt-creator.
2. Got some experiences and skill.
3. Help to make Qt-creator better.

Also I planing to add version control system status to project tree and Tree view of File system view plane.
Hope to see this feature in master branch in near future.

P.S.: It was my first experience with gitorious.


Unique visitors to post: 10

27
Nov

Private slot implementation in pimpl pattern by Qt-way.

Introduction.

Some time before I wrote about pimp pattern by Qt-way. In that post I was trying to show you the good way of using pimpl pattern, and use it at all. Especially when you implement your own library. Binary compatibility is good idea and d-pointers help to make it easily. Now I’ll try to extend you knowledges about this pattern, and show you new useful tool for making d-pointers better and more flexible. The next post is finally will close the pimpl topic: it will be about shared d-pointers and implicit sharing. But this topic is about private slots, the mechanism, that common used by Qt classes.

What is it? And why to use it?

Private slot is extension of d-pointers. Private slots give you way to realize slots in private class, even if private class is not QObject ( it’s not QObject almast in all classes ). But public class have to be QObject. Really the slot is not Private’s class slot, it is part of public class.
Why we need slot in private class? Let’s look at some example. There is exists QAbstractScrollArea class.It’s simply displays it’s view
port widget, and move it, if it has large geometry. QAbstractScrollAreaPrivate has two QScrollBars to make opportunity to user move viewport’s widget. Ok, and what to do when user changed scrollbar’s value ? In common way we need to connect appropriate signal of scrollbar to slot of our class, that implement necessary behaviour (scroll in our case). But this slots will became available outside our class in this case. It’s not good idea to show private implementation outside. The other possible solution is to make private class derived from QObject. Don’t do this (you have very heavy reasons to do it, and private slots is not one of them)!!!
Don’t worry, Trolls made a grade solution – private slots! This is very simple and flexible way to resolve this issue.

Read moreRead more


Unique visitors to post: 132

26
Nov

Приватные слоты в паттерне Pimpl от Qt.

Вступление.

Недавно я писал по поводу реализации паттерна Pimpl в библиотеке Qt и призывал людей следовать такому подходу при разработке их собственных бибиотек. Теперь я хочу поговорить о таком понятии, как приватные слоты и тем самым продолжить эту тему. Заключительной статьей на эту тему будет реализация механизма Implicit Sharing и shared d-pointer.

Что это и зачем это нужно.

Приватные слоты – это механизм дополняющий функционал d-указателей. Он позволяет реализовать слоты для приватного класса, даже если он не является наследником от QObject (обычно он им и не является), но для этого публичный класс должен быть наследником от QObject. Тоесть по факту создается некий приватный слот в публичном классе и он непосредственно дергает нужный метод приватного класса.
Зачем это нужно? Ну рассмотрим на примере. Есть класс QAbstractScrollArea. Он просто отображает некий виджет (viewport) и обеспечивает прокрутку. Прокрутка обеспечивается с помощью двух экземпляров класса QScrollBar. Сами эти скролбары он хранит в приватном классе. Теперь проблемма: как подключить сигнал от скроллбара об изменение его позиции с классом QAbstractScrollAreaPrivate, ведь он не является QObject’ом ? Сделать его наследником от QObject – лучше не делайте это :-) . Можно сделать слот в публичном классе и повесить на него, то в таком случае это не очень красиво – так как наружу выходят слоты от внутренней реализации. Вот ту Qt-шниками был придуман достаточно разумный и элегантный подход – приватные слоты.

Read moreRead more


Unique visitors to post: 58

21
Nov

Pimpl’s, d-pointer’s, cheshire cat’s source code example.

This post is part of this post
.pro file:

TEMPLATE = lib
HEADERS += myclass.h \
    myclass_p.h \
    myclassderived.h \
    myclassderived_p.h
SOURCES += myclass.cpp \
    myclassderived.cpp

Read moreRead more


Unique visitors to post: 37

21
Nov

Pimpl. D-pointer. Or Cheshire cat by Qt.

Introduction.

Qt Logo

Qt Logo


You can find Pimpl declaration in Qt documentation, while serfing in Assistent or qt doc site. Also those, Who looked inside in source code of Qt libraries, can found some strange macros: Q_DECLARE_PRIVATE, Q_D, and strange header files with names, ended with “_p.h”. Do you want to know something about this Qt’s Magic ?
In this post I am going to light this magic, and show you that it’s raser simple and useful (And why Qt hide this from us? :-) ).
Also this post may be useful for hacking or reversing Qt source code. This information helps you better understand of structure and relaying of Qt classes.
Русская версия
Read moreRead more


Unique visitors to post: 258