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. Do we have no color and null value for QColor
Qt 6.11 is out! See what's new in the release blog

Do we have no color and null value for QColor

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 1.8k Views 2 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.
  • Q Offline
    Q Offline
    Qt Enthusiast
    wrote on last edited by A Former User
    #1

    In the following code, I want to send null for QColor

    QColor myModel::getColorFromInstance(const QModelIndex& index ,myInst inst) const 
    {
      GQColor *gcObj =  myColor::getInstance();
      if (gcObj) {
         return QColor(Qt::white);
       // I want to send null value from here to notify there is no color value . is it possibel 
      }
    }
    

    Edit: Please wrap code snippets with 3 backticks. -- @Wieland

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by A Former User
      #2

      A QColor can be valid or invalid.

      QColor myFunc() {
          return QColor(); // returns an invalid QColor
      }
      
      1 Reply Last reply
      6

      • Login

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