원문 : http://doc.qt.io/qt-5/qtqml-cppintegration-contextproperties.html


 QML 에서 C++ 코드를 사용할 떄   

QQmlContext class 를 사용한다. 



'Qt' 카테고리의 다른 글

다국어처리  (0) 2015.10.26
QAbstractListModel 클래스  (0) 2015.10.26
Interacting with QML Objects from C++[10_25]  (0) 2015.10.25
Property Value Initialization Semantics[10_23]  (0) 2015.10.23
Exposing Attributes of C++ Types to QML[QT]  (0) 2015.10.23


이는 QML 


QML 객체들과 상호작용하는 C++


- 모든 QML 객체들의 형태는 QObject에서 파생된 형태 이다. 

Once a QML object is created, it can be inspected from C++ in order to read and write to properties, invoke methods and receive signal notifications.


QML 객체가 생성되면 , 신호알림을 읽고 특성에 쓰기, 메소드를 호출하고 수신하기위해 C++에서 검사할 수 있다.


C++에서 QML 객체 불러오기


A QML document can be loaded with QQmlComponent or QQuickView.

QML 문서는 다음을 통해서 불러진다. 

 QQuickView is aQWindow-derived class, the loaded object will also be rendered into a visual display; QQuickView is generally used to integrate a displayable QML object into an application's user interface.


QQmlComponent or QQuickView. 의 차이?


<<좌측은 되지않았고 QQuickView를 이용해 QML파일을 불러왔다.


위는 속성 너비와 높이를 변경하는 소스이다.


You can also connect to any signals or call methods defined in the component usingQMetaObject::invokeMethod() and QObject::connect(). See Invoking QML Methods and Connecting to QML Signals below for further details.



Accessing Loaded QML Objects by Object Name- 아직못함


qml에서의 property 정의 


// MyItem.qml
import QtQuick 2.0

Item {
    property int someNumber: 100
}

다음과 같이 변경할수 있다.

QQmlEngine engine;
QQmlComponent component(&engine, "MyItem.qml");
QObject *object = component.create();

qDebug() << "Property value:" << QQmlProperty::read(object, "someNumber").toInt();
QQmlProperty::write(object, "someNumber", 5000);

위에 것은 안될 것같고 다음을 이용햇다.

qDebug()<<object->property("number").toInt();

    object->setProperty("number",200);
    object->property("number").toInt();

    qDebug()<<object->property("number").toInt();



Invoking QML Methods




버튼 클릭을 통해 속성을 변경해보자.


단어 

derived - (형용사) 파생된 , 유래된 

implement - (타동사) 시행하다  (명사)(옥외활동에 쓰이는 간단한)도구 기구

modified - (형용사) 완화된, 한정된, 수정된

component - (명사) 요소, 부품

invoking : 호출


원문</p> <p>Qt 공식사이트 의  - Interacting with QML Objects from C++

'Qt' 카테고리의 다른 글

QAbstractListModel 클래스  (0) 2015.10.26
Embedding C++ Objects into QML with Context Properties[26]  (0) 2015.10.26
Property Value Initialization Semantics[10_23]  (0) 2015.10.23
Exposing Attributes of C++ Types to QML[QT]  (0) 2015.10.23
git 설치  (0) 2015.06.29

Property Value Initialization Semantics


속성값 초기화 의미



Item {
    property var first:  {}   // nothing = undefined
    property var second: {{}} // empty expression block = undefined
    property var third:  ({}) // empty object
}


'Qt' 카테고리의 다른 글

Embedding C++ Objects into QML with Context Properties[26]  (0) 2015.10.26
Interacting with QML Objects from C++[10_25]  (0) 2015.10.25
Exposing Attributes of C++ Types to QML[QT]  (0) 2015.10.23
git 설치  (0) 2015.06.29
Qt 시그널 슬롯 시스템  (0) 2015.06.27

원문 링크 http://doc.qt.io/qt-5/qtqml-cppintegration-exposecppattributes.html

해석 http://criticalmass.tistory.com/267


세미나 링크 http://www.qt.io/resource-center-qtws15-session-listing/

할것 http://doc.qt.io/qt-5/qtqml-cppintegration-exposecppattributes.html


QML 에서의 C++속성 공개


