Custom Widgets & Events

Slides:



Advertisements
Similar presentations
First Steps with Qt Julien Finet Kitware Inc. Jan. 05 th 2010.
Advertisements

Sven Johannsen C++ User Group Aachen 01/08/15
Lecture 4: Embedded Application Framework Qt Tutorial Cheng-Liang (Paul) Hsieh ECE 424 Embedded Systems Design.
QT GUI Programming CS340 – Software Design © 2009 – Jason Leigh University of Illinois at Chicago.
Advanced Audio Setup Troubleshooting your audio Users’ Reference.
1 After completing this lesson, you will be able to: Add a header and footer to a worksheet. Change margins and center a worksheet. Change the orientation.
1 of 4 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
CS 225 Lab #2 - Pointers, Copy Constructors, Destructors, and DDD.
QT Intro. 김기형
L8: Qt4 Concept Qt Module QObject QObject Model Signal and Slot Qt Event Loop.
Outlook 2007 Tips, Tricks, and Tools. Overview Main Screen Navigation Pane View Pane Reading Pane To–Do Bar Create a New Message Contacts Create a Signature.
Blanchette and Summerfield, Ch. 2
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 4 1 Microsoft Office FrontPage 2003 Tutorial 4 – Using Shared Borders and Themes.
Basic Android Tutorial USF’s Association for Computing Machinery.
Click your mouse to continue. Ways to Merge Data When you have finished editing your main document and inserting the merge fields, you have several choices.
Copyright © Curt Hill Java Looking at our first console application in Eclipse.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
XP New Perspectives on Microsoft Windows 2000 Professional Windows 2000 Tutorial 1 1 Microsoft Windows 2000 Professional Tutorial 1 – Exploring the Basics.
Graphics and Event-Driven Programming in Java John C. Ramirez Department of Computer Science University of Pittsburgh.
USING WORDPRESS TO CREATE A WEBSITE (RATHER THAN A BLOG) STEP-BY-STEP INSTRUCTIONS.
Concurrent Programming and Threads Threads Blocking a User Interface.
1 Creating Windows GUIs with Visual Studio. 2 Creating the Project New Project Visual C++ Projects Windows Forms Application Give the Project a Name and.
Click your mouse to continue. The Office Shortcut Bar The Office Shortcut Bar contains program buttons that, when clicked, start new documents or start.
-1- National Alliance for Medical Image Computing First Steps with Qt Julien Finet Kitware Inc. Jan. 05 th 2010.
Confidential © 2008 Teleca AB Creating Custom Widgets Author: Patricia Jiang Date: July 29, 2010 Version: 1.0 Teleca Chengdu.
USING WORDPRESS TO CREATE A WEBSITE (RATHER THAN A BLOG) STEP-BY-STEP INSTRUCTIONS.
QT Programming QT Programming Ruku Roychowdhury. Background QT is a cross platform application framework. Widely used to develop GUI applications. Originally.
GUIs Basic Concepts. GUI GUI : Graphical User Interface Window/Frame : a window on the screen Controls/Widgets : GUI components.
QT – Introduction C++ GUI Programming with Qt 4
Creating Menus Menu Bar – behaves like standard Windows menus Can be used in place of or in addition to buttons to execute a procedure Menu items are controls.
QT – Windows, menus, and such C++ GUI Programming with Qt 4 Qt 4.5 Reference Documentation Blanchette and Summerfield, Ch. 3.
Create Windows Setup and Deployment Projects Windows Development Fundamentals LESSON 5.2.
CIS 270—Application Development II Chapter 11—GUI Components: Part I.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 7 Event-Driven Programming and Basic GUI Objects.
Chapter 8 Using Document Collaboration, Integration, and Charting Tools Microsoft Word 2013.
Excel Tutorial 8 Developing an Excel Application
Steps to Build Frame Window Recipe Application
Customizing the Toolbar
Chapter 1: An Introduction to Visual Basic 2015
CSE 333 – Section 4 HW3, MVC, GTK+.
Chapter 2 – Introduction to the Visual Studio .NET IDE
Chapter Eleven Handling Events.
QT graphical user interface framework
Using Procedures and Exception Handling
Chap 7. Building Java Graphical User Interfaces
This pointer, Dynamic memory allocation, Constructors and Destructor
PC02 Term 1 Project Basic Messenger. PC02 Term 1 Project Basic Messenger.
Microsoft Windows 2000 Professional
CIS16 Application Development Programming with Visual Basic
1. Open Visual Studio 2008.
Key Applications Module Lesson 12 — Word Essentials
Event Driven Systems and Modeling
Tonga Institute of Higher Education
Click to edit title TO ADD NEW SLIDE LAYOUTS: Make sure you have the ‘Home’ tab selected at the top of the PowerPoint screen and click the down facing.
EVENT TITLE Time, Date Location
TO ADD NEW SLIDE LAYOUTS: Make sure you have the ‘Home’ tab selected at the top of the PowerPoint screen and click the down facing arrow to the right on.
EVENT TITLE Time, Date Location
Learning the Basics of Microsoft Word 2010 for Microsoft Windows
TO ADD NEW SLIDE LAYOUTS: Make sure you have the ‘Home’ tab selected at the top of the PowerPoint screen and click the down facing arrow to the right on.
TO ADD NEW SLIDE LAYOUTS: Make sure you have the ‘Home’ tab selected at the top of the PowerPoint screen and click the down facing arrow to the right on.
TO ADD NEW SLIDE LAYOUTS: Make sure you have the ‘Home’ tab selected at the top of the PowerPoint screen and click the down facing arrow to the right on.
Java Looking at our first console application in Eclipse
Click to edit title TO ADD NEW SLIDE LAYOUTS: Make sure you have the ‘Home’ tab selected at the top of the PowerPoint screen and click the down facing.
Running a Java Program using Blue Jay.
Key Applications Module Lesson 12 — Word Essentials
TO ADD NEW SLIDE LAYOUTS: Make sure you have the ‘Home’ tab selected at the top of the PowerPoint screen and click the down facing arrow to the right on.
Click to edit title TO ADD NEW SLIDE LAYOUTS: Make sure you have the ‘Home’ tab selected at the top of the PowerPoint screen and click the down facing.
Lecture Set 10 Windows Controls and Forms
Microsoft Excel 2007 – Level 2
Lab 07 Creating Documents with Efficiency and Consistency
Presentation transcript:

