Open In App

PyQt5 QCommandLinkButton – Getting Flat property

Last Updated : 30 Jun, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

In this article we will see how we can get the flat property of the QCommandLinkButton. This property holds whether the command link button border is raised. This property’s default is false. If this property is enabled, most styles will not paint the command link button background unless the button is being pressed. We can set this property with the help of setFlat method.

In order to do this we use isFlat method with the command link button object

Syntax : button.isFlat()

Argument : It takes no argument

Return : It return bool

Below is the implementation




# importing libraries
from PyQt5.QtWidgets import * 
from PyQt5 import QtCore, QtGui
from PyQt5.QtGui import * 
from PyQt5.QtCore import * 
import sys
  
  
class Window(QMainWindow):
  
    def __init__(self):
        super().__init__()
  
        # setting title
        self.setWindowTitle("Python ")
  
        # setting geometry
        self.setGeometry(100, 100, 500, 400)
  
        # calling method
        self.UiComponents()
  
        # showing all the widgets
        self.show()
  
    # method for components
    def UiComponents(self):
          
        # creating a command link button
        cl_button = QCommandLinkButton("Press", self)
  
        # setting geometry
        cl_button.setGeometry(250, 100, 200, 50)
  
        # setting flat property
        cl_button.setFlat(True)
        # creating label
        label = QLabel("GeeksforGeeks", self)
  
        # setting label geometry
        label.setGeometry(50, 100, 200, 40)
          
        # getting flat property
        value = cl_button.isFlat()
  
        # setting text to the label
        label.setText("Flat Property : " + str(value))
  
  
  
  
# create pyqt5 app
App = QApplication(sys.argv)
  
# create the instance of our Window
window = Window()
  
# start the app
sys.exit(App.exec())


Output :



Similar Reads

PyQt5 QCommandLinkButton - Setting Flat property
In this article we will see how we can set the flat property to the QCommandLinkButton. This property holds whether the command link button border is raised. This property's default is false. If this property is enabled, most styles will not paint the command link button background unless the button is being pressed. In order to do this we use setF
1 min read
PyQt5 QCommandLinkButton - Getting Auto Default Property
In this article we will see how we can get the auto default property of the QCommandLinkButton. If this property is set to true then the command link button is an auto default button. In some GUI styles a default button is drawn with an extra frame around it, up to 3 pixels or more. Qt automatically keeps this space free around auto-default buttons
2 min read
PyQt5 QCommandLinkButton - Getting down property
In this article we will see how we can get down property of the QCommandLinkButton. Down property holds whether the command link button is pressed down. If this property is true, the button is pressed down. The signals pressed and clicked are not emitted if we set this property to true. By default this property is false. We can set this property wi
2 min read
PyQt5 QCommandLinkButton - Getting Auto Exclusive Property
In this article we will see how we can get the auto exclusive property of the QCommandLinkButton. If auto-exclusivity is enabled, checkable command link buttons that belong to the same parent widget behave as if they were part of the same exclusive button group. In an exclusive command link button group, only one button can be checked at any time;
2 min read
PyQt5 QCommandLinkButton - Getting Auto Repeat Property
In this article we will see how we can get the auto repeat property of the QCommandLinkButton. If auto repeat property is enabled, then the pressed, released, and clicked signals are emitted at regular intervals when the command link button is down. Auto repeat property is off by default. The initial delay and the repetition interval are defined in
2 min read
PyQt5 QCommandLinkButton - Getting Icon
In this article we will see how we can get the icon of the QCommandLinkButton. By default an arrow is set as the icon of the command link button although we can change this any time with the help of setIcon method. In order to do this we use icon method with the command link button object Syntax : button.icon() Argument : It takes no argument Retur
2 min read
PyQt5 QCommandLinkButton - Getting Icon Size
In this article we will see how we can get the icon size of the QCommandLinkButton. By default an arrow is set as the icon of the command link button although we can change this any time with the help of setIcon method. Icon size change the size of the icon of the command link button, which can be done with the help of setIconSize method. In order
2 min read
PyQt5 QCommandLinkButton - Getting Menu of it
In this article we will see how we can get menu of the QCommandLinkButton. Menu is basically an extra feature of command link button which allows it to have a drop down menu from which user can click on the menu items. We can set the menu to the command link button with the help of setMenu method, below is how the command link button looks like In
2 min read
PyQt5 QCommandLinkButton - Getting Help Text
In this article we will see how we can get the help text of the QCommandLinkButton. Help text is the text used to tell the other user about the usage information about the command link button. It contains the information which can be used to check the usage, limitation etc. Help text can be added to the command link button with the help of setWhats
2 min read
PyQt5 QCommandLinkButton - Getting Graphics Effects
In this article we will see how we can set graphic effect to the QCommandLinkButton. Graphic effect can be shadow, blur or color effect, these effect can be changed any time also new effects can be created any time. If there already is an effect installed on this command link button, QWidget will delete the existing effect before installing the new
2 min read