QML 은 다음과 같은 접근이 가능하다. 

  • Properties
  • Methods (providing they are public slots or flagged with Q_INVOKABLE)
  • Signals


데이터 형식 취급 및 소유권 다음링크 참고

http://doc.qt.io/qt-5/qtqml-cppintegration-data.html#data-ownership


Data Type Conversion Between QML and C++

http://doc.qt.io/qt-5/qtqml-cppintegration-data.html


Exposing Properties (공개)

 QObject - derived class   QObject 에서 파생된 클래스들은 QML에서 접근 가능한다.


C++에서 QML 타입을 정의



Writing QML Extensions with C++

http://doc.qt.io/qt-5/qtqml-tutorials-extending-qml-example.html < -이거 볼것



'Qt' 카테고리의 다른 글

Interacting with QML Objects from C++[10_25]  (0) 2015.10.25
Property Value Initialization Semantics[10_23]  (0) 2015.10.23
git 설치  (0) 2015.06.29
Qt 시그널 슬롯 시스템  (0) 2015.06.27
Qt_6월 27일  (0) 2015.06.27

GIT Program 다운로드  : http://git-scm.com/downloads



'Qt' 카테고리의 다른 글

Property Value Initialization Semantics[10_23]  (0) 2015.10.23
Exposing Attributes of C++ Types to QML[QT]  (0) 2015.10.23
Qt 시그널 슬롯 시스템  (0) 2015.06.27
Qt_6월 27일  (0) 2015.06.27
CBDSW 가이드  (0) 2015.06.25

오로카의 Darius 님의 글 http://cafe.naver.com/openrt/5858


Qt는 시그널 /슬롯 시스템을 이용하여, 개발자에게 이벤트 인터페이스를 제공한다. 

시그널/슬롯은 connect함수로 오브젝트간에 연관관계를 맺어준다.

1:1 과 1:N  으로 연결이 가능하다.




'Qt' 카테고리의 다른 글

Exposing Attributes of C++ Types to QML[QT]  (0) 2015.10.23
git 설치  (0) 2015.06.29
Qt_6월 27일  (0) 2015.06.27
CBDSW 가이드  (0) 2015.06.25
Qt  (0) 2015.06.23

비슷한예제 diagramscene 검색

diagramscene.pro

The Qt Resource System

http://doc.qt.io/qt-5/resources.html

