Programming/QT
-
[QT] QPushbutton으로 새창 열기Programming/QT 2018. 11. 29. 22:02
*Qt 공부를 위해 기록한 포스팅입니다. 잘못된 정보나 오타가 있을시 피드백 부탁드립니다.* 버튼 이벤트로new window 열기 이번 포스팅은 안드로이드 스튜디오를 배워본 분들이라면 이해하기 쉬울지도 모릅니다 :) 안드로이드 스튜디오에서 새창을 띄우기 위해 intent를 이용하여 activity를 이동했듯 qt도 비슷한 원리로 구현되기 때문입니다. 그럼 먼저 안드로이드에 activity와 같은 역할을 하는 design form을 새로 생성해볼까요 1. New Design Form 클래스 생성 qt design form calss -> dialog without buttons 순서로 뉴 폼을 만들면 자동으로 헤더와 리소스 파일이 생성됩니다. 2. 헤더파일 추가 - pushbtn.h (첫번째 프로젝트 파일..
-
[QT] 소소한 기능들Programming/QT 2018. 11. 29. 00:01
QLabel 텍스트 색상 체인지 1. setStyleSheet 사용 label ->setStyleSheet("QLabel { background-color : blue; color: rgb(255,255,255); }"); - rgb 컬러를 사용하면 커서로 미리 예상 색상을 확인할 수 있다. 2. QPalette 사용 QPalette test_palette; test_palette.setColor(QPalette::Window, Qt::blue); test_palette.setColor(QPalette::WindowText, Qt::white); label->setAutoFillBackground(true); label->setPalette(test_palette); label->setText("hell..
-
[QT] 프로그래밍의 시작 hello world 출력하기Programming/QT 2018. 11. 28. 23:09
*Qt 공부를 위해 기록한 포스팅입니다. 잘못된 정보나 오타가 있을시 피드백 부탁드립니다.* "Hello world!"Qt로 어떻게 출력할까? 1. 프로젝트 생성 - Name: hello_world로 프로젝트 생성 - 클래스명을 바꾸면 자동으로 헤더/소스파일 이름도 클래스명에 따라 바뀜 2. 소스 코드 - Sources - main.cpp로 들어가 아래 코드 입력 첫번째 방법 #include #include int main(int argc, char *argv[]) { QApplication a(argc, argv); QLabel * label = new QLabel; label ->setText("hello world!"); label ->show(); return a.exec(); } 두번째 방법#i..
-
[QT] QT에 대하여Programming/QT 2018. 11. 23. 19:36
QT란?QT는 C++언어를 기반으로 GUI개발이 가능한 크로스 플랫폼 프레임워크입니다.Cross Platform이란 말처럼 Window, Linux, Mac OS, Symbian....등 거의 모든플랫폼을 버젼 상관없이 지원하며 이는 각 운영체제에 맞춰 개발 해야하는 시간 소요를 줄여줍니다. “Write code once, deploy everywhere!” ToolsQT-Creator : QT 크로스 플랫폼 통합 개발 환경입니다. 장치를 통한 프로토타이핑이 가능하며 임베디드 개발에 용이합니다. 보통 비쥬얼 스튜디오보다 QT Creator를 더 선호합니다. QT-Designer : 폼 제작을 도와주는 디자인 툴 입니다. 일일이 코드로 GUI 작업을 해야하는 귀찮음에서 해방시켜줍니다. 짱짱 QT-Assis..