logo
down
shadow

Not mirroring layout direction in some of Qt widgets


Not mirroring layout direction in some of Qt widgets

Content Index :

Not mirroring layout direction in some of Qt widgets
Tag : qt , By : Giles
Date : January 12 2021, 01:40 AM

hope this fix your issue So, The Problem was with the stylesheet that my app is using. this line of stylesheet "QComboBox{padding: 0 10 0 10;}" was the cause of problem. I removed it and problem solved. Though I don't know the reason.
Also for a specific widget that shouldn't get the app's layout-direction, the layout-direction must be set explicitly. like: theWidget->setLayoutDirection(Qt::LeftToRight);

Comments
No Comments Right Now !

Boards Message :
You Must Login Or Sign Up to Add Your Comments .

Share : facebook icon twitter icon

How to get text direction in Android and change layout dynamically according to the direction?


Tag : android , By : Barry
Date : March 29 2020, 07:55 AM
Any of those help Solution, was easier that I was thinking :) to JAVA
There is Bidi class. This class has getBaseLevel() method which returns 0 if your text is left-to-right otherwise 1 (if right-to-left).
@Override
    public View getView(final int position, View convertView, ViewGroup parent) {
        ViewHolder holder;

        Bidi bidi = new Bidi(userList.get(position).getName(), Bidi.DIRECTION_DEFAULT_LEFT_TO_RIGHT);
        if(bidi.getBaseLevel() == 0)
            convertView = myInflater.inflate(R.layout.list_add_friends_row, null);
        else
            convertView = myInflater.inflate(R.layout.list_add_friends_row_mirror, null);

...
Bidi bidi = new Bidi(userList.get(position).getName(), Bidi.DIRECTION_DEFAULT_LEFT_TO_RIGHT);
if(bidi.baseIsLeftToRight())
                convertView = myInflater.inflate(R.layout.list_add_friends_row, null);
            else
                convertView = myInflater.inflate(R.layout.list_add_friends_row_mirror, null);

Cleaning a Qt layout and adding other widgets does not work. Ghost widgets stay. Qt bug?


Tag : cpp , By : unfool
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further You are deleting the layout items, but not the widgets that the items used to manage. You must delete the widgets. All of the non-layout items will be deleted automatically when you delete the layout itself.
QHBoxLayout* row;
while(!rowLyts_.isEmpty() && (row = rowLyts_.takeAt(0))) 
{
  QLayoutItem *item;
  while ((item = row->takeAt(0))) {
    // The item will be deleted when the layout itself is
    // destructed. Items such as spacers will return a null
    // widget, its deletion is a safe no-op.
    delete item->widget();
    // We don't handle recursion into sublayouts.
    // We check for it so that we won't leak the layout.
    Q_ASSERT(!item->layout());
  }
  delete row;
}

PyQt5 grid layout expands for big widgets, but doesn't contract for small widgets


Tag : python , By : jim
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , I think it is impossible for main window because i can't find it in Qt Designer. But you can call mainwindow.adjustSize() on label.changed signal.
Update: Sorry, I was wrong. QLabel has no "changed" signal. Other way:
def _hide_feedback_label(self):
    self.lbl_feedback.setText('')

    self.adjustSize() # <--

How I can to create gridView with horizontal flickable direction and LeftToRight layout direction?


Tag : qt , By : dyarborough
Date : March 29 2020, 07:55 AM
may help you . I think this number order isnt easy to get without some paging functions. This is closest.
Window {
    visible: true
    width: 800
    height:1280
    title: qsTr("Hello World")

    GridView {
        id:grid
        width:parent.width*0.95 ; height: parent.height*0.95
        verticalLayoutDirection: Grid.TopToBottom
        layoutDirection: Qt.LeftToRight
        flow: Grid.TopToBottom
        anchors.centerIn: parent
        model: 11
        cellWidth: width/3;
        cellHeight: height/3
        flickableDirection: Flickable.HorizontalFlick

        delegate:Item  {
            width: grid.cellWidth
            height: grid.cellHeight

            Rectangle {
                color: Qt.rgba(Math.random(),Math.random(),Math.random(),1)
                width: parent.width*0.75
                height: parent.height*0.75

                Text {
                    id: name
                    text: index.toString()
                    font.pointSize: 20
                }
            }
        }
    }
}

Qt: disable layout mirroring in designer?


Tag : qt , By : orlandoferrer
Date : March 29 2020, 07:55 AM
Related Posts Related QUESTIONS :
  • Why can't I put a QFrame in a layout?
  • QDomDocument to QDomElement conversion
  • Use QML property inside a string
  • Where to put Qt QML non-visual application components
  • Accessing runtime-selected model roles in QML
  • QML. Issues in positioning tooltips on top of other elements
  • How to install a missing Qt module?
  • QMap does not name a type
  • qt qcombobox shows no scroll bar
  • How to set text alignment for all the data in the tableView without using FOR loop?
  • SAFEARRAY* to QByteArray
  • QML ListView with sections representing first letter of model's name role - sections are not visible
  • Select both child item and its parent in QGraphicsFramework
  • Qt static build with -target xp has MF.dll dependency
  • How to change the focus of QLineEdit automatically to another QLineEdit after input satisfy a criterion?
  • Cannot link shaders. ERROR:LINK-9 (line - 1) Missing main function for shade
  • PyQt5 on gnome has strange file dialogs
  • QtQuick.Controls 2.0 cannot accept width/height of ApplicationWindow
  • How to sort TreeView Items using QSortFilterProxyModel based on Combobox Selection
  • Qt app version autoincrement with custom target in .pro
  • How to prevent decompression bomb attack in Qt
  • Qt: How to lock/prevent a file from being read while it is written?
  • How to position a QStaticText by its baseline?
  • Q_OBJECT and Q_MOC_OUTPUT_REVISION . How and why we need to define the qt_metacast and qt_metacall
  • Where is the mistake in my code?
  • How to add menu to a widget derived from Qwidget
  • How to change maxVisibleItems in QFileDialog filter combobox
  • Apply different QSS stylesheet for custom QT class
  • QGraphicsItem::itemChange notified for position change but not for size change
  • Applying QTransform on QPainter - how to find translations
  • Get a list of all QObjects created in a Application
  • Can't load/save JPG image in Qt
  • QT ts files merging
  • How to make the QT text to reappear(Blink) every few milli seconds
  • QWizardPage: how to re-disable "Next" button
  • Is there a good source for 3rd party QT GUI controls?
  • Integrating OGRE 1.7 in Qt
  • Dragging the range of a RangeSlider
  • How to get selected item of the comboBox and save it as intiger
  • Using QCoreApplication::setEventFilter() in qt
  • Cucumber with Qt/QML
  • How to display icon in QDockWidget title bar?
  • How to change to tabButtons added dynamically on a TabBar in QML
  • QT How to remove the action menu item
  • How to sort QList according to a certain order (not alphabetical)?
  • Drawing rectangle line-by-line doesn't have the same result as drawing it directly
  • qml maps show pointer image on each click
  • how to draw 3d text on QtOpenGLWindow?
  • How to update Qt from 5.5.1 to 5.7 on Ubuntu 16.04?
  • How do I synchronize model views that have been hidden?
  • QML Column doesn't set child object width automatically
  • Why can't I use a ScrollView within a ColumnLayout?
  • QDateTime custom format escaping symbols
  • QML hide question mark from messagedialog
  • How can I ensure both randomly generated colors are not the same?
  • No viable overloaded "=" in qt
  • QML disable button after other button_click event and enable again after timer timeout
  • QT: How to retrieve floating point value from QLineEdit form fields
  • Yocto: remove packageconfig item
  • QVector::clear and QFile::close in QThreadPool
  • shadow
    Privacy Policy - Terms - Contact Us © scrbit.com