The resource system is based on tight cooperation between qmakercc (Qt's resource compiler), and QFile.

아이콘 , 전송파일, 기타 등을 설정한다. .qrc 파일


컴파일 옵션주는법

RESOURCES     = application.qrc





main.cpp



다음과 같이 정의되어 있다.


QT_BEGIN_NAMESPACE
class QGraphicsPolygonItem;
class QGraphicsLineItem;
class QGraphicsScene;
class QRectF;
class QGraphicsSceneMouseEvent;
class QPainterPath;
QT_END_NAMESPACE





QT_BEGIN_NAMESPACE
QT_END_NAMESPACE

들어가보면 

# define QT_BEGIN_NAMESPACE namespace QT_NAMESPACE {
# define QT_END_NAMESPACE }


 Q_OBJECT 란?

Q_OBJECT 메크로 역할 http://cafe.naver.com/qtprograming/36


qobjectdefs.h

/* qmake ignore Q_OBJECT */





diagramitem.h







diagramitem.cpp










'Qt' 카테고리의 다른 글

Exposing Attributes of C++ Types to QML[QT]  (0) 2015.10.23
git 설치  (0) 2015.06.29
Qt 시그널 슬롯 시스템  (0) 2015.06.27
CBDSW 가이드  (0) 2015.06.25
Qt  (0) 2015.06.23

CBD SW개발 표준 산출물
관리 가이드
2011. 1  한국정보 진흥원 참고

 

산출물 ID 부여 기본방법

프로젝트 ID + 서브시스템 ID + 산출물 코드 + 순서번호

 

【산출물 ID 부여 사례】
프로젝트 ID : SS
서브시스템 ID : 판매 - SA, 회계 - AC, 생산 - PR
산출물 코드 : 사용자 요구사항 정의서 - REQ
유스케이스 명세서 - UC
인 경우 산출물 ID는 다음과 같이 부여될 수 있다.
판매시스템 사용자 요구사항 정의서 : SS_SA_REQ_010
회계시스템 유스케이스 명세서 : SS_AC_UC_020

'Qt' 카테고리의 다른 글

Exposing Attributes of C++ Types to QML[QT]  (0) 2015.10.23
git 설치  (0) 2015.06.29
Qt 시그널 슬롯 시스템  (0) 2015.06.27
Qt_6월 27일  (0) 2015.06.27
Qt  (0) 2015.06.23

책저자 http://www.qt-dev.com/board.php?board=kkkmain&command=skin_insert&exe=insert_iboard1_home

어플공개포럼 http://qt-apps.org/


Qt Static Build on Windows7

http://blog.naver.com/gotomars/220206072767

 

Qt 에서 이벤트 처리하기

http://kbdyj.tistory.com/entry/Qt-%EC%97%90%EC%84%9C-%EC%9D%B4%EB%B2%A4%ED%8A%B8-%EC%B2%98%EB%A6%AC%ED%95%98%EA%B8%B0


[Tips] Qt Static Build on Windows 7

https://www.qtocube.co.kr/?p=342


윈도우에서 qt static library linking

http://blog.naver.com/skdaksdptn/220392502170


Building a static Qt for Windows using MinGW

http://wiki.qt.io/Building_a_static_Qt_for_Windows_using_MinGW


QML 에 대한 정보는 여기서 찾으세요.
http://qmlbook.github.io/


사이트에 오랜만에 들어오네요.
우분투 모임 갔다가 QML 과 QtQuick 을 활용한 GUI 프로그래밍 강의를 들었습니다.

Qt 크리에이터로 에디터로 만들어서 실습한 영상입니다.
한번 보세요.   https://youtu.be/xD3DgkTRRqM  


위 분은 리눅스 플레이어 개발하신 분입니다.
BOMI 플레이어를 Qt 기반으로 만들었습니다.  



[QT/Win32] QtCreator + Qt 4.8.x(MinGW) 를 윈도우에서 설치하기

http://korone.net/bbs/board.php?bo_table=qt_lecture&wr_id=744&page=2



Qt5 Cadaques, Release 2015-03

1.1.1 Qt5 초점

- Outstanding Graphics(뛰어난 그래픽)  

- Developer Productivity(개발자 생산성)

- Cross-platform portability

- Open Development


1.2 Qt5 Introduction

1.2.1 Qt Quick

 Qt Quick is the umbrella term for the user interface technology used in Qt5

 Qt Quick 은 Qt5에서 사용되는 사용자 인터페이스에 대한 포괄적인 용어이다. 


• QML - Markup language for user interfaces 

• JavaScript - The dynamic scripting language 

• Qt C++ - The highly portable enhanced c++ library (휴대성이 강화된 C++라이브러리)



Similar to HTML, QML is a markup language. 

 

[QT/Win32] 프로젝트 파일 분리하기
멀티 플랫폼 프로젝트를 할 때

mac { ... }
unix:!mac { ... }
win32 { ... }

등으로 프로젝트 파일에 많은 분기문이 생기게 됩니다.
이게 좀 커지면 보기 힘들정도로 복잡해 지게 되는데
그럴 때 각 플렛폼별 또는 분기가 일어날 만한 부분을 별도의 프로젝트 파일로 구성하고 이를
c의 #include 구문처럼 포함 파일로 불러 올 수가 있습니다.

예를 들어 윈도우즈 전용의 프로젝트 설정을 test_win32.pri 로 만들어서 저장을 하고

이를 메인 프로젝트 파일에서 include(test_win32.pri) 로 불러올 수 있습니다.

이런식으로 정리하면 깔끔한 프로젝트 파일을 작성할 수 있습니다.

 

 

[QT/Embedded] Qt 5.4.1 raspberry Pi 프로그램 개발하기 (4)

http://korone.net/bbs/board.php?bo_table=qt_lecture&wr_id=1433

 

[QT/Win32] QtCreator + Qt 4.8.x(MinGW) 를 윈도우에서 설치하기 (5) korone


 








 

'Qt' 카테고리의 다른 글

Exposing Attributes of C++ Types to QML[QT]  (0) 2015.10.23
git 설치  (0) 2015.06.29
Qt 시그널 슬롯 시스템  (0) 2015.06.27
Qt_6월 27일  (0) 2015.06.27
CBDSW 가이드  (0) 2015.06.25

+ Recent posts