Re: [Interest] QTableView Column Width and Headers

2024-05-29 Thread Volker Hilsheimer via Interest
On 24 May 2024, at 20:39, Michael Jackson wrote: I have a question about how the column widths of a QTableView are calculated? How can I have the QTableView set the column with “to contents” that includes the QHeader also? For example I have a QHeaderView with the first “section” that has te

[Interest] QTableView Column Width and Headers

2024-05-24 Thread Michael Jackson
I have a question about how the column widths of a QTableView are calculated? How can I have the QTableView set the column with “to contents” that includes the QHeader also? For example I have a QHeaderView with the first “section” that has text “This is a really really really long header”, but the

Re: [Interest] QTableView, QSqlRelationalTableModel and QDateTimeEdit and timezones

2020-05-01 Thread Lisandro Damián Nicanor Pérez Meyer
Hi Tony! On Fri, 1 May 2020 at 02:00, Tony Rietwyk wrote: > > Hi Lisandro, > > AFAIK that is a bug in the design of the Qt SQL api's. There is no way > to specify to QSqlField/QSqlResult that the date being read is UTC. You > have to read the QSqlQuery yourself, convert the QVariant to QDateTim

Re: [Interest] QTableView, QSqlRelationalTableModel and QDateTimeEdit and timezones

2020-04-30 Thread Tony Rietwyk
Hi Lisandro, AFAIK that is a bug in the design of the Qt SQL api's.  There is no way to specify to QSqlField/QSqlResult that the date being read is UTC.  You have to read the QSqlQuery yourself, convert the QVariant to QDateTime, apply the time spec, then pass the value to the UI. Maybe you

[Interest] QTableView, QSqlRelationalTableModel and QDateTimeEdit and timezones

2020-04-30 Thread Lisandro Damián Nicanor Pérez Meyer
Hi! I have a database (PostgreSql) with a table that holds date/time in UTC. I've read this table with the QSqlRelationalTableModel and show the data with a QTableView and a QDateTimeEdit. I would like both the QTableView and the QDateEdit to show the time in local timezone, but I seem to be fail

[Interest] QTableView behavior; word wrapping plus rows resize to content