Custom Widgets & Events

Top Level Windows Dialog Simple window Window Has status bar, menu

Subclasses QT GUIs generally subclass an existing class Add features FindDialog extends QDialog Add features Controls this dialog has New behaviors (signals/slots) Connections between behaviors

FindDialog.h Extends Qdialog Q_OBJECT Must add for slots and signals to get handled correctly Constructor takes optional pointer to parent widget

FindDialog.h signals: public/private slots: Special section identifying signal functions public/private slots: Section identifying slot functions

FindDialog.h private members: Components we may need to refer to throughout lifetime of app

FindDialog.cpp Constructor Body… If parent widget we live in, pass that off to Qdialog part to handle:

The Main Main just creates instance of our GUI, starts app:

FindDialog.cpp Constructor Body… setup components Optional stuff: tr( ) – allows for easier translation & - Defines alt-shortcut based on next char setBudy – makes hotkey for label select lineEdit

FindDialog.cpp Constructor Body… setup components Optional stuff: setDefualt( ) – makes this button be one that responds to Enter key on form setEnabled(false) – make widget unusable

The Layout hBox for main vBox for left hBox for topLeft vBox for right

FindDialog.cpp Constructor Body… layout stuff Don't need layouts to be members setFixedHeight Prevent me from messing it up sizeHint() Get preferred size

FindDialog.cpp Constructor Body… behavior setup lineEdit textChanged calls our dialog's enableFindButton findButton clicked calls findClicked function of our dialog Close button closes the window Params of slot and signal should usually match though extra ones in signal may be OK

FindDialog.cpp Destructor None needed!!! Qwidget destructor (part of us) deletes any contained widgets when we are deleted Would only need one for non-widget related heap allocations

FindDialog.cpp enableFindButton: Slot function… must take const Qstring& because that is what lineEdit.textChanged sends:

FindDialog.cpp Emit function() : send with this name findClicked: Emits appropriate signal Nothing listening, but a text editor window could…

QStrings QString mostly like normal string Doesn't overload << operator though Turn QString to std::string using .toStdString()

Debugging Hints For console output make sure .pro has this line: Then check application output:

Debugging Hints For console output make sure .pro has this line: Or check Run in Terminal under Project settings: