Home > Mobile >  Spun QTreeView QTreeView + QAbstractItemModel, make the item stand up
Spun QTreeView QTreeView + QAbstractItemModel, make the item stand up

Time:09-22

How will I use QTreeView rotate 90 degrees TAB style in the tabWidget redraw method, inheriting QProxyStyle, but just change the style, scope has not changed, still need to click on the location of the original,

CodePudding user response:

If just want to make interface spin 90 degrees, can be used to:
 
QGraphicsScene scene;
Scene. AddWidget (treeView);
QGraphicsView view (& amp; Scene);
The rotate (90);
view.show();

CodePudding user response:

QTreeView is only part of the page using the show () will open a separate page

CodePudding user response:

refer to the second floor W_Ygodaile response:
QTreeView is only part of the page using the show () will open a separate page


Refer to the following code

 

TreeView QTreeView *=new QTreeView;
QFileSystemModel model;
QString strPath=QStandardPaths: : writableLocation (QStandardPaths: : DesktopLocation);
Model. SetRootPath (strPath);
TreeView - & gt; SetModel (& amp; Model);

QLabel * label=new label (" this is a label ");

QGraphicsScene scene;
Scene. SetSceneRect (QRect (400, 400, 800, 800));

QGraphicsProxyWidget * labelProxy=scene. AddWidget (label);
LabelProxy - & gt; SetGeometry (QRect (400, 400, 400, 800));

QGraphicsProxyWidget * treeProxy=scene. AddWidget (treeView);
TreeProxy - & gt; SetGeometry (QRect (400-400, 800, 400));
TreeProxy - & gt; SetRotation (90);

QGraphicsView view (& amp; Scene);
The resize (800, 800);
view.show();

  •  Tags:  
  • Qt
  • Related