Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. want to hide the editor2 when we cliclking on treewidgetitem on left handside
Qt 6.11 is out! See what's new in the release blog

want to hide the editor2 when we cliclking on treewidgetitem on left handside

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 878 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    Qt Enthusiast
    wrote on last edited by VRonin
    #1

    I want to implement the windows 10 Outlook Mail feature which works in toggle mode

    when i first click qtreewidget item it shows be QTextEdit and when I again click the same qtreewidgetitem it hides the right hand side Qtextedit

    Can someone suggest me how to do that

    int main(int argc, char *argv[])
    {
        QApplication app(argc, argv);
    
        QTextEdit *editor1 = new QTreeWidget;
        QTextEdit *editor2 = new QTextEdit;
        
    
        QSplitter splitter(Qt::Horizontal);
        splitter.addWidget(editor1);
        splitter.addWidget(editor2);
        
        ...
        splitter.show();
        return app.exec();
    }
    
    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      @Qt-Enthusiast said in want to hide the editor2 when we cliclking on treewidgetitem on left handside:

      QTextEdit *editor1 = new QTreeWidget;

      ????

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      1
      • Q Offline
        Q Offline
        Qt Enthusiast
        wrote on last edited by
        #3

        @Qt-Enthusiast said in want to hide the editor2 when we cliclking on treewidgetitem on left handside:

        int main(int argc, char *argv[])
        {
        QApplication app(argc, argv);

        QTextEdit *editor1 = new QTreeWidget;
        QTextEdit *editor2 = new QTextEdit;
        
        
        QSplitter splitter(Qt::Horizontal);
        splitter.addWidget(editor1);
        splitter.addWidget(editor2);
        
        ...
        splitter.show();
        return app.exec();
        

        }

        int main(int argc, char *argv[])
        {
        QApplication app(argc, argv);

        QTreeWidget *editor1 = new QTreeWidget;
        QTextEdit *editor2 = new QTextEdit;
        
        
        QSplitter splitter(Qt::Horizontal);
        splitter.addWidget(editor1);
        splitter.addWidget(editor2);
        
        ...
        splitter.show();
        return app.exec();
        

        }
        reply quote 0

        1 Reply Last reply
        0
        • VRoninV Offline
          VRoninV Offline
          VRonin
          wrote on last edited by
          #4

          QObject::connect(editor1,&QAbstractItemView::clicked,[=](const QModelIndex& clickedIdx)->void{/*Do Something With editor2*/});

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          1 Reply Last reply
          4

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved