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. QTabWidget and layout direction problem [Solved]
Forum Updated to NodeBB v4.3 + New Features

QTabWidget and layout direction problem [Solved]

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.5k 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.
  • K Offline
    K Offline
    karim24
    wrote on last edited by
    #1

    i must change layout direction because i implimented multiple
    languages support in the app but when i change the layout direction
    the "close buttons icons " don't follow the tabs,
    if the tabwidget goes right they stay left and vise versa
    here is the changing layout direction code

    @////after loading and installing the translator
    if (language == "arabic"){
    setLayoutDirection(Qt::RightToLeft);
    ui->projectsTabWidget->setLayoutDirection(Qt::RightToLeft);
    }
    else{
    setLayoutDirection(Qt::LeftToRight);
    ui->projectsTabWidget->setLayoutDirection(Qt::LeftToRight);
    }@

    here is how it looks when i change the layoutdirection

    !http://i.imgur.com/sMG77vx.png(http://i.imgur.com/sMG77vx.png)!

    1 Reply Last reply
    0
    • K Offline
      K Offline
      karim24
      wrote on last edited by
      #2

      it' ok isolved the problem
      i noticed that when i select a tab the
      "close icon " return to its place automaticly
      so i eterate through all the tabs and select
      them one by one each time i change the layout
      direction

      @////save the currentindex in index
      int index=ui->projectsTabWidget->currentIndex();
      //iterate and select the tabs
      for(int i=0;i<ui->projectsTabWidget->count()-1;i++)
      ui->projectsTabWidget->setCurrentIndex(i);
      //reset the selected tab
      ui->projectsTabWidget->setCurrentIndex(index);@

      but if you know a better and a practical way,let me know

      1 Reply Last reply
      0

      • Login

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