2018-12-13 Thread Bernhard Lindner
Hi! I am using a QTableView with word wrapping enabled and rows configured to resize to content automatically. Is it desired behavior that the view a does NOT update the row height when columns are manually resized in a way that a cell changes from single-line to double-line text (or vice vers

Re: [Interest] QTableView - only trigger edit event in lower part of cell

2018-05-03 Thread Michael Sué
Hi, Alternatively, you could use a QLabel that displays a context menu if clicked on. -Michael. From: Interest On Behalf Of Tony Rietwyk Sent: Thursday, May 3, 2018 3:21 AM To: interest@qt-project.org Subject: Re: [Interest] QTableView - only trigger edit event in lower part of

Re: [Interest] QTableView - only trigger edit event in lower part of cell

2018-05-01 Thread Frank Rueter | OHUfx
Ah, looks like my approach was correct but I had not turned off edit triggers properly, so those were interfering with the expected behaviour. On 1/05/18 8:21 PM, Frank Rueter | OHUfx wrote: Hi, I have spent several hours trying to get this right but seem to be failing: I have a QTableView (w

[Interest] QTableView - only trigger edit event in lower part of cell

2018-05-01 Thread Frank Rueter | OHUfx
Hi, I have spent several hours trying to get this right but seem to be failing: I have a QTableView (which uses a QAbstractTableModel) and a custom delegate which takes care of the cell painting. At the bottom of each cell I need a combo box which I want editable by a single click, so no clicki

[Interest] QTableView - auto check item when row is selected

2016-01-21 Thread Frank Rueter | OHUfx
Sending again as it didn't seem to hit the list the first time: Hi all, I'm writing a simple table view to display a selection of files available in a repository for the user to select for download. Using the model/view approach I have set the item to isCheckable(True). The one tweak in behavi

[Interest] QTableView - auto check item when row is selected

2016-01-20 Thread Frank Rueter | OHUfx
Hi all, I'm writing a simple table view to display a selection of files available in a repository for the user to select for download. Using the model/view approach I have set the item to isCheckable(True). The one tweak in behaviour I am trying to introduce is that I'd like the checkboxes to

[Interest] QTableView spinbox turned to line editor

2015-02-27 Thread nus1998
Hi All, I have a database and the parameter in it is integer type. when I created a new row in the table view (QTableView) and clicked the cell, a spinbox was displayed, but after I saved the table and clicked the cell again, it became to line editor and any characters are accepted. Any tips I

Re: [Interest] QTableView, readonly and selectable column text/data?

2014-08-15 Thread Mark Gaiser
On Fri, Aug 15, 2014 at 8:28 PM, Constantin Makshin wrote: > On Aug 15, 2014 4:52 PM, "Mark Gaiser" wrote: >> In my case i simply make a QLineEdit and set readOnly to false. > Wasn't the last part of the sentence supposed to be "set readOnly to true"? > :) Yes indeed, good catch :) Mailinglists

Re: [Interest] QTableView, readonly and selectable column text/data?

2014-08-15 Thread Constantin Makshin
On Aug 15, 2014 4:52 PM, "Mark Gaiser" wrote: > In my case i simply make a QLineEdit and set readOnly to false. Wasn't the last part of the sentence supposed to be "set readOnly to true"? :) ___ Interest mailing list Interest@qt-project.org http://lists.

Re: [Interest] QTableView, readonly and selectable column text/data?

2014-08-15 Thread Mark Gaiser
On Fri, Aug 15, 2014 at 1:59 PM, Mark Gaiser wrote: > Hi, > > I have a QTableView with data from a custom QSqlQueryModel. > So far so good, data displays just fine. > > I'm searching for functionality to select text in any column as if the > flag: Qt::ItemIsEditable is set. However, setting that a

[Interest] QTableView, readonly and selectable column text/data?

2014-08-15 Thread Mark Gaiser
Hi, I have a QTableView with data from a custom QSqlQueryModel. So far so good, data displays just fine. I'm searching for functionality to select text in any column as if the flag: Qt::ItemIsEditable is set. However, setting that also allows the user to edit (type) in the field which is not what

Re: [Interest] QTableView column format

2014-01-29 Thread Muhammad Bashir Al-Noimi
On 01/25/2014 11:54 AM, Andre Somers wrote: > Your delegate is dealing with the editor, but not with the display. Try > reimplementing the displayText method. Also, check if the data type you > get from the database really is numerical. SQLite can be weird with data > types in my experience. Ignore

Re: [Interest] QTableView column format

2014-01-29 Thread Muhammad Bashir Al-Noimi
On 01/25/2014 11:54 AM, Andre Somers wrote: > Your delegate is dealing with the editor, but not with the display. Try > reimplementing the displayText method. Also, check if the data type you > get from the database really is numerical. SQLite can be weird with data > types in my experience. I trie

Re: [Interest] QTableView column format

2014-01-25 Thread Andre Somers
Muhammad Bashir Al-Noimi schreef op 25-1-2014 12:13: > On 01/22/2014 10:24 AM, André Somers wrote: >> If you want to modify it at the 'view' end, you should use a >> QStyledItemDelegate subclass and install that on the view, or on a >> specific column of the view. > I did that exactly but unfortuna

Re: [Interest] QTableView column format

2014-01-25 Thread Muhammad Bashir Al-Noimi
On 01/22/2014 10:24 AM, André Somers wrote: > If you want to modify it at the 'view' end, you should use a > QStyledItemDelegate subclass and install that on the view, or on a > specific column of the view. I did that exactly but unfortunately it didn't work :( May you please tell me what's wrong?

Re: [Interest] QTableView column format

2014-01-22 Thread André Somers
Muhammad Bashir Al-Noimi schreef op 21-1-2014 18:22: >Howdy, > > I'm using QTableView in very basic mode to view a QSqlTableModel but one > of numeric column shows the numbers using 'e' factor while they should > be in digits only '100' > > How can I change the format of specific column

[Interest] QTableView column format

2014-01-21 Thread Muhammad Bashir Al-Noimi
Howdy, I'm using QTableView in very basic mode to view a QSqlTableModel but one of numeric column shows the numbers using 'e' factor while they should be in digits only '100' How can I change the format of specific column without subclassing QTableView? Can I change the format from

[Interest] qtableview and find widget

2013-10-22 Thread Mojmír Svoboda
Hello again, i have a QTabView and i want to show a custom widget (FindBox) in top left corner of the QTabView. I got this running via setParent() and move(), but i can't get the focus cycling by Tab key working in FindBox as QTabView eats my Tab key event. I bypassed this by listening in QAppli

Re: [Interest] QTableView::moveCursor and scrolling to end

2013-05-14 Thread Nurmi J-P
On May 14, 2013, at 9:17 AM, Mojmír Svoboda wrote: > Hello, > > my problem is simple: when an user press ctrl+end to scroll to the end > of the table then there is an implicit horizontal scroll to the right. > My users requested few times already to disable that behaviour. > > I subclassed QTa

Re: [Interest] QTableView::moveCursor and scrolling to end

2013-05-14 Thread Alex Malyushytskyy
>> I wonder what do you in general do, when you find yourselves in the need of accessing the private internals. If you absolutely need private you usually end up writing your own class. It happened to me 2 times during over 10 years of my Qt experience. Otherwise you are looking for the ways not t

Re: [Interest] QTableView::moveCursor and scrolling to end

2013-05-14 Thread Иван Комиссаров
You can use following hack: store current horizontal scroll position, call base implementation and restore scroll position. Иван Комиссаров 14.05.2013, в 11:17, Mojmír Svoboda написал(а): > Hello, > > my problem is simple: when an user press ctrl+end to scroll to the end > of the table then

[Interest] QTableView::moveCursor and scrolling to end

2013-05-14 Thread Mojmír Svoboda
Hello, my problem is simple: when an user press ctrl+end to scroll to the end of the table then there is an implicit horizontal scroll to the right. My users requested few times already to disable that behaviour. I subclassed QTableView as i did not found any other way (sorry if i missed somethin

Re: [Interest] QTableView

2013-03-27 Thread Bo Thorsen
; Look at QAbstractProxyModel > > > From: interest-bounces+pritam_ghanghas=infosys@qt-project.org > [interest-bounces+pritam_ghanghas=infosys@qt-project.org] on behalf of > pengliang(彭亮) [pengli...@founder.com] > Subject: [Interest] QTableView > >

Re: [Interest] QTableView

2013-03-27 Thread André Somers
Hi, First of all, please don't hijack somebody elses thread. Create a completely new message to the list instead of a reply in which you just edit the subject line. You're messing up threading. Op 27-3-2013 6:43, pengliang(??) schreef: Hi All QtableView display sql table. But I w

Re: [Interest] QTableView

2013-03-27 Thread Pritam Ghanghas
@qt-project.org] on behalf of pengliang(彭亮) [pengli...@founder.com] Sent: Wednesday, March 27, 2013 11:13 AM To: interest@qt-project.org Subject: [Interest] QTableView Hi All QtableView display sql table. But I want to merge data of two columns in sql table to one column in QtableView

[Interest] QTableView

2013-03-26 Thread 彭亮
Hi All QtableView display sql table. But I want to merge data of two columns in sql table to one column in QtableView. Eg: Sql table: 1 2 3 4 5 6 Aabb cc dd ee ff Gghh ii jj kk ll QtableView 1

Re: [Interest] QTableView does not scroll to fully display selected row

2012-06-18 Thread K. Frank
Hi Oliver! On Mon, Jun 18, 2012 at 2:30 AM, Till Oliver Knoll wrote: > Am 18.06.2012 um 05:09 schrieb "K. Frank" : >> ... >> I am using 4.8.0-rc1 on 64-bit windows 7, > > Any particular reason why you are using a Release Candidate version? The reason -- although maybe not a good reason -- is tha

Re: [Interest] QTableView does not scroll to fully display selected row

2012-06-17 Thread Till Oliver Knoll
Am 18.06.2012 um 05:09 schrieb "K. Frank" : > ... > > I am using 4.8.0-rc1 on 64-bit windows 7, Any particular reason why you are using a Release Candidate version? Why not at least 4.8.0, if not the latest 4.8.2? That is what I would try first. Cheers, Oliver __

[Interest] QTableView does not scroll to fully display selected row

2012-06-17 Thread K. Frank
Hello List! I am having a minor cosmetic problem with QTableView. I have a QTableView in QMainWindow laid out with Designer. It is connected to a QSqlTableModel. I add a new row at the end of the QSqlTableModel using QSqlTableModel::insertRecord. The new row shows up in the QTableView (as its