Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 2

Qt-interest Archive, December 2006
QTable -- getting rid of the cell outline when selected


Message 1 in thread

I've got a QTable which I've set to not selectable.
table->setSelectionMode( QTable::NoSelection );

I can't select a cell, per se, but when I click in a cell, I get
an outline around my cell.  It was pointed out to me that
selectCells() is not void, so I can't reimplement this in a
subclass.

Any otehr way?

--
 [ signature omitted ] 

Message 2 in thread

"Paul England" <pengland@xxxxxxxxxxxx> wrote in message 
news:4578F420.2010905@xxxxxxxxxxxxxxx
> I've got a QTable which I've set to not selectable.
> table->setSelectionMode( QTable::NoSelection );
>
> I can't select a cell, per se, but when I click in a cell, I get
> an outline around my cell.  It was pointed out to me that
> selectCells() is not void, so I can't reimplement this in a
> subclass.
>
> Any otehr way?

Seems to be the same with treeWidgets and listWidgets
as well.  I would also like to be able to prevent this. 


--
 [ signature omitted ] 

Message 3 in thread

Should I write this off as "impossible"?

Paul England wrote:
> I've got a QTable which I've set to not selectable.
> table->setSelectionMode( QTable::NoSelection );
>
> I can't select a cell, per se, but when I click in a cell, I get
> an outline around my cell.  It was pointed out to me that
> selectCells() is not void, so I can't reimplement this in a
> subclass.
>
> Any otehr way?
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>   

--
 [ signature omitted ] 

Message 4 in thread

"Paul England" <pengland@xxxxxxxxxxxx> wrote in message
news:4578F420.2010905@xxxxxxxxxxxxxxx
> I've got a QTable which I've set to not selectable.
> table->setSelectionMode( QTable::NoSelection );
>
> I can't select a cell, per se, but when I click in a cell, I get
> an outline around my cell.  It was pointed out to me that
> selectCells() is not void, so I can't reimplement this in a
> subclass.

Don't know if this helps for QTable nor if it's the correct
solution, but with QTreeWidget and QListWidget, if I
set the selectionMode to No selection, and set the
focusPolicy to Qt::NoFocus, this gets rid of the outline.


--
 [ signature omitted ] 

Message 5 in thread

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Are you using 4.2?&nbsp; In 3.3, I only have QTable::FollowStyle and
QTable::SpreadSheet<br>
for different Focus Styles.&nbsp; Looks like I'd either have to upgrade
(probably the smart thing)<br>
or figure out how to use setCurrentCell() to my advantage.<br>
<br>
Thanks for the lead though.<br>
<br>
Duane Hebert wrote:
<blockquote cite="midelkbgj$af0$1@xxxxxxxxxxxxxxxxxx" type="cite">
  <pre wrap="">"Paul England" <a class="moz-txt-link-rfc2396E" href="mailto:pengland@xxxxxxxxxxxx";>&lt;pengland@xxxxxxxxxxxx&gt;</a> wrote in message
<a class="moz-txt-link-freetext" href="news:4578F420.2010905@xxxxxxxxxxxx";>news:4578F420.2010905@xxxxxxxxxxxx</a>...
  </pre>
  <blockquote type="cite">
    <pre wrap="">I've got a QTable which I've set to not selectable.
table-&gt;setSelectionMode( QTable::NoSelection );

I can't select a cell, per se, but when I click in a cell, I get
an outline around my cell.  It was pointed out to me that
selectCells() is not void, so I can't reimplement this in a
subclass.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Don't know if this helps for QTable nor if it's the correct
solution, but with QTreeWidget and QListWidget, if I
set the selectionMode to No selection, and set the
focusPolicy to Qt::NoFocus, this gets rid of the outline.


--
 [ signature omitted ] 

Message 6 in thread

"Paul England" <pengland@xxxxxxxxxxxx> wrote in message 
news:457DF982.9030500@xxxxxxxxxxxxxxx
> Are you using 4.2?  In 3.3, I only have QTable::FollowStyle and 
> QTable::SpreadSheet
> for different Focus Styles.  Looks like I'd either have to upgrade 
> (probably the smart thing)
> or figure out how to use setCurrentCell() to my advantage.
>
> Thanks for the lead though.

Yes, I'm using 4.2 and there is a setFocusPolicy(Qt::NoFocus) available.
I had a similar problem with 3.3 and list widgets that I got around.  I'll 
look
at the code in the morning when I'm at the office.

I would probably upgrade though.  There are a lot of nice features in 4.2.
Depending on the size of your projects it may not be trivial though. 


--
 [ signature omitted ] 

Message 7 in thread

"Duane Hebert" <spoo@xxxxxxxxxx> wrote in message
news:ell3to$5rh$1@xxxxxxxxxxxxxxxxxxxxx
>
> "Paul England" <pengland@xxxxxxxxxxxx> wrote in message
> news:457DF982.9030500@xxxxxxxxxxxxxxx
> > Are you using 4.2?  In 3.3, I only have QTable::FollowStyle and
> > QTable::SpreadSheet
> > for different Focus Styles.  Looks like I'd either have to upgrade
> > (probably the smart thing)
> > or figure out how to use setCurrentCell() to my advantage.
> >
> > Thanks for the lead though.
>
> Yes, I'm using 4.2 and there is a setFocusPolicy(Qt::NoFocus) available.
> I had a similar problem with 3.3 and list widgets that I got around.  I'll
> look
> at the code in the morning when I'm at the office.

The object that I was thinking of is a QListBox called messagebox.

I do:
MessageBox->setPaletteForegroundColor("white" );
 MessageBox->setPaletteBackgroundColor("black" );
MessageBox->setSelectionMode(QListBox::NoSelection);


Then I have a subclassed QListBoxItem that gets inserted.  This
guy has an overloaded paint event using QSimpleRichText.


So I don't think this is going to help you with QTable.  With
Qt4, I was able to replace this with a QListWidget, inserting
QListWidgetItems
and setting the text color.  Much simpler.

--
 [ signature omitted ] 

Message 8 in thread

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hey Duane:<br>
<br>
I'm messing around w/ 4.2 on a machine now.&nbsp; My projects are all
relatively small, so porting is probably not a big deal.&nbsp; And yeah,
there seems to be some nice stuff in 4.2 that I'm missing out on.<br>
<br>
Duane Hebert wrote:
<blockquote cite="midell3to$5rh$1@xxxxxxxxxxxxxxxxxx" type="cite">
  <pre wrap="">"Paul England" <a class="moz-txt-link-rfc2396E" href="mailto:pengland@xxxxxxxxxxxx";>&lt;pengland@xxxxxxxxxxxx&gt;</a> wrote in message 
<a class="moz-txt-link-freetext" href="news:457DF982.9030500@xxxxxxxxxxxx";>news:457DF982.9030500@xxxxxxxxxxxx</a>...
  </pre>
  <blockquote type="cite">
    <pre wrap="">Are you using 4.2?  In 3.3, I only have QTable::FollowStyle and 
QTable::SpreadSheet
for different Focus Styles.  Looks like I'd either have to upgrade 
(probably the smart thing)
or figure out how to use setCurrentCell() to my advantage.

Thanks for the lead though.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Yes, I'm using 4.2 and there is a setFocusPolicy(Qt::NoFocus) available.
I had a similar problem with 3.3 and list widgets that I got around.  I'll 
look
at the code in the morning when I'm at the office.

I would probably upgrade though.  There are a lot of nice features in 4.2.
Depending on the size of your projects it may not be trivial though. 


--
 [ signature omitted ]