Originally Posted by
neuronet
Word and Office do exactly what I want.
Whether they are doing it a certain way, or my terminology was perfect, is another question, but my question is how can I get my treeview to behave like that?
Adjust the font.
unless I somehow wrap my whole widget into a QGraphicsScene
This will not change a thing. You would not get the effect you wanted. While the font might look ok, all bitmaps will be upscaled.
#include <QApplication>
#include <QTreeView>
#include <QFileSystemModel>
#include <QGraphicsView>
#include <QGraphicsScene>
#include <QGraphicsProxyWidget>
int main(int argc, char **argv) {
view.setScene(&scene);
QFileSystemModel model;
model.setRootPath("/usr/share/icons");
lv.setModel(&model);
QGraphicsProxyWidget *w = scene.addWidget(&lv);
w->setScale(4);
view.show();
return app.exec();
}
#include <QApplication>
#include <QTreeView>
#include <QFileSystemModel>
#include <QGraphicsView>
#include <QGraphicsScene>
#include <QGraphicsProxyWidget>
int main(int argc, char **argv) {
QApplication app(argc, argv);
QGraphicsScene scene;
QGraphicsView view;
view.setScene(&scene);
QTreeView lv;
QFileSystemModel model;
model.setRootPath("/usr/share/icons");
lv.setModel(&model);
QGraphicsProxyWidget *w = scene.addWidget(&lv);
w->setScale(4);
view.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
scaledview.jpg
If you want to have zoomable UI then indeed the simplest thing is to wrap it in graphics view but the result will be far different from text processor zoom functionality.
Bookmarks