Good evening, I am developing an application in QtDesigner PySide2 in python, the main code so far is the following:
from PySide2.QtWidgets import QMainWindow
from views.Main_Menu import MainWindow
from Custom_Widgets.Widgets import *
from PySide2.QtWidgets import QApplication
import sys
class MainMenu_Controller(QMainWindow, MainWindow):
def __init__(self):
super().__init__()
self.ui=MainWindow()
self.ui.setupUi(self)
loadJsonStyle(self,self.ui)
if __name__ == '__main__':
app = QApplication(sys.argv)
window=MainWindow()
window.show()
sys.exit(app.exec_())
I import the configurations from a ".json" file, which is the following:
{
"QMainWindow":[
{
"tittle":"Control de Impuestos",
"icon":":/Iconos/assets/Iconos/framer.svg",
"frameless":true,
"transluscentBg":true,
"sizeGrip":"sizeGrip",
"navigation":[
{
"minimize":"Minimize",
"close":"Close",
"restore":[
{
"buttonName":"Restorebtn",
"normalIcon":":/Iconos/assets/Iconos/minimize-2.svg",
"maximizedIcon":":/Iconos/assets/Iconos/maximize-2.svg"
}
],
"moveWindow":"TopMenuContainer",
"tittleBar":"TopMenuContainer"
}
]
}
]
}
The problem is that the file runs, but when I import 'Custom_Widgets' it gives me the following error:
OSError: no library called "cairo-2" was found
no library called "cairo" was found
no library called "libcairo-2" was found
cannot load library 'libcairo.so.2': error 0x7e
cannot load library 'libcairo.2.dylib': error 0x7e
cannot load library 'libcairo-2.dll': error 0x7e
Do you know what the problem is? It took several weeks looking for the solution.
.svgassets specified in your configuration, and Qt needs a library calledlibcairoto be able to use those types of images. What operating system are you using? You will need to install the cairo libraries (and probably development files). - wkl