Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. Tags
    3. color change
    Log in to post

    • Listview/delegates coloring
      General and Desktop • listview delegate color change newb • • Sydes  

      6
      0
      Votes
      6
      Posts
      1609
      Views

      Any reason why you can't use QStandardItemModel? in that case subclass QStyledItemDelegate and reimplement paint void QStyledItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { Q_ASSERT(index.isValid()); QStyleOptionViewItem opt = option; initStyleOption(&opt, index); ///////////////////////////////////// // Set the background based on the content if(index.data().toInt()==1) opt.backgroundBrush = QBrush(Qt::red); ///////////////////////////////////// const QWidget *widget = option.widget; QStyle *style = widget ? widget->style() : QApplication::style(); style->drawControl(QStyle::CE_ItemViewItem, &opt, painter, widget); }
    • SOLVED Changing colors of the QSlider
      General and Desktop • qslider color change painteevent • • marlenet15  

      2
      0
      Votes
      2
      Posts
      6075
      Views

      I figured out the answer. I have to create a QSlider from scratch meaning not one created from the ui already. So, QSlider *slider = new MySlider(Qt::horizontal); ui->frameTestLayout->addWidget(slider); slider->setFocusPolicy(Qt::NoFocus); slider->setTickPosition(QSlider::TicksAbove); slider->setTickInterval(number);
    • UNSOLVED RGB BGR colors issue on my linux target
      Mobile and Embedded • qimage embedded linuxfb color change rgb bgr • • IL  

      9
      0
      Votes
      9
      Posts
      4475
      Views

      i am facing same problem how to resolve this
    • How to change the color of the focus Widget in QT?
      General and Desktop • widget focus color change • • ForestPoem  

      5
      0
      Votes
      5
      Posts
      5011
      Views

      @Chris-Kawa Thanks to you I've been able to solve
    • Qt5.6 application : red and blue colors swapped
      Mobile and Embedded • qt5.6 qtwebkit framebuffer color change color depth • • florin  

      2
      0
      Votes
      2
      Posts
      1610
      Views

      Hi and welcome to devnet, Since you are using an unreleased version of Qt and hitting something that's probably influenced by the internals of Qt. I'd recommend posting your question on the interest mailing list You'll find there Qt's developers/maintainers (this forum is more user oriented)
    • Need advice to control button color on checked state transitions
      General and Desktop • qpushbutton color change • • bereid  

      2
      0
      Votes
      2
      Posts
      1060
      Views

      Hi, Depending on how your button should look like, Qt's stylesheet system might be the most simple solution Hope it helps
    • How to create/edit slot to change a widget's color
      General and Desktop • slots color change • • thestarsatnight  

      1
      0
      Votes
      1
      Posts
      604
      Views

      No one has replied

    • color of taurus label
      General and Desktop • qt4 pyqt4 color change taurus label • • binit amin  

      1
      0
      Votes
      1
      Posts
      527
      Views

      No one has replied