Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Change size of text

Change size of text

Scheduled Pinned Locked Moved Unsolved Qt for Python
9 Posts 3 Posters 766 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sashup
    wrote on last edited by
    #1

    How Can I change size of text here?

    class IntroductionPage(QtWidgets.QWizardPage):
        def __init__(self, *args, **kwargs):
            super(IntroductionPage, self).__init__(*args, **kwargs)
    
            self.setTitle("Introduction")
            self.label = QtWidgets.QLabel("Welcome to the One Inc™'s Teacher Interactive Accessment tool. Follow the prompts to set up your Mark Sheet")
            self.label.setWordWrap(True)
            self.layout = QtWidgets.QVBoxLayout()
            self.layout.addWidget(self.label)
            self.setLayout(self.layout)
    
        def nextId(self):
            return Wizard.class1
    ...
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Do you mean changing the font used by QLabel to be bigger ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      S 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Do you mean changing the font used by QLabel to be bigger ?

        S Offline
        S Offline
        sashup
        wrote on last edited by
        #3

        @SGaist Yes. Is it possible?

        self.setTitle("Introduction")
        self.label = QtWidgets.QLabel("Welcome to the One Inc™'s Teacher Interactive Accessment tool. Follow the prompts to set up your Mark Sheet")
        
        
        JonBJ 1 Reply Last reply
        0
        • S sashup

          @SGaist Yes. Is it possible?

          self.setTitle("Introduction")
          self.label = QtWidgets.QLabel("Welcome to the One Inc™'s Teacher Interactive Accessment tool. Follow the prompts to set up your Mark Sheet")
          
          
          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #4

          @sashup
          Yes, in @SGaist's answer click on the word font which is a link to the page.

          S 1 Reply Last reply
          0
          • JonBJ JonB

            @sashup
            Yes, in @SGaist's answer click on the word font which is a link to the page.

            S Offline
            S Offline
            sashup
            wrote on last edited by
            #5

            @JonB Thank. I dont understand how to use it for

            self.setTitle("Introduction")
            self.label = QtWidgets.QLabel("Welcome to the One Inc™'s Teacher Interactive Accessment tool. Follow the prompts to set up your Mark Sheet")
            
            
            JonBJ 1 Reply Last reply
            0
            • S sashup

              @JonB Thank. I dont understand how to use it for

              self.setTitle("Introduction")
              self.label = QtWidgets.QLabel("Welcome to the One Inc™'s Teacher Interactive Accessment tool. Follow the prompts to set up your Mark Sheet")
              
              
              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by
              #6

              @sashup
              Something like:

              font = self.label.font()
              font.setPointSize(font.pointSize() + 10)
              self.label.setFont(font)
              

              ?

              S 1 Reply Last reply
              1
              • JonBJ JonB

                @sashup
                Something like:

                font = self.label.font()
                font.setPointSize(font.pointSize() + 10)
                self.label.setFont(font)
                

                ?

                S Offline
                S Offline
                sashup
                wrote on last edited by
                #7

                @JonB ?

                font = self.label.font()
                font.setPointSize(font.pointSize() + 10)
                self.label.setFont(font)
                
                self.setTitle("Introduction")
                self.label = QtWidgets.QLabel("Welcome to the One Inc™'s Teacher Interactive Accessment tool. Follow the prompts to set up your Mark Sheet")
                
                
                JonBJ 1 Reply Last reply
                0
                • S sashup

                  @JonB ?

                  font = self.label.font()
                  font.setPointSize(font.pointSize() + 10)
                  self.label.setFont(font)
                  
                  self.setTitle("Introduction")
                  self.label = QtWidgets.QLabel("Welcome to the One Inc™'s Teacher Interactive Accessment tool. Follow the prompts to set up your Mark Sheet")
                  
                  
                  JonBJ Offline
                  JonBJ Offline
                  JonB
                  wrote on last edited by
                  #8

                  @sashup
                  How can you (try to) access self.label for self.label.setFont(font) if you have not yet gone self.label = QtWidgets.QLabel()?

                  S 1 Reply Last reply
                  0
                  • JonBJ JonB

                    @sashup
                    How can you (try to) access self.label for self.label.setFont(font) if you have not yet gone self.label = QtWidgets.QLabel()?

                    S Offline
                    S Offline
                    sashup
                    wrote on last edited by
                    #9

                    @JonB Thank. Works)

                    1 Reply Last reply
                    1

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved