Yh I generated it , .py file and imported in the main file application but still didn’t work, I added some debug statements to check the file path but shows it wasn’t found
Читать полностью…anyone help me please?
# test_icon.pyicon not working or showing, please download an image online and use it to test for me and fix for me Читать полностью…
import sys
from PySide6.QtWidgets import QApplication, QLabel, QVBoxLayout, QWidget
from PySide6.QtGui import QPixmap
from qss_style import resources_rc # Import the compiled resources
# <!-- clean/qss_style/resources.qrc -->
# <RCC>
# <qresource prefix="/icons">
# <file>icons/drop_down.png</file>
# <!-- Add more icon files here if needed -->
# </qresource>
# <qresource prefix="/styles">
# <file>style.qss</file>
# </qresource>
# </RCC>
#-- Command---#
# pyside6-rcc resources.qrc -o resources_rc.py
def main():
app = QApplication(sys.argv)
window = QWidget()
layout = QVBoxLayout()
label = QLabel()
pixmap = QPixmap(":/icons/drop_down.png")
if pixmap.isNull():
print("Failed to load icon: :/icons/drop_down.png")
label.setText("Icon Failed to Load")
else:
print("Successfully loaded icon: :/icons/drop_down.png")
label.setPixmap(pixmap.scaled(16, 16)) # Adjust size as needed
layout.addWidget(label)
window.setLayout(layout)
window.show()
sys.exit(app.exec())
if __name__ == "__main__":
main()
anyone help me please?
# test_icon.pyicon not working or showing, please download an image online and use it to test for me and fix for me Читать полностью…
import sys
from PySide6.QtWidgets import QApplication, QLabel, QVBoxLayout, QWidget
from PySide6.QtGui import QPixmap
from qss_style import resources_rc # Import the compiled resources
# <!-- clean/qss_style/resources.qrc -->
# <RCC>
# <qresource prefix="/icons">
# <file>icons/drop_down.png</file>
# <!-- Add more icon files here if needed -->
# </qresource>
# <qresource prefix="/styles">
# <file>style.qss</file>
# </qresource>
# </RCC>
#-- Command---#
# pyside6-rcc resources.qrc -o resources_rc.py
def main():
app = QApplication(sys.argv)
window = QWidget()
layout = QVBoxLayout()
label = QLabel()
pixmap = QPixmap(":/icons/drop_down.png")
if pixmap.isNull():
print("Failed to load icon: :/icons/drop_down.png")
label.setText("Icon Failed to Load")
else:
print("Successfully loaded icon: :/icons/drop_down.png")
label.setPixmap(pixmap.scaled(16, 16)) # Adjust size as needed
layout.addWidget(label)
window.setLayout(layout)
window.show()
sys.exit(app.exec())
if __name__ == "__main__":
main()
Welcome to the group, @IshaqShamraiz! :-)
Wanna share your story of how you started with Qt, QML or C++? Maybe some nice feature that made you stick with it.
Rules are set on the description of the group. :)
@unknowRecon [6131908980
] warned (1 of 2).
Due to: refrain from unauthorized self promotion
Maybe this is enough, I didn't find where is the source code of Qt for MCU (while it should be accessible, ask to the devs directly I think, which is concerning).
Читать полностью…Hi
I have been a qml / c++ dev for past 1.5 yrs..and here to make connections and interact/ brainstorm ideas
Hello, is it possible to access the source code of an exe file written in Python and compiled with C++?
Читать полностью…I guess you need to call setRowCount (and setColumnCount) in the model constructor. If this is not helping, give a more precise description of what is not working.
Читать полностью…anyone help me please?
# test_icon.pyicon not working or showing, please download an image online and use it to test for me and fix for me Читать полностью…
import sys
from PySide6.QtWidgets import QApplication, QLabel, QVBoxLayout, QWidget
from PySide6.QtGui import QPixmap
from qss_style import resources_rc # Import the compiled resources
# <!-- clean/qss_style/resources.qrc -->
# <RCC>
# <qresource prefix="/icons">
# <file>icons/drop_down.png</file>
# <!-- Add more icon files here if needed -->
# </qresource>
# <qresource prefix="/styles">
# <file>style.qss</file>
# </qresource>
# </RCC>
#-- Command---#
# pyside6-rcc resources.qrc -o resources_rc.py
def main():
app = QApplication(sys.argv)
window = QWidget()
layout = QVBoxLayout()
label = QLabel()
pixmap = QPixmap(":/icons/drop_down.png")
if pixmap.isNull():
print("Failed to load icon: :/icons/drop_down.png")
label.setText("Icon Failed to Load")
else:
print("Successfully loaded icon: :/icons/drop_down.png")
label.setPixmap(pixmap.scaled(16, 16)) # Adjust size as needed
layout.addWidget(label)
window.setLayout(layout)
window.show()
sys.exit(app.exec())
if __name__ == "__main__":
main()
anyone help me please?
# test_icon.pyicon not working or showing, please download an image online and use it to test for me and fix for me Читать полностью…
import sys
from PySide6.QtWidgets import QApplication, QLabel, QVBoxLayout, QWidget
from PySide6.QtGui import QPixmap
from qss_style import resources_rc # Import the compiled resources
# <!-- clean/qss_style/resources.qrc -->
# <RCC>
# <qresource prefix="/icons">
# <file>icons/drop_down.png</file>
# <!-- Add more icon files here if needed -->
# </qresource>
# <qresource prefix="/styles">
# <file>style.qss</file>
# </qresource>
# </RCC>
#-- Command---#
# pyside6-rcc resources.qrc -o resources_rc.py
def main():
app = QApplication(sys.argv)
window = QWidget()
layout = QVBoxLayout()
label = QLabel()
pixmap = QPixmap(":/icons/drop_down.png")
if pixmap.isNull():
print("Failed to load icon: :/icons/drop_down.png")
label.setText("Icon Failed to Load")
else:
print("Successfully loaded icon: :/icons/drop_down.png")
label.setPixmap(pixmap.scaled(16, 16)) # Adjust size as needed
layout.addWidget(label)
window.setLayout(layout)
window.show()
sys.exit(app.exec())
if __name__ == "__main__":
main()
Can anyone here point me to the implementation of ArcItem (qml mcus) in github repo...
Читать полностью…Then you'll need to do some reverse engineering, and the data will depend on how it was compiled. I do not think you will ever be able to recover the Python version at all
Читать полностью…How was it compiled? I think it will be hard to recover the actual source code, but you may be able to get something.
Читать полностью…Welcome to the group, -! :-)
Wanna share your story of how you started with Qt, QML or C++? Maybe some nice feature that made you stick with it.
Rules are set on the description of the group. :)
import sys
import typing
from PySide6.QtWidgets import QApplication, QListView
from PySide6.QtCore import QAbstractListModel, QModelIndex, Qt
class ChoiceModel(QAbstractListModel):
def __init__(self, data: typing.List[dict], parent=None) -> None:
super().__init__(parent=parent)
self._data = data
def rowCount(self, parent = QModelIndex) -> int:
return len(self._data)
def data(self, index: QModelIndex, role: int = Qt.ItemDataRole.DisplayRole) -> typing.Any:
ret = None
if not self._data:
ret = None
if not index.isValid():
ret = None
if role == Qt.ItemDataRole.DisplayRole:
ret = self._data[index.row()]["name"]
if role == Qt.ItemDataRole.CheckStateRole:
ret = Qt.CheckState.Checked if self._data[index.row()]["checked"] else Qt.CheckState.Unchecked
return ret
def setData(self, index: QModelIndex, value: typing.Any, role = Qt.ItemDataRole.CheckStateRole) -> bool:
if not index.isValid():
return False
if role == Qt.ItemDataRole.CheckStateRole:
self._data[index.row()]["checked"] = False if value == 0 else True
self.dataChanged.emit(index, index, [Qt.ItemDataRole.CheckStateRole])
return True
def flags(self, index: QModelIndex) -> Qt.ItemFlag:
if not index.isValid():
return Qt.ItemFlag.NoItemFlags
return Qt.ItemFlag.ItemIsEnabled | Qt.ItemFlag.ItemIsSelectable | Qt.ItemFlag.ItemIsUserCheckable
if __name__ == "__main__":
app = QApplication(sys.argv)
view = QListView()
view.setWindowTitle('Choice Model List View')
model = ChoiceModel([{"name": "Item 1", "checked": True}, {"name": "Item 2", "checked": False}])
view.setModel(model)
view.setMinimumSize(400, 600)
view.show()
sys.exit(app.exec())
x: int == y: int.
what I've tried so far. get shortest path as array
struct VertexBB {Читать полностью…
uint64_t id;
std::vector<Instr_with_content> instrs;
};
struct Edge {
uint64_t from_id;
uint64_t to_id;
};
//using BGraph = boost::directed_graph<VertexBB, Edge>;
using BGraph = boost::adjacency_list<
boost::vecS,
boost::vecS,
boost::directedS,
VertexBB,
Edge>;
typedef boost::graph_traits<BGraph>::vertex_descriptor VertexDesc;
typedef boost::graph_traits<BGraph>::edge_descriptor EdgeDesc;
std::vector<VertexDesc> getPath(
const BGraph& graph,
const std::vector<VertexDesc>& pMap,
const VertexDesc source,
const VertexDesc destination
) {
std::vector<VertexDesc> path;
//VertexDesc current = destination;
//while (current != source)
//{
// path.push_back(current);
// current = pMap[current];
//}
//path.push_back(source);
//return path;
VertexDesc current = destination;
do {
auto const pred = pMap.at(current);
std::cout << "extract path: " << std::hex << graph[current].id << " <- "
<< std::hex << graph[pred].id << "\n";
if (current == pred)
break;
current = pred;
path.push_back(current);
} while (current != source);
std::reverse(path.begin(), path.end());
return path;
}
std::vector<VertexDesc> djikstra(
const BGraph& graph,
const VertexDesc source,
const VertexDesc destination
) {
const int numVertices = boost::num_vertices(graph);
std::vector<int> distances(numVertices);
std::vector<VertexDesc> pMap(numVertices);
auto distanceMap =
boost::predecessor_map(
boost::make_iterator_property_map(
pMap.begin(),
boost::get(boost::vertex_index, graph)))
.distance_map(
boost::make_iterator_property_map(
distances.begin(),
boost::get(boost::vertex_index, graph)))
.weight_map(boost::make_constant_property<EdgeDesc>(1.0));
boost::dijkstra_shortest_paths(graph, source, distanceMap);
return getPath(graph, pMap, source, destination);
}
.....
calling
std::vector<VertexDesc> path = djikstra(BGWTA.graph, vd_node, vd_node1);
path.size is ALWAYS 0
what I've tried so far. get shortest path as array
struct VertexBB {Читать полностью…
uint64_t id;
std::vector<Instr_with_content> instrs;
};
struct Edge {
uint64_t from_id;
uint64_t to_id;
};
//using BGraph = boost::directed_graph<VertexBB, Edge>;
using BGraph = boost::adjacency_list<
boost::vecS,
boost::vecS,
boost::directedS,
VertexBB,
Edge>;
typedef boost::graph_traits<BGraph>::vertex_descriptor VertexDesc;
typedef boost::graph_traits<BGraph>::edge_descriptor EdgeDesc;
std::vector<VertexDesc> getPath(
const BGraph& graph,
const std::vector<VertexDesc>& pMap,
const VertexDesc source,
const VertexDesc destination
) {
std::vector<VertexDesc> path;
//VertexDesc current = destination;
//while (current != source)
//{
// path.push_back(current);
// current = pMap[current];
//}
//path.push_back(source);
//return path;
VertexDesc current = destination;
do {
auto const pred = pMap.at(current);
std::cout << "extract path: " << std::hex << graph[current].id << " <- "
<< std::hex << graph[pred].id << "\n";
if (current == pred)
break;
current = pred;
path.push_back(current);
} while (current != source);
std::reverse(path.begin(), path.end());
return path;
}
std::vector<VertexDesc> djikstra(
const BGraph& graph,
const VertexDesc source,
const VertexDesc destination
) {
const int numVertices = boost::num_vertices(graph);
std::vector<int> distances(numVertices);
std::vector<VertexDesc> pMap(numVertices);
auto distanceMap =
boost::predecessor_map(
boost::make_iterator_property_map(
pMap.begin(),
boost::get(boost::vertex_index, graph)))
.distance_map(
boost::make_iterator_property_map(
distances.begin(),
boost::get(boost::vertex_index, graph)))
.weight_map(boost::make_constant_property<EdgeDesc>(1.0));
boost::dijkstra_shortest_paths(graph, source, distanceMap);
return getPath(graph, pMap, source, destination);
}
.....
calling
std::vector<VertexDesc> path = djikstra(BGWTA.graph, vd_node, vd_node1);
path.size is ALWAYS 0
what I've tried so far. get shortest path as array
struct VertexBB {Читать полностью…
uint64_t id;
std::vector<Instr_with_content> instrs;
};
struct Edge {
uint64_t from_id;
uint64_t to_id;
};
//using BGraph = boost::directed_graph<VertexBB, Edge>;
using BGraph = boost::adjacency_list<
boost::vecS,
boost::vecS,
boost::directedS,
VertexBB,
Edge>;
typedef boost::graph_traits<BGraph>::vertex_descriptor VertexDesc;
typedef boost::graph_traits<BGraph>::edge_descriptor EdgeDesc;
std::vector<VertexDesc> getPath(
const BGraph& graph,
const std::vector<VertexDesc>& pMap,
const VertexDesc source,
const VertexDesc destination
) {
std::vector<VertexDesc> path;
//VertexDesc current = destination;
//while (current != source)
//{
// path.push_back(current);
// current = pMap[current];
//}
//path.push_back(source);
//return path;
VertexDesc current = destination;
do {
auto const pred = pMap.at(current);
std::cout << "extract path: " << std::hex << graph[current].id << " <- "
<< std::hex << graph[pred].id << "\n";
if (current == pred)
break;
current = pred;
path.push_back(current);
} while (current != source);
std::reverse(path.begin(), path.end());
return path;
}
std::vector<VertexDesc> djikstra(
const BGraph& graph,
const VertexDesc source,
const VertexDesc destination
) {
const int numVertices = boost::num_vertices(graph);
std::vector<int> distances(numVertices);
std::vector<VertexDesc> pMap(numVertices);
auto distanceMap =
boost::predecessor_map(
boost::make_iterator_property_map(
pMap.begin(),
boost::get(boost::vertex_index, graph)))
.distance_map(
boost::make_iterator_property_map(
distances.begin(),
boost::get(boost::vertex_index, graph)))
.weight_map(boost::make_constant_property<EdgeDesc>(1.0));
boost::dijkstra_shortest_paths(graph, source, distanceMap);
return getPath(graph, pMap, source, destination);
}
.....
calling
std::vector<VertexDesc> path = djikstra(BGWTA.graph, vd_node, vd_node1);
path.size is ALWAYS 0