How to
Contribute to Qt



@qtproject

Hello πŸ‘‹

Edward Welbourne

QtCore
Senior SW Engineer @ TQtC
IRC: Eddy

CristiΓ‘n Maureira-Fredes

PySide
R&D Manager @ TQtC
IRC: cmaureir

PSA

⏲️ we will have breaks every 40 minutes!

Outline πŸ“–

  • What is a Contribution?
  • First steps
    • Qt Account
    • JIRA Account
    • Gerrit Account
  • Getting Qt
    • Get the Code
    • Building from Git
  • Reporting a Bug

Why Contributing to Qt? 🧐

  • Help others πŸ™Œ
  • Learn and build confidence πŸ’ͺ
  • Better releases ⭐
  • Broad ecosystem 🀝
  • Improve your portfolio and network βœ…

What is a Contribution? πŸ€”

There are many ways to contribute to Qt.
To quote QUIP 2

πŸ‘‰ qtinfo.dev/quips

What Contributions count ? (1/2)

What Contributions count ? (2/2)

  • Participating in the release process
  • Designing web sites and graphics πŸ“ˆ
  • Organizing conferences πŸ§‘β€πŸ«
  • Doing community work (events)
  • Supporting and coaching new Users πŸ™Œ
  • and also...

Qt Contributors Summit 2021

First Steps 🎬

Getting Started πŸ’ͺ

  1. Create a Qt Account
  2. Get the Source and Build Qt
  3. Set up and Configure JIRA
  4. Set up Gerrit

1. Create a Qt Account

  • Needed for JIRA, Gerrit
  • Lets you edit the Wiki
  • Single sign-on for various other things

1. Create a Qt Account

⭐ More information at wiki.qt.io/How_to_Create_Qt_Account

2. Get the Source and Build Qt

Clone and initialize


          git clone https://code.qt.io/qt/qt5.git
          cd qt5/
          ./init-repository
        
  • Can use a mirror (e.g. github) if access to is slow (e.g. outside Europe).
  • Or even set up your own local mirror.
  • init-repository has many options!

2. Get the Source and Build Qt

Clone and initialize

2. Get the Source and Build Qt

Configure


        ./configure <ARGS>
        

2. Get the Source and Build Qt

Configure

2. Get the Source and Build Qt

Build & Install


        cmake --build . --parallel
        cmake --install .
        

2. Get the Source and Build Qt

Build & Install

2. Get the Source and Build Qt

Build & Install

⚠️ You don't need to build everything!

3. JIRA: Qt's Tracking System

Getting set up

  • Register account
  • Configure your dashboard
  • Explore the different projects
    • QTBUG, QTCREATORBUG, PYSIDE, etc

3. JIRA: Qt's Tracking System

Getting set up

3. JIRA: Qt's Tracking System

Reporting a bug

  • Search to see if it's reported already
    • there might be a workaround
  • Analyze the problem/error
    • What did you do? What happened? Why is that wrong? What did you expect?
  • Communicate your environment
    • Which version of Qt? Is it a regression? Have you tried a later version?
  • Watch the report to hear what's going on and answer questions. πŸ‘€
  • Help the investigator to investigate it. πŸ‘

4. Gerrit: Qt's code collaboration tool

Configuring

  • Register with the site
  • You can configure various settings
  • Upload an SSH public key
  • Configure SSH and Git locally

4. Gerrit: Qt's code collaboration tool

Settings

4. Gerrit: Qt's code collaboration tool

Reviewing changes

  • Fresh eyes πŸ‘€
    • spot mistakes the author can't see.
  • No need to build or test the code
    • but feel free to do so πŸ™
  • It's fine to ask questions or admit confusion.
  • Be gentle ! πŸ’―

Reviewing your first patch

Submitting a patch πŸ§‘β€πŸ’»

Changing Code

Making the change

  • When you fix a bug yourself, or make some other improvement.
  • While working: commit early, commit often.
  • Include tests & Update affected documentation.
  • Rebase later, to make each commit do one coherent thing, that's easy to review.
  • Heed the advice of the Commit Policy.

Changing Code

Send it for review

  • Review and test before you push!
  • Give each commit a Pick-to: footer
  • Push to gerrit's refs/for/dev branch.

Let's submit a patch πŸŽ‰

Submitting your first patch

(*) You can also use a local branch to work on your patch instead of using dev.

Getting it reviewed

Find reviewers

  • git blame can tell you who's worked on this code before.
  • In Gerrit, invite those folk to review your change.
  • PreTest; a 'bot will build, test and report back. πŸ€–

Getting it reviewed

Engage with feedback

  • Be (reasonably) patient. 🧘
  • Work with reviewers to make the patch better.

Getting it reviewed

Integration

  • Once you get approval, Stage.
    • If that fails, read what went wrong.
    • If unrelated, Stage again;
    • otherwise, fix what broke and push again.
  • A 'bot will handle the Pick-to footer:
    • help any reviews that produces to get integrated, too.
  • Don't forget about testresults.qt.io/coin

Not keen on writing C++? πŸ™‡

More interesting projects

Declarative Interfaces

import QtQuick 2.0

Rectangle {
    id: screen
    width: 490; height: 720
    SystemPalette { id: activePalette }
    Item {
        width: parent.width
        anchors {
          top: parent.top;
          bottom: toolBar.top
        }
        Image {
            id: background
            anchors.fill: parent
            source: "../background.jpg"
        }
    }
    …
}

More interesting projects

Python code 🐍

  • Write PySide examples/tutorials and more!
  • Mix PySide with other Python modules
  • Update the documentation! doc.qt.io/qtforpython

        import sys
        from PySide6.QtWidgets import (QApplication,
                                       QMainWindow,
                                       QPushButton)

        class MainWindow(QMainWindow):
            def __init__(self, parent=None):
                super().__init__(parent)
                self.b = QPushButton("My Button", self)
                self.b.clicked.connect(self.handle)

            def handle(self):
                self.button.setText("Ready")

        if __name__ == "__main__":
            app = QApplication()
            window = MainWindow()
            window.show()
            sys.exit(app.exec())

More interesting projects

Data Analysis 🐼

…and don't forget about the Qt Wiki

  • Every Wiki needs gardeners. πŸŒ±πŸ§‘β€πŸŒΎ
  • When you eventually find a page with the info you wanted
    • Ask: what would have made that easier to find ?
  • Maybe add it to a category,
    • Or link its category into the broader hierarchy.
  • Add links to it from the places you first expected to find it.
  • Add to the page some mention of the keywords you first searched for.

Improve the status quo

Where to get help? πŸ†˜

Useful Resources

How to
Contribute to Qt



Revisit this talk at
qtinfo.dev/akademy2021_